ROSE  0.9.10.54
roseSupport/CommandLine.h
1 #ifndef ROSE_CommandLine_H
2 #define ROSE_CommandLine_H
3 
4 #include <Sawyer/CommandLine.h>
5 
6 namespace Rose {
7 
43 namespace CommandLine {
44 
53 ROSE_DLL_API Sawyer::CommandLine::Parser createEmptyParser(const std::string &purpose, const std::string &description);
54 
67 ROSE_DLL_API Sawyer::CommandLine::Parser createEmptyParserStage(const std::string &purpose, const std::string &description);
68 
95 
100  unsigned int threads;
102  std::string smtSolver;
108  : threads(0), smtSolver("none") {}
109 };
110 
116 ROSE_DLL_API extern GenericSwitchArgs genericSwitchArgs;
117 
126 ROSE_DLL_API void insertBooleanSwitch(Sawyer::CommandLine::SwitchGroup&, const std::string &switchName,
127  bool &storageLocation, const std::string &documentation);
128 
132 class ROSE_DLL_API SelfTest: public Sawyer::SharedObject {
133 public:
135 
140  virtual std::string name() const = 0;
141 
145  virtual bool operator()() = 0;
146 };
147 
152 ROSE_DLL_API extern std::vector<SelfTest::Ptr> selfTests;
153 
158 ROSE_DLL_API void runSelfTestsAndExit();
159 
161 template<class SelfTest>
163  selfTests.push_back(typename SelfTest::Ptr(new SelfTest));
164 }
165 
166 } // namespace
167 } // namespace
168 
169 #endif
ROSE_DLL_API Sawyer::CommandLine::SwitchGroup genericSwitches()
Generic command-line components.
ROSE_DLL_API Sawyer::CommandLine::Parser createEmptyParserStage(const std::string &purpose, const std::string &description)
Empty command-line parser suitable for use with other parsers.
ROSE_DLL_API void runSelfTestsAndExit()
Runs the self tests and then exits the program.
A collection of related switch declarations.
Type for storing generic switch arguments.
Main namespace for the ROSE library.
void insertSelfTest()
Convenient way to add a command-line self test.
Reference-counting smart pointer.
Definition: SharedPointer.h:34
The parser for a program command line.
unsigned int threads
Number of threads analyses should use.
ROSE_DLL_API Sawyer::CommandLine::Parser createEmptyParser(const std::string &purpose, const std::string &description)
Empty command-line parser.
Base class for reference counted objects.
Definition: SharedObject.h:22
ROSE_DLL_API void insertBooleanSwitch(Sawyer::CommandLine::SwitchGroup &, const std::string &switchName, bool &storageLocation, const std::string &documentation)
Convenience for for adding Boolean switches.
ROSE_DLL_API std::vector< SelfTest::Ptr > selfTests
Collection of self tests to be run by –self-tests switch.
ROSE_DLL_API GenericSwitchArgs genericSwitchArgs
Global location for parsed generic command-line switches.
Base class for self tests.
std::string smtSolver
Name of SMT solver interface.