|
1
|
1 #pragma once
|
|
|
2
|
|
|
3 #ifndef _WIN32
|
|
|
4 #error blargh
|
|
|
5 #endif
|
|
|
6
|
|
|
7 class commandline_parser
|
|
|
8 {
|
|
|
9 public:
|
|
|
10 commandline_parser(const char * p_cmd) { init(p_cmd); }
|
|
|
11 commandline_parser();
|
|
|
12
|
|
|
13 inline size_t get_count() const {return m_data.get_size();}
|
|
|
14 inline const char * get_item(size_t n) const {return m_data[n];}
|
|
|
15 inline const char * operator[](size_t n) const {return m_data[n];}
|
|
|
16 bool check_param(const char * p_ptr) const;
|
|
|
17 void build_string(pfc::string_base & p_out);
|
|
|
18 size_t find_param(const char * ptr) const;
|
|
|
19 private:
|
|
|
20 void init(const char * cmd);
|
|
|
21 pfc::array_t<pfc::string8> m_data;
|
|
|
22 };
|