Chameleon Applications

Chameleon Applications Svn Source Tree

Root/trunk/ChameleonPrefPane/Sources/KernOptionsParser.h

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

Archive Download this file

Revision: 453