ost::CommandOptionParse(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸ’– 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