Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
// [cfg-cmd.h]: configurable variable class 'cfgCommand'
//
// -------------------------------------------------------------------------------------------- //
#include "cfg-vec.h"
namespace scm
{
class cfgCommand {
public:
// add argument
// -------------------------------------------------------------------------------------------- //
bool add_arg(const cfgVector& _arg);
// -------------------------------------------------------------------------------------------- //
// change command name
// -------------------------------------------------------------------------------------------- //
void set_name(const char* _name);
// -------------------------------------------------------------------------------------------- //
// reset command, narg == 0
// -------------------------------------------------------------------------------------------- //
void reset();
// -------------------------------------------------------------------------------------------- //
// get & check calls
// -------------------------------------------------------------------------------------------- //
int get_narg() const;
cfgVector get_arg(const int idx) const;
bool is_name_eq(const char* ex_name) const;
const char* get_name() const;
// -------------------------------------------------------------------------------------------- //
// print
// -------------------------------------------------------------------------------------------- //
void print() const;
// -------------------------------------------------------------------------------------------- //
// swap & assignment
// -------------------------------------------------------------------------------------------- //
const cfgCommand& operator=(cfgCommand cmd);
void swap(cfgCommand& cmd);
// -------------------------------------------------------------------------------------------- //
// -------------------------------------------------------------------------------------------- //
cfgCommand();
cfgCommand(const cfgCommand& cmd);
~cfgCommand();
// -------------------------------------------------------------------------------------------- //
private:
// data (private):
// -------------------------------------------------------------------------------------------- //
cfgVector *arg;
int narg;
int nalloc;
static const int c_nalloc_inc = 2;
char* name;
size_t name_memsize;
};
}
// -------------------------------------------------------------------------------------------- //