commands.cxx

changeset 67
0a202714eea4
parent 65
ec04357f5bb9
child 68
588cc27e84bb
equal deleted inserted replaced
66:4fc1ec88aa41 67:0a202714eea4
157 157
158 // ============================================================================ 158 // ============================================================================
159 // Get command type by name 159 // Get command type by name
160 int GetCommandType (str t) { 160 int GetCommandType (str t) {
161 t = t.tolower(); 161 t = t.tolower();
162 return !t.compare ("int") ? TYPE_INT : 162 return (t == "int") ? TYPE_INT :
163 !t.compare ("float") ? TYPE_FLOAT : 163 (t == "float") ? TYPE_FLOAT :
164 !t.compare ("str") ? TYPE_STRING : 164 (t == "str") ? TYPE_STRING :
165 !t.compare ("void") ? TYPE_VOID : 165 (t == "void") ? TYPE_VOID :
166 !t.compare ("bool") ? TYPE_BOOL : -1; 166 (t == "bool") ? TYPE_BOOL : -1;
167 } 167 }
168 168
169 // ============================================================================ 169 // ============================================================================
170 // Inverse operation - type name by value 170 // Inverse operation - type name by value
171 str GetTypeName (int r) { 171 str GetTypeName (int r) {

mercurial