|
'Classic' CCA c++ binding (ccaffeine-only)
0.5.7
|
Simplest string container interface, ala C's argv. More...
#include <ArgvInterface.h>
Public Member Functions | |
| virtual | ~Argv () |
| Default destructor. | |
| virtual const char * | get (int index) CLASSIC_CCA_PURE |
| virtual int | getArgCount () CLASSIC_CCA_PURE |
| virtual void | appendArg (const char *arg) CLASSIC_CCA_PURE |
| Copy the arg given into the next slot in the argv. | |
Simplest string container interface, ala C's argv.
A little iterator interface interface around arrays of strings, whereever tbey may be fetched from an ESI interface. In particular: Exists because we want a simple, abstract alternative to the STL. Implementors are free to use the STL underneath this interface if they so choose.
An example of its use:
SomeConcreteArgvImpl argvimpl;
// perhaps the argv class from the reference implementation.
esi::Argv *argvi = dynamic_cast<esi::Argv *>(&argvimpl);
esi_int err;
err = object->getRunTimeModels(argvi, char *msg);
if (!err) {
const char *arg;
for (i = 0; (arg = argvi->get(i)) != 0; i++) {
do.something(arg);
}
delete argvi;
}
argvi = 0;
And inside the getRunTimeModels call, a set of calls on
argvi->appendArg(rtmodelName[i]);
occurs, filling in the answers.
This pattern keeps creation/management of all the memory associated with the Argv in the scope of the caller or internal to the Argv itself.
| virtual esi::Argv::~Argv | ( | ) | [inline, virtual] |
Default destructor.
{}
| virtual const char* esi::Argv::get | ( | int | index | ) | [virtual] |
| virtual int esi::Argv::getArgCount | ( | ) | [virtual] |
| virtual void esi::Argv::appendArg | ( | const char * | arg | ) | [virtual] |
Copy the arg given into the next slot in the argv.
1.7.6.1