Gromacs
2024.4
|
#include <gromacs/commandline/cmdlineprogramcontext.h>
Program context implementation for command line programs.
Constructors are provided mostly for unit testing purposes; in normal usage, a single CommandLineProgramContext object is constructed with initForCommandLine() in the beginning of the program. The returned object can be explicitly passed to other methods, or accessed through getProgramContext().
Unless explicitly noted otherwise, methods in this class may throw std::bad_alloc on out-of-memory conditions, but do not throw other exceptions.
Public Member Functions | |
CommandLineProgramContext () | |
Constructs an empty context object. More... | |
CommandLineProgramContext (const char *binaryName) | |
Initializes a program context object with binary name only. More... | |
CommandLineProgramContext (int argc, const char *const argv[]) | |
Initializes a program context object based on command line. More... | |
CommandLineProgramContext (int argc, const char *const argv[], ExecutableEnvironmentPointer env) | |
Initializes a program context object based on command line. More... | |
void | setDisplayName (const std::string &name) |
Sets a display name for the binary. More... | |
const char * | programName () const override |
Returns the name of the binary as it was invoked without any path. More... | |
const char * | displayName () const override |
Returns a display name of the current module. More... | |
std::filesystem::path | fullBinaryPath () const override |
Returns the full path of the running binary. More... | |
InstallationPrefixInfo | installationPrefix () const override |
Returns the installation prefix (for finding GROMACS data files). More... | |
const char * | commandLine () const override |
Returns the full command line used to invoke the binary. More... | |