1 | /*␊ |
2 | * KernOptionsParser.h␊ |
3 | * ChameleonPrefPane␊ |
4 | *␊ |
5 | * Created by Rekursor on 1/23/10.␊ |
6 | */␊ |
7 | #include <string>␊ |
8 | #include <list>␊ |
9 | ␊ |
10 | class KernOptionsParser␊ |
11 | {␊ |
12 | public:␊ |
13 | ␉KernOptionsParser() {}␊ |
14 | ␉␊ |
15 | ␉// extract from the string all kern options␊ |
16 | ␉bool parseOptions(const char* options);␊ |
17 | ␉␊ |
18 | ␉// get the corresponding kern option "xxxx=yyyy"␊ |
19 | ␉const std::string& stringFromKey(const std::string& key) const;␊ |
20 | ␉␊ |
21 | ␉// get the left member of kern option "xxxx=yyyy"␊ |
22 | ␉const std::string& leftMember(const std::string& expression) const;␊ |
23 | ␉␊ |
24 | ␉// get the right member of kern option "xxxx=yyyy"␊ |
25 | ␉const std::string& rightMember(const std::string& expression) const;␊ |
26 | ␉␊ |
27 | ␉// add / remove a kernel Flags in the string␊ |
28 | ␉void addFlag(const std::string& flag);␊ |
29 | ␉void removeFlag(const std::string& flag);␊ |
30 | ␉␊ |
31 | ␉const std::string& options() const { return _options;}␊ |
32 | ␉␊ |
33 | private:␊ |
34 | ␉bool _status;␊ |
35 | ␉std::string _options;␊ |
36 | ␉std::list<std::string> _optionsList;␊ |
37 | }; |