Line | |
---|
1 | /*! |
---|
2 | * @file proto_class.h |
---|
3 | * @brief Definition of CmdLinePrefsReader |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _CMD_LINE_PREFS_READER_H |
---|
7 | #define _CMD_LINE_PREFS_READER_H |
---|
8 | |
---|
9 | #include "stdincl.h" |
---|
10 | #include "debug.h" |
---|
11 | |
---|
12 | #include "src/lib/argp/argp.h" |
---|
13 | |
---|
14 | typedef struct { |
---|
15 | bool isServer; |
---|
16 | bool isClient; |
---|
17 | char * host; |
---|
18 | char * port; |
---|
19 | char * configFile; |
---|
20 | } CmdLineArgs; |
---|
21 | |
---|
22 | typedef struct argp Argp; |
---|
23 | typedef struct argp_state ArgpState; |
---|
24 | |
---|
25 | //! A class for reading commandline arguments into Preferences |
---|
26 | class CmdLinePrefsReader { |
---|
27 | |
---|
28 | public: |
---|
29 | CmdLinePrefsReader(int argc, char** argv); |
---|
30 | virtual ~CmdLinePrefsReader(); |
---|
31 | |
---|
32 | static error_t parse_opt(int key, char *arg, ArgpState *state); |
---|
33 | |
---|
34 | private: |
---|
35 | CmdLineArgs cmdLineArgs; |
---|
36 | |
---|
37 | }; |
---|
38 | |
---|
39 | #endif /* _PROTO_CLASS_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.