OLD | NEW |
| (Empty) |
1 // Copyright 2011 The Native Client SDK Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can | |
3 // be found in the LICENSE file. | |
4 | |
5 #ifndef SRC_EXPERIMENTAL_DEBUG_SERVER_COMMON_DEBUG_COMMAND_LINE_H_ | |
6 #define SRC_EXPERIMENTAL_DEBUG_SERVER_COMMON_DEBUG_COMMAND_LINE_H_ | |
7 | |
8 #include <string> | |
9 | |
10 namespace debug { | |
11 | |
12 // This class works with command lines. | |
13 // Switches can optionally have a value attached as in "--switch value". | |
14 | |
15 class CommandLine { | |
16 public: | |
17 CommandLine(int argc, char* argv[]); // Initialize from argv vector. | |
18 ~CommandLine(); | |
19 | |
20 // Returns the value associated with the given switch. | |
21 std::string GetStringSwitch(const std::string& name, | |
22 const std::string& default_value) const; | |
23 int GetIntSwitch(const std::string& name, int default_value) const; | |
24 bool HasSwitch(const std::string& name) const; | |
25 | |
26 std::string ToString() const; | |
27 | |
28 private: | |
29 int argc_; | |
30 char** argv_; | |
31 }; | |
32 } // namespace debug | |
33 #endif // SRC_EXPERIMENTAL_DEBUG_SERVER_COMMON_DEBUG_COMMAND_LINE_H_ | |
34 | |
35 | |
OLD | NEW |