Last change
on this file since 618 was
598,
checked in by bknecht, 17 years ago
|
mandatory boolean changed to optional in argreader
|
File size:
717 bytes
|
Line | |
---|
1 | /** |
---|
2 | @file Argreader.h |
---|
3 | @brief reads arguments |
---|
4 | @author Benjamin Knecht <beni_at_orxonox.net> |
---|
5 | */ |
---|
6 | |
---|
7 | #ifndef __ARGREADER_CLASS__ |
---|
8 | #define __ARGREADER_CLASS__ |
---|
9 | |
---|
10 | #include <string> |
---|
11 | |
---|
12 | namespace orxonox { |
---|
13 | |
---|
14 | class ArgReader |
---|
15 | { |
---|
16 | public: |
---|
17 | ArgReader(int argc, char **argv); |
---|
18 | void checkArgument(std::string option, std::string& string, bool must=false); |
---|
19 | void checkArgument(std::string option, int& integer, bool must=false); |
---|
20 | void checkArgument(std::string option, float& floating, bool must=false); |
---|
21 | bool errorHandling(); |
---|
22 | private: |
---|
23 | int checkOption(std::string option); |
---|
24 | |
---|
25 | private: |
---|
26 | int counter_; |
---|
27 | char **arguments_; |
---|
28 | bool fail_; |
---|
29 | std::string errorStr_; |
---|
30 | }; |
---|
31 | |
---|
32 | } |
---|
33 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.