OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Loading...
Searching...
No Matches
cmdline.h
Go to the documentation of this file.
1
//----------------------------------------------------------------------------
2
// ObjectWindows
3
// Copyright (c) 1992, 1996 by Borland International, All Rights Reserved
4
//
5
/// \file
6
/// Command line parsing class
7
//----------------------------------------------------------------------------
8
9
#if !defined(OWL_CMDLINE_H)
10
#define OWL_CMDLINE_H
11
12
#include <
owl/private/defs.h
>
13
#if defined(BI_HAS_PRAGMA_ONCE)
14
# pragma once
15
#endif
16
17
#include <
owl/defs.h
>
18
19
20
namespace
owl
{
21
22
#include <
owl/preclass.h
>
23
24
/// \addtogroup utility
25
/// @{
26
27
28
//
29
/// \class TCmdLine
30
// ~~~~~ ~~~~~~~~
31
/// Command line argument processing class, processes in the form:
32
//
33
/// <Name> | {-/}<Option>[{:=}<Value>] ...
34
//
35
class
_OWLCLASS
TCmdLine
{
36
public
:
37
enum
TKind
{
38
Start
,
///< No tokens have been parsed yet
39
Name
,
///< Name type token, has no leading / or -
40
Option
,
///< Option type token. Leading / or - skipped by Token
41
Value
,
///< Value for name or option. Leading : or = skipped by Token
42
Done
///< No more tokens
43
};
44
TCmdLine
(
const
tstring
& cmdLine);
45
~TCmdLine
();
46
47
TKind NextToken(
bool
removeCurrent=
false
);
48
LPCTSTR
GetLine
()
const
{
return
Buffer;}
49
void
Reset();
50
51
tstring
GetToken()
const
;
52
TKind GetTokenKind()
const
;
53
54
#if defined(OWL5_COMPAT)
55
public
:
56
#else
57
private
:
58
#endif
59
TKind Kind;
///< Kind of current token
60
LPTSTR Token;
///< Ptr to current token. (Not 0-terminated, use TokenLen)
61
int
TokenLen;
///< Length of current token
62
63
private
:
64
LPTSTR Buffer;
///< Command line buffer
65
LPTSTR TokenStart;
///< Actual start of current token
66
};
67
68
/// @}
69
70
#include <
owl/posclass.h
>
71
72
inline
TCmdLine::TKind
TCmdLine::GetTokenKind
()
const
73
{
74
return
Kind;
75
}
76
77
78
}
// OWL namespace
79
80
81
82
#endif
// OWL_CMDLINE_H
owl::TCmdLine
Command line argument processing class, processes in the form:
Definition
cmdline.h:35
owl::TCmdLine::TCmdLine
TCmdLine(const tstring &cmdLine)
Definition
cmdline.cpp:17
owl::TCmdLine::TKind
TKind
Definition
cmdline.h:37
owl::TCmdLine::Option
@ Option
Option type token. Leading / or - skipped by Token.
Definition
cmdline.h:40
owl::TCmdLine::Value
@ Value
Value for name or option. Leading : or = skipped by Token.
Definition
cmdline.h:41
owl::TCmdLine::Start
@ Start
No tokens have been parsed yet.
Definition
cmdline.h:38
owl::TCmdLine::Done
@ Done
No more tokens.
Definition
cmdline.h:42
owl::TCmdLine::Name
@ Name
Name type token, has no leading / or -.
Definition
cmdline.h:39
owl::TCmdLine::GetTokenKind
TKind GetTokenKind() const
Definition
cmdline.h:72
owl::TCmdLine::GetLine
LPCTSTR GetLine() const
Definition
cmdline.h:48
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
owl::tstring
std::string tstring
Definition
defs.h:79
defs.h
General definitions used by all ObjectWindows programs.
defs.h
_OWLCLASS
#define _OWLCLASS
Definition
defs.h:338
posclass.h
preclass.h
include
owl
cmdline.h
Generated by
1.18.0