ROSE  0.11.51.0
Rose/CommandLine.h
1 #ifndef ROSE_CommandLine_H
2 #define ROSE_CommandLine_H
3 
4 #include <Sawyer/CommandLine.h>
5 #include <Rose/Color.h>
6 
7 namespace Rose {
8 
44 namespace CommandLine {
45 
54 ROSE_DLL_API Sawyer::CommandLine::Parser createEmptyParser(const std::string &purpose, const std::string &description);
55 
68 ROSE_DLL_API Sawyer::CommandLine::Parser createEmptyParserStage(const std::string &purpose, const std::string &description);
69 
123 
130  unsigned int threads;
132  std::string smtSolver;
146  : threads(0), smtSolver("none"), errorIfDisabled(true) {}
147 };
148 
156 ROSE_DLL_API extern GenericSwitchArgs genericSwitchArgs;
157 
165 ROSE_DLL_API extern std::string versionString; // intentionally non-const so tools can change it
166 
177 ROSE_DLL_API void insertBooleanSwitch(Sawyer::CommandLine::SwitchGroup&, const std::string &switchName,
178  bool &storageLocation, const std::string &documentation);
179 
185 class ROSE_DLL_API SelfTest: public Sawyer::SharedObject {
186 public:
188 
193  virtual std::string name() const = 0;
194 
198  virtual bool operator()() = 0;
199 };
200 
205 ROSE_DLL_API extern std::vector<SelfTest::Ptr> selfTests;
206 
211 ROSE_DLL_API void runSelfTestsAndExit();
212 
214 template<class SelfTest>
216  selfTests.push_back(typename SelfTest::Ptr(new SelfTest));
217 }
218 
222 extern const char *licenseText;
223 
224 } // namespace
225 } // namespace
226 
227 #endif
Color::Colorization colorization
Controls colorized output.
Control colored command output.
Definition: Rose/Color.h:40
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 intrusive smart pointer.
Definition: SharedPointer.h:68
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.
ROSE_DLL_API std::string versionString
Global location for version string.
Base class for reference counted objects.
Definition: SharedObject.h:64
const char * licenseText
Text of the ROSE software license.
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.
bool errorIfDisabled
Controls behavior of a tool when disabled.
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.