Fixed C++ style on refactored function and variable names.
As described on
https://google.github.io/styleguide/cppguide.html#Function_Names :
"Ordinarily, functions should start with a capital letter and have a
capital letter for each new word (a.k.a. "upper camel case" or "Pascal
case")."
and
"Data members of classes (but not structs) additionally have trailing underscores. "
BUG: 26379932
Test: manual
Change-Id: I4b7f34b941c99547af667316d4b7d5e2749827d0
diff --git a/cmds/dumpstate/dumpstate.h b/cmds/dumpstate/dumpstate.h
index 3b51152..3b7c362 100644
--- a/cmds/dumpstate/dumpstate.h
+++ b/cmds/dumpstate/dumpstate.h
@@ -86,14 +86,14 @@
~DurationReporter();
- static uint64_t nanotime();
+ static uint64_t Nanotime();
private:
// TODO: use std::string for title, once dump_files() and other places that pass a char* are
// refactored as well.
- const char* mTitle;
- FILE* mOut;
- uint64_t mStarted;
+ const char* title_;
+ FILE* out_;
+ uint64_t started_;
};
/*
@@ -111,7 +111,7 @@
* if (!is_user_build()) {
* options.AsRoot();
* }
- * runCommand("command", {"args"}, options.Build());
+ * RunCommand("command", {"args"}, options.Build());
*/
class CommandOptions {
private:
@@ -119,11 +119,11 @@
private:
CommandOptionsValues(long timeout);
- long mTimeout;
- bool mAlways;
- RootMode mRootMode;
- StdoutMode mStdoutMode;
- std::string mLoggingMessage;
+ long timeout_;
+ bool always_;
+ RootMode rootMode_;
+ StdoutMode stdoutMode_;
+ std::string loggingMessage_;
friend class CommandOptions;
friend class CommandOptionsBuilder;
@@ -131,7 +131,7 @@
CommandOptions(const CommandOptionsValues& values);
- const CommandOptionsValues mValues;
+ const CommandOptionsValues values_;
public:
class CommandOptionsBuilder {
@@ -152,7 +152,7 @@
private:
CommandOptionsBuilder(long timeout);
- CommandOptionsValues mValues;
+ CommandOptionsValues values_;
friend class CommandOptions;
};
@@ -228,7 +228,7 @@
/* Prints the contents of a file. */
// TODO: use std::string for title once other char* title references are refactored.
-int dumpFile(const char* title, const std::string& path);
+int DumpFile(const char* title, const std::string& path);
/* saves the the contents of a file as a long */
int read_file_as_long(const char *path, long int *output);
@@ -263,7 +263,7 @@
* |options| optional argument defining the command's behavior.
*/
// TODO: use std::string for title once other char* title references are refactored.
-int runCommand(const char* title, const std::vector<std::string>& fullCommand,
+int RunCommand(const char* title, const std::vector<std::string>& fullCommand,
const CommandOptions& options = CommandOptions::DEFAULT);
/*
@@ -275,7 +275,7 @@
* |dumpsys_args| `dumpsys` arguments (except `-t`).
* |options| optional argument defining the command's behavior.
*/
-void runDumpsys(const std::string& title, const std::vector<std::string>& dumpsysArgs,
+void RunDumpsys(const std::string& title, const std::vector<std::string>& dumpsysArgs,
const CommandOptions& options = CommandOptions::DEFAULT_DUMPSYS);
/* switch to non-root user and group */