added backward compatibility

This commit is contained in:
mes5k 2004-01-08 05:30:05 +00:00
parent 9385af7073
commit 6f5b735414
2 changed files with 37 additions and 0 deletions

View File

@ -88,8 +88,30 @@ class CmdLine
*/ */
bool _emptyCombined(const string& s); bool _emptyCombined(const string& s);
private:
/**
* Encapsulates the code common to the constructors (which is all
* of it).
*/
void _constructor();
public: public:
/**
* Command line constructor. DEPRECATED!!! This is here to maintain
* backwards compatibility with earlier releases. Note that the
* program name will be overwritten with argv[0]. The delimiter
* used is ' ' (as before).
* \param name - The program name - will be overwritten with argv[0].
* \param message - The message to be used in the usage output.
* \param version - The version number to be used in the
* --version switch.
*/
CmdLine(const string& name,
const string& message,
const string& version = "none" );
/** /**
* Command line constructor. Defines how the arguments will be * Command line constructor. Defines how the arguments will be
* parsed. * parsed.

View File

@ -24,12 +24,27 @@
namespace TCLAP { namespace TCLAP {
CmdLine::CmdLine(const string& n, const string& m, const string& v )
: _progName(n),
_message(m),
_version(v),
_numRequired(0),
_delimiter(' ')
{
_constructor();
}
CmdLine::CmdLine(const string& m, char delim, const string& v ) CmdLine::CmdLine(const string& m, char delim, const string& v )
: _progName("not_set_yet"), : _progName("not_set_yet"),
_message(m), _message(m),
_version(v), _version(v),
_numRequired(0), _numRequired(0),
_delimiter(delim) _delimiter(delim)
{
_constructor();
}
void CmdLine::_constructor()
{ {
Arg::setDelimiter( _delimiter ); Arg::setDelimiter( _delimiter );