aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/cpp/option_processor.h
diff options
context:
space:
mode:
authorGravatar Thiago Farina <tfarina@chromium.org>2016-10-17 15:57:13 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2016-10-18 10:56:33 +0000
commit80bb0f27a435974ac5105361bf79637aba519f98 (patch)
tree085df66994e412ed7740c89418870d847af7ce2d /src/main/cpp/option_processor.h
parentc0f3d4ee3aa81747f879efec4cbb65d4e72605d8 (diff)
cpp: header hygienization
* remove "using std::" declarations from header files * add missing "std::" to some string declarations at some header files * add "using std::string;" to some source files where necessary -- Change-Id: Ib64f62b5add499d6171fa922227194ac992fa542 Reviewed-on: https://bazel-review.googlesource.com/#/c/6630/ MOS_MIGRATED_REVID=136355671
Diffstat (limited to 'src/main/cpp/option_processor.h')
-rw-r--r--src/main/cpp/option_processor.h75
1 files changed, 34 insertions, 41 deletions
diff --git a/src/main/cpp/option_processor.h b/src/main/cpp/option_processor.h
index bb777e917b..472414de75 100644
--- a/src/main/cpp/option_processor.h
+++ b/src/main/cpp/option_processor.h
@@ -26,8 +26,6 @@
namespace blaze {
-using std::string;
-
// This class is responsible for parsing the command line of the Blaze binary,
// parsing blazerc files, and putting together the command that should be sent
// to the server.
@@ -39,81 +37,76 @@ class OptionProcessor {
// Parse a command line and the appropriate blazerc files. This should be
// invoked only once per OptionProcessor object.
- blaze_exit_code::ExitCode ParseOptions(const std::vector<string>& args,
- const string& workspace,
- const string& cwd,
- string* error);
+ blaze_exit_code::ExitCode ParseOptions(const std::vector<std::string>& args,
+ const std::string& workspace,
+ const std::string& cwd,
+ std::string* error);
blaze_exit_code::ExitCode ParseOptions(int argc, const char* argv[],
- const string& workspace,
- const string& cwd,
- string* error);
+ const std::string& workspace,
+ const std::string& cwd,
+ std::string* error);
// Get the Blaze command to be executed.
// Returns an empty string if no command was found on the command line.
- const string& GetCommand() const;
+ const std::string& GetCommand() const;
// Gets the arguments to the command. This is put together from the default
// options specified in the blazerc file(s), the command line, and various
// bits and pieces of information about the environment the blaze binary is
// executed in.
- void GetCommandArguments(std::vector<string>* result) const;
+ void GetCommandArguments(std::vector<std::string>* result) const;
StartupOptions* GetParsedStartupOptions() const;
- virtual blaze_exit_code::ExitCode FindUserBlazerc(const char* cmdLineRcFile,
- const string& rc_basename,
- const string& workspace,
- string* user_blazerc_file,
- string* error);
+ virtual blaze_exit_code::ExitCode FindUserBlazerc(
+ const char* cmdLineRcFile, const std::string& rc_basename,
+ const std::string& workspace, std::string* user_blazerc_file,
+ std::string* error);
private:
class RcOption {
public:
- RcOption(int rcfile_index, const string& option);
+ RcOption(int rcfile_index, const std::string& option);
const int rcfile_index() const { return rcfile_index_; }
- const string& option() const { return option_; }
+ const std::string& option() const { return option_; }
private:
int rcfile_index_;
- string option_;
+ std::string option_;
};
class RcFile {
public:
- RcFile(const string& filename, int index);
+ RcFile(const std::string& filename, int index);
blaze_exit_code::ExitCode Parse(
- const string& workspace,
- std::vector<RcFile*>* rcfiles,
- std::map<string, std::vector<RcOption> >* rcoptions,
- string* error);
- const string& Filename() const { return filename_; }
+ const std::string& workspace, std::vector<RcFile*>* rcfiles,
+ std::map<std::string, std::vector<RcOption> >* rcoptions,
+ std::string* error);
+ const std::string& Filename() const { return filename_; }
const int Index() const { return index_; }
private:
- static blaze_exit_code::ExitCode Parse(const string& workspace,
- const string& filename,
- const int index,
- std::vector<RcFile*>* rcfiles,
- std::map<string,
- std::vector<RcOption> >* rcoptions,
- std::list<string>* import_stack,
- string* error);
-
- string filename_;
+ static blaze_exit_code::ExitCode Parse(
+ const std::string& workspace, const std::string& filename,
+ const int index, std::vector<RcFile*>* rcfiles,
+ std::map<std::string, std::vector<RcOption> >* rcoptions,
+ std::list<std::string>* import_stack, std::string* error);
+
+ std::string filename_;
int index_;
};
- void AddRcfileArgsAndOptions(bool batch, const string& cwd);
- blaze_exit_code::ExitCode ParseStartupOptions(string *error);
+ void AddRcfileArgsAndOptions(bool batch, const std::string& cwd);
+ blaze_exit_code::ExitCode ParseStartupOptions(std::string* error);
std::vector<RcFile*> blazercs_;
- std::map<string, std::vector<RcOption> > rcoptions_;
- std::vector<string> args_;
+ std::map<std::string, std::vector<RcOption> > rcoptions_;
+ std::vector<std::string> args_;
unsigned int startup_args_;
- string command_;
- std::vector<string> command_arguments_;
+ std::string command_;
+ std::vector<std::string> command_arguments_;
bool initialized_;
std::unique_ptr<StartupOptions> parsed_startup_options_;
};