ROSE  0.9.10.95
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 
122 
129  unsigned int threads;
131  std::string smtSolver;
137  : threads(0), smtSolver("none") {}
138 };
139 
147 ROSE_DLL_API extern GenericSwitchArgs genericSwitchArgs;
148 
159 ROSE_DLL_API void insertBooleanSwitch(Sawyer::CommandLine::SwitchGroup&, const std::string &switchName,
160  bool &storageLocation, const std::string &documentation);
161 
167 class ROSE_DLL_API SelfTest: public Sawyer::SharedObject {
168 public:
170 
175  virtual std::string name() const = 0;
176 
180  virtual bool operator()() = 0;
181 };
182 
187 ROSE_DLL_API extern std::vector<SelfTest::Ptr> selfTests;
188 
193 ROSE_DLL_API void runSelfTestsAndExit();
194 
196 template<class SelfTest>
198  selfTests.push_back(typename SelfTest::Ptr(new SelfTest));
199 }
200 
201 } // namespace
202 } // namespace
203 
204 #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.