2 #pragma clang diagnostic push 3 #pragma ide diagnostic ignored "OCUnusedGlobalDeclarationInspection" 4 #pragma clang diagnostic ignored "-Wunknown-pragmas" 5 #pragma ide diagnostic ignored "modernize-loop-convert" 6 #pragma ide diagnostic ignored "modernize-use-auto" 16 map<string,pair<int,string> >
fillGaps(map<string,int> old_map) {
17 map<string,pair<int,string> > ret;
18 for(map<string,int>::const_iterator it = old_map.begin(); it != old_map.end(); it++) {
19 ret[it->first] = pair<int,string>(it->second,
"");
27 ParamDescription desc;
30 desc.description =
desc_;
33 group.parameters.push_back(desc);
64 DDEnum::DDEnum(
const string &name,
unsigned int level,
const string &description,
65 int def,
const map<string, int> &dictionary) :
66 DDInt(name,level,description,def),
70 for(map<string,int>::const_iterator it = dictionary.begin(); it != dictionary.end(); it++) {
71 if(it->second >
max_) {
max_ = it->second;}
72 if(it->second <
min_) {
min_ = it->second;}
76 DDEnum::DDEnum(
const string &name,
unsigned int level,
const string &description,
77 const string &def,
const map<string, int> &dictionary) :
78 DDInt(name,level,description,dictionary.find(def)->second),
82 for(map<string,int>::const_iterator it = dictionary.begin(); it != dictionary.end(); it++) {
83 if(it->second >
max_) {
max_ = it->second;}
84 if(it->second <
min_) {
min_ = it->second;}
88 DDEnum::DDEnum(
const string &name,
unsigned int level,
const string &description,
int def,
89 const pair<EnumMap, string> &dictionary) :
90 DDInt(name,level,description,def),
91 dict_(dictionary.first) {
94 for(EnumMap::const_iterator it =
dict_.begin(); it !=
dict_.end(); it++) {
95 if(it->second.first >
max_) {
max_ = it->second.first;}
96 if(it->second.first <
min_) {
min_ = it->second.first;}
101 DDEnum::DDEnum(
const string &name,
unsigned int level,
const string &description,
const string &def,
102 const pair<EnumMap,string> &dictionary) :
103 DDInt(name,level,description,dictionary.first.find(def)->second.first),
104 dict_(dictionary.first) {
107 for(EnumMap::const_iterator it =
dict_.begin(); it !=
dict_.end(); it++) {
108 if(it->second.first >
max_) {
max_ = it->second.first;}
109 if(it->second.first <
min_) {
min_ = it->second.first;}
121 EnumMap::const_iterator it =
dict_.begin();
122 ret <<
makeConst(it->first, it->second.first, it->second.second);
123 for(it++; it !=
dict_.end(); it++) {
124 ret <<
", " <<
makeConst(it->first, it->second.first, it->second.second);
137 ret <<
"'srcline': 0, ";
138 ret <<
"'description': '" << desc <<
"', ";
139 ret <<
"'srcfile': '/does/this/really/matter.cfg', ";
140 ret <<
"'cconsttype': 'const int', ";
141 ret <<
"'value': " << value <<
", ";
142 ret <<
"'ctype': 'int', ";
143 ret <<
"'type': 'int', ";
144 ret <<
"'name': '" << name <<
"'";
151 #pragma clang diagnostic pop
map< string, pair< int, string > > fillGaps(map< string, int > old_map)