ost::CommandOptionParse(3)
π ost::CommandOptionParse β Library Functions Manual, section 3 π
okay bestie, sit DOWN, because today we're talking about ost::CommandOptionParse, a whole interface class from the GNU CommonC++ library. it's giving β¨abstract base classβ¨, it's giving "you don't instantiate me, you inherit from me," and honestly? iconic. π«Ά
πΈ NAME πΈ
ost::CommandOptionParse β this is the CommandOptionParse interface class. that's the whole name, no cap. π
β¨ SYNOPSIS β¨
first things first, you gotta pull it in:
#include <cmdoptns.h>
π¦ Public Member Functions π¦
virtual ~CommandOptionParse ()=0β virtual destructor, and it's pure virtual, needed so that the object may be correctly deleted. yes bestie, a pure virtual destructor is real and it's valid, don't @ me πvirtual bool argsHaveError ()=0β get the value of the error flag, which gets set if the parser encountered errors. basically "did something go wrong, yes or no" π¨virtual const char * printErrors ()=0β return a string of text describing the list of errors encountered. the receipts, if you will πvirtual const char * printUsage ()=0β return a string that contains the usage description of this list of paramaters. (yes, "paramaters", that's the original spelling, we keep the details exactly fr fr π)virtual void registerError (const char *errMsg)=0β register an error with this parser. log it, girlie πvirtual void performTask ()=0β the method should be invoked by the main code once it has determined that the application should be started. this is the "go, bestie, go" button π
π Detailed Description π
This is the CommandOptionParse interface class. periodt. π
To implement this object you can call makeCommandOptionParse(); β this will instantiate a dynamically allocated version of this class and parse the command line for the list of command options that are passed in. so like, the whole command line situation? handled. main character energy tbh π
π Author π
Gianni Mariani gianni@mariani.ws β thank you king, we appreciate you πββοΈ
π Examples π
cmdlineopt.cpp.
π Constructor & Destructor Documentation π
virtual ost::CommandOptionParse::~CommandOptionParse () [pure virtual]
Virtual destructor needed so that the object may be correctly deleted. that's it, that's the vibe. delete responsibly, bestie π§
π₯ Member Function Documentation π₯
virtual bool ost::CommandOptionParse::argsHaveError () [pure virtual]
Get the value of the error flag set if the parser encountered errors.
Examples
cmdlineopt.cpp.
virtual void ost::CommandOptionParse::performTask () [pure virtual]
The method should be invoked by the main code once it has determined that the application should be started.
Examples
cmdlineopt.cpp.
virtual const char* ost::CommandOptionParse::printErrors () [pure virtual]
Return a string of text describing the list of errors encountered.
Examples
cmdlineopt.cpp.
virtual const char* ost::CommandOptionParse::printUsage () [pure virtual]
Return a string that contains the usage description of this list of paramaters.
Examples
cmdlineopt.cpp.
virtual void ost::CommandOptionParse::registerError (const char * errMsg) [pure virtual]
Register an error with this parser. This string will be appended to the errors already buffered in this object. so it stacks up, one error at a time, lowkey collecting them like little souvenirs π
Examples
cmdlineopt.cpp.
π Author π
Generated automatically by Doxygen for GNU CommonC++ from the source code. not me being a Doxygen girlie, that's just how the docs get made, iykyk π€β¨
and that's the whole page bestie, every option, every signature, every pure virtual, all accounted for. no details were harmed in the making of this rewrite π«Ά
GNU CommonC++ Β· Sun Dec 27 2020 Β· ost::CommandOptionParse(3) β mwah, slay, go write some command line parsers ππΈπ
π¦ where this page comes from
- ubuntu jammy: libcommoncpp2-doc 1.8.1-10
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms