#include <T2CommandLine.h>
Definition at line 22 of file T2CommandLine.h.
◆ T2CommandLine() [1/2]
| T2CommandLine::T2CommandLine |
( |
| ) |
|
◆ T2CommandLine() [2/2]
| T2CommandLine::T2CommandLine |
( |
T2StringView | a_pchCommandLine | ) |
|
Definition at line 12 of file T2CommandLine.cpp.
13{
14 Create( a_pchCommandLine );
15}
void Create(T2StringView a_pchCommandLine)
◆ Create()
Definition at line 23 of file T2CommandLine.cpp.
24{
25 if ( a_pchCommandLine )
26 {
27 TSIZE uiCommandLineLength = a_pchCommandLine.
Length();
28 m_szCommandLine.Copy( a_pchCommandLine );
29 m_bInitialised =
TTRUE;
30
31 m_Parser.SetBuffer( a_pchCommandLine, uiCommandLineLength );
32
33
34 m_ParsedParams.Clear();
35
36 char szToken[ 1024 ];
37 while ( !m_Parser.IsOver() )
38 {
39 TBOOL bReadToken = m_Parser.ReadToken( szToken,
sizeof( szToken ) );
40
41 if ( bReadToken )
42 m_ParsedParams.Push( szToken );
43 }
44 }
45}
TFORCEINLINE TSIZE Length() const
◆ GetNextParameter()
| const TCHAR * T2CommandLine::GetNextParameter |
( |
const TCHAR * | a_pszParameter | ) |
const |
Definition at line 80 of file T2CommandLine.cpp.
81{
84
85 if ( bHasParam && iParamIndex + 1 < m_ParsedParams.Size() )
86 {
87 return m_ParsedParams[ iParamIndex + 1 ];
88 }
89
91}
TBOOL HasParameter(const TCHAR *a_pszParameter, TINT *a_pIndex=nullptr) const
◆ GetParameterValue()
| TString8 T2CommandLine::GetParameterValue |
( |
const TCHAR * | a_pszParameter, |
|
|
const TCHAR * | a_pszDefaultValue = nullptr ) const |
Definition at line 68 of file T2CommandLine.cpp.
69{
71
73
74 if ( pszValue )
75 return pszValue;
76
77 return a_pszDefaultValue;
78}
const TCHAR * GetNextParameter(const TCHAR *a_pszParameter) const
◆ HasParameter()
| TBOOL T2CommandLine::HasParameter |
( |
const TCHAR * | a_pszParameter, |
|
|
TINT * | a_pIndex = nullptr ) const |
Definition at line 47 of file T2CommandLine.cpp.
48{
50
51 if ( a_pIndex )
52 *a_pIndex = -1;
53
55 {
56 if ( it.Get() == a_pszParameter )
57 {
58 if ( a_pIndex )
59 *a_pIndex = it.Index();
60
62 }
63 }
64
66}
#define TARRAY_FOREACH(vecName, iteratorName)
The documentation for this class was generated from the following files: