Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages | Examples

ArArgumentBuilder Class Reference

#include <ArArgumentBuilder.h>

List of all members.


Detailed Description

This class is to build arguments for things that require argc and argv.

Definition at line 32 of file ArArgumentBuilder.h.

Public Member Functions

void add (const char *str,...)
 Adds the given string, with varargs, separates if there are spaces

Java and Python Wrappers: Not available.

void addPlain (const char *str, int position=-1)
 Adds the given string, without varargs (wrapper for java).
void addPlainAsIs (const char *str, int position=-1)
 Adds the given string, without varargs and without touching the str.
void addStrings (int argc, char **argv, int position=-1)
 Adds the given string thats divided.
void addStrings (char **argv, int argc, int position=-1)
 Adds the given string thats divided.
void addStringsAsIs (int argc, char **argv, int position=-1)
 Adds the given string thats divided (but doesn't touch the strings).
 ArArgumentBuilder (const ArArgumentBuilder &builder)
 Copy Constructor.
 ArArgumentBuilder (size_t argvLen=512, char extraSpaceChar= '\0')
 Constructor.
void compressQuoted (bool stripQuotationMarks=false)
 Combines quoted arguments into one.
const char * getArg (size_t whichArg) const
 Gets a specific argument.
bool getArgBool (size_t whichArg) const
 Gets the value of an argument as a boolean (check with isArgBool).
size_t getArgc (void) const
 Gets the argc.
double getArgDouble (size_t whichArg) const
 Gets the value of an argument as a double (check with isArgDouble).
int getArgInt (size_t whichArg) const
 Gets the value of an argument as an integer (check with isArgInt).
char ** getArgv (void) const
 Gets the argv.
const char * getExtraString (void) const
 Gets the extra string of the input, used differently by different things.
const char * getFullString (void) const
 Gets the original string of the input.
bool isArgBool (size_t whichArg) const
 Sees if an argument is a bool.
bool isArgDouble (size_t whichArg) const
 Sees if an argument is a double.
bool isArgInt (size_t whichArg) const
 Sees if an argument is an int.
void log (void) const
 Prints out the arguments.
void removeArg (size_t which)
 Delete a particular arg, you MUST finish adding before you can remove.
void setExtraString (const char *str)
 Sets the extra string of the input, used differently by different things.
void setFullString (const char *str)
 Sets the full string (this is so you can have a more raw full string).
virtual ~ArArgumentBuilder ()
 Destructor.

Protected Member Functions

size_t getArgvLen (void) const
void internalAdd (const char *str, int position=-1)
void internalAddAsIs (const char *str, int position=-1)

Protected Attributes

size_t myArgc
char ** myArgv
size_t myArgvLen
char myExtraSpace
std::string myExtraString
bool myFirstAdd
std::string myFullString
size_t myOrigArgc


Constructor & Destructor Documentation

ArArgumentBuilder::ArArgumentBuilder size_t  argvLen = 512,
char  extraSpaceChar = '\0'
 

Constructor.

Parameters:
argvLen the largest number of arguments we'll parse
extraSpaceChar if not NULL, then this character will also be used to break up arguments (in addition to whitespace)

Definition at line 40 of file ArArgumentBuilder.cpp.


Member Function Documentation

void ArArgumentBuilder::addPlain const char *  str,
int  position = -1
 

Adds the given string, without varargs (wrapper for java).

Parameters:
str the string to add
position the position to add the string at, a position less than 0 means to add at the end, if this number is greater than how many positions exist then it will also be added at the end

Definition at line 248 of file ArArgumentBuilder.cpp.

void ArArgumentBuilder::addPlainAsIs const char *  str,
int  position = -1
 

Adds the given string, without varargs and without touching the str.

Parameters:
str the string to add
position the position to add the string at, a position less than 0 means to add at the end, if this number is greater than how many positions exist then it will also be added at the end

Definition at line 303 of file ArArgumentBuilder.cpp.

void ArArgumentBuilder::addStrings int  argc,
char **  argv,
int  position = -1
 

Adds the given string thats divided.

Parameters:
argc how many arguments to add
argv the strings to add
position the position to add the string at, a position less than 0 means to add at the end, if this number is greater than how many positions exist then it will also be added at the end

Definition at line 273 of file ArArgumentBuilder.cpp.

void ArArgumentBuilder::addStrings char **  argv,
int  argc,
int  position = -1
 

Adds the given string thats divided.

Parameters:
argc how many arguments to add
argv the strings to add
position the position to add the string at, a position less than 0 means to add at the end, if this number is greater than how many positions exist then it will also be added at the end

Definition at line 260 of file ArArgumentBuilder.cpp.

void ArArgumentBuilder::addStringsAsIs int  argc,
char **  argv,
int  position = -1
 

Adds the given string thats divided (but doesn't touch the strings).

Parameters:
argc how many arguments to add
argv the strings to add
position the position to add the string at, a position less than 0 means to add at the end, if this number is greater than how many positions exist then it will also be added at the end

Definition at line 288 of file ArArgumentBuilder.cpp.

void ArArgumentBuilder::internalAdd const char *  str,
int  position = -1
[protected]
 

Internal function that adds a string starting at some given space

Parameters:
str the string to add
position the position to add the string at, a position less than 0 means to add at the end, if this number is greater than how many positions exist then it will also be added at the end

Definition at line 115 of file ArArgumentBuilder.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Feb 20 10:51:42 2007 for Aria by  doxygen 1.4.0