Webmaster  |  Imprint 
C++ Server Pages
Main  |  License  |  Documentation  |  Download 

Arg< std::string > Class Template Reference

#include <cxxtools/arg.h>

List of all members.

Public Member Functions

 Arg (const std::string &def=std::string())
 Arg (int &argc, char *argv[], char ch, const std::string &def=std::string())
 Arg (int &argc, char *argv[], const char *str, const std::string &def=std::string())
 Arg (int &argc, char *argv[])
bool set (int &argc, char *argv[], char ch)
bool set (int &argc, char *argv[], const char *str)
bool set (int &argc, char *argv[])
bool setNoOpt (int &argc, char *argv[])
const std::string & getValue () const
 operator const std::string & () const
bool isSet () const


Detailed Description

template<>
class cxxtools::Arg< std::string >

Special handling for "std::string".

input-operator for std::string reads just the first word. This is not, what we normally expect, so this is speialized here.


Constructor & Destructor Documentation

Arg ( int &  argc,
char *  argv[],
char  ch,
const std::string &  def = std::string() 
)

Constructor for the short form.

Arg ( int &  argc,
char *  argv[],
const char *  str,
const std::string &  def = std::string() 
)

Constructor for the long form.

Arg ( int &  argc,
char *  argv[] 
)

Extracts the next parameter.


Member Function Documentation

bool set ( int &  argc,
char *  argv[],
char  ch 
)

setter for the short form.

bool set ( int &  argc,
char *  argv[],
const char *  str 
)

setter for the long form.

bool set ( int &  argc,
char *  argv[] 
)

Extracts the next parameter.

bool setNoOpt ( int &  argc,
char *  argv[] 
)

Extracts the next non-option-parameter.

const std::string& getValue (  )  const

returns the extracted value.

operator const std::string & (  )  const

argument is convertible to "const std::string&"

bool isSet (  )  const

returns true, when the option is not set and the default is used.

Copyright © 2008 The Tntnet Development Team
Tntnet 1.6