OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TCmdLine Class Reference

Command line argument processing class, processes in the form: More...

#include <owl/cmdline.h>

Public Types

enum  TKind { Start , Name , Option , Value , Done }
 

Public Member Functions

 TCmdLine (const tstring &cmdLine)
 
 ~TCmdLine ()
 
TKind NextToken (bool removeCurrent=false)
 
LPCTSTR GetLine () const
 
void Reset ()
 
tstring GetToken () const
 
TKind GetTokenKind () const
 

Detailed Description

Command line argument processing class, processes in the form:

<Name> | {-/}<Option>[{:=}<Value>] ...

Definition at line 35 of file cmdline.h.

Member Enumeration Documentation

◆ TKind

Enumerator
Start 

No tokens have been parsed yet.

Name 

Name type token, has no leading / or -.

Option 

Option type token. Leading / or - skipped by Token.

Value 

Value for name or option. Leading : or = skipped by Token.

Done 

No more tokens.

Definition at line 37 of file cmdline.h.

Constructor & Destructor Documentation

◆ TCmdLine()

owl::TCmdLine::TCmdLine ( const tstring & cmdLine)

Definition at line 17 of file cmdline.cpp.

References _tcscpy, and Reset().

◆ ~TCmdLine()

owl::TCmdLine::~TCmdLine ( )

Definition at line 31 of file cmdline.cpp.

Member Function Documentation

◆ GetLine()

LPCTSTR owl::TCmdLine::GetLine ( ) const
inline

Definition at line 48 of file cmdline.h.

◆ GetToken()

tstring owl::TCmdLine::GetToken ( ) const

Definition at line 94 of file cmdline.cpp.

◆ GetTokenKind()

TCmdLine::TKind owl::TCmdLine::GetTokenKind ( ) const
inline

Definition at line 72 of file cmdline.h.

◆ NextToken()

TCmdLine::TKind owl::TCmdLine::NextToken ( bool removeCurrent = false)

Definition at line 36 of file cmdline.cpp.

References _T, _tcscpy, _tcscspn, _tcsspn, Done, Name, Option, owl::terminator, Value, and owl::whitespace.

◆ Reset()

void owl::TCmdLine::Reset ( )

Definition at line 24 of file cmdline.cpp.

References Start.


The documentation for this class was generated from the following files: