5 #include <libutl/Array.h> 6 #include <libutl/RBtree.h> 7 #include <libutl/String.h> 80 bool isSet(
const String& sw,
String* val =
nullptr,
size_t* swIdx =
nullptr);
86 return getFlag(flg_owner);
93 setFlag(flg_owner, owner);
100 return _array.items();
110 return _args.empty();
118 void parse(
int argc,
char** argv);
124 void parse(
const Array& args);
132 bool printErrors(
Stream& os,
const String* prefix =
nullptr);
140 return _array.operator[](idx);
146 return _array.operator[]((size_t)idx);
155 return _array.operator()(idx);
161 return _array.operator()((size_t)idx);
179 init(
int argc,
char** argv)
const String * operator[](size_t idx) const
Return the argument at the given index.
bool ok() const
Determine whether any unknown switches were given.
void deInit()
De-initialize UTL++.
#define UTL_CLASS_DECL(DC, BC)
Declaration of standard UTL++ functionality for a non-template class.
Mix-in to provide 64-bits for space-efficient storage of up to 64 boolean flags.
Parse command-line arguments.
CmdLineArgs(const Array &args)
Constructor.
SortedCollection that stores objects in an array.
const String * operator[](int idx) const
Same as above, but takes a signed argument.
const String & operator()(size_t idx) const
Return the argument at the given index.
const TArray< String > & getArray() const
Get the argument array.
Template version of Array.
void setOwner(bool owner)
Set the ownership flag.
size_t idx() const
Return the index of the first non-switch argument.
size_t items() const
Return the number of arguments.
CmdLineArgs(int argc, char **argv)
Constructor.
bool isOwner() const
Get the ownership flag.
const String & operator()(int idx) const
Same as above, but takes a signed argument.
Root of UTL++ class hierarchy.
void init()
Initialize UTL++.