now the Arg adds itself to the CmdLine arglist

This commit is contained in:
mes5k 2004-02-13 23:21:38 +00:00
parent 4337d270db
commit c17ad76595
3 changed files with 28 additions and 0 deletions

View File

@ -132,6 +132,12 @@ class Arg
void _checkWithVisitor() const;
public:
/**
* Adds this to the specified list of Args.
* \param argList - The list to add this to.
*/
virtual void addToList( list<Arg*>& argList ) const;
/**
* Begin ignoring arguments since the "--" argument was specified.

View File

@ -91,6 +91,11 @@ class UnlabeledMultiArg : public MultiArg<T>
*/
virtual bool operator==(const Arg& a) const;
/**
* Pushes this to back of list rather than front.
* \param argList - The list this should be added to.
*/
virtual void addToList( list<Arg*>& argList ) const;
};
template<class T>
@ -142,6 +147,12 @@ bool UnlabeledMultiArg<T>::operator==(const Arg& a) const
return false;
}
template<class T>
void UnlabeledMultiArg<T>::addToList( list<Arg*>& argList ) const
{
argList.push_back( (Arg*)this );
}
}
#endif

View File

@ -101,6 +101,11 @@ class UnlabeledValueArg : public ValueArg<T>
*/
virtual bool operator==(const Arg& a ) const;
/**
* Instead of pushing to the front of list, push to the back.
* \param argList - The list to add this to.
*/
virtual void addToList( list<Arg*>& argList ) const;
};
/**
@ -175,5 +180,11 @@ bool UnlabeledValueArg<T>::operator==(const Arg& a ) const
return false;
}
template<class T>
void UnlabeledValueArg<T>::addToList( list<Arg*>& argList ) const
{
argList.push_back( (Arg*)this );
}
}
#endif