[4744] | 1 | /* |
---|
[1853] | 2 | orxonox - the future of 3D-vertical-scrollers |
---|
| 3 | |
---|
| 4 | Copyright (C) 2004 orx |
---|
| 5 | |
---|
| 6 | This program is free software; you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation; either version 2, or (at your option) |
---|
| 9 | any later version. |
---|
[1855] | 10 | |
---|
| 11 | ### File Specific: |
---|
[5068] | 12 | main-programmer: Benjamin Grauer |
---|
[1855] | 13 | co-programmer: ... |
---|
[1853] | 14 | */ |
---|
| 15 | |
---|
[3955] | 16 | //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ |
---|
[1853] | 17 | |
---|
[5129] | 18 | #include "shell_command.h" |
---|
[1853] | 19 | |
---|
[5072] | 20 | #include "list.h" |
---|
[5129] | 21 | #include "debug.h" |
---|
[5113] | 22 | #include "class_list.h" |
---|
| 23 | |
---|
| 24 | #include "key_names.h" |
---|
[5075] | 25 | #include <stdarg.h> |
---|
| 26 | #include <stdio.h> |
---|
[5174] | 27 | #include <string.h> |
---|
[5075] | 28 | |
---|
[1856] | 29 | using namespace std; |
---|
[1853] | 30 | |
---|
[5166] | 31 | /** |
---|
[5170] | 32 | * creates a new ShellCommandClass |
---|
| 33 | * @param className the Name of the command-class to create |
---|
| 34 | */ |
---|
| 35 | ShellCommandClass::ShellCommandClass(const char* className) |
---|
| 36 | { |
---|
[5188] | 37 | this->setClassID(CL_SHELL_COMMAND_CLASS, "ShellCommandClass"); |
---|
| 38 | this->setName(className); |
---|
| 39 | |
---|
[5170] | 40 | this->className = className; |
---|
| 41 | this->classID = CL_NULL; |
---|
| 42 | this->commandList = new tList<ShellCommandBase>; |
---|
| 43 | |
---|
| 44 | ShellCommandClass::commandClassList->add(this); |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | /** |
---|
| 48 | * destructs the shellCommandClass again |
---|
| 49 | */ |
---|
| 50 | ShellCommandClass::~ShellCommandClass() |
---|
| 51 | { |
---|
| 52 | tIterator<ShellCommandBase>* iterator = this->commandList->getIterator(); |
---|
| 53 | ShellCommandBase* elem = iterator->firstElement(); |
---|
| 54 | while(elem != NULL) |
---|
| 55 | { |
---|
| 56 | delete elem; |
---|
| 57 | elem = iterator->nextElement(); |
---|
| 58 | } |
---|
| 59 | delete iterator; |
---|
| 60 | delete this->commandList; |
---|
| 61 | } |
---|
| 62 | |
---|
[5189] | 63 | tList<const char>* ShellCommandClass::getCommandListOfClass(const char* className) |
---|
| 64 | { |
---|
| 65 | tList<const char>* retList; |
---|
| 66 | tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator(); |
---|
| 67 | ShellCommandClass* elem = iterator->firstElement(); |
---|
| 68 | while(elem != NULL) |
---|
| 69 | { |
---|
| 70 | if (!strcmp (elem->getName(), className)) |
---|
| 71 | { |
---|
| 72 | tIterator<ShellCommandBase>* itFkt = elem->commandList->getIterator(); |
---|
| 73 | ShellCommandBase* command = itFkt->firstElement(); |
---|
| 74 | while (command != NULL) |
---|
| 75 | { |
---|
| 76 | retList->add(command->getName()); |
---|
| 77 | command = itFkt->nextElement(); |
---|
| 78 | } |
---|
| 79 | delete itFkt; |
---|
| 80 | } |
---|
| 81 | |
---|
| 82 | elem = iterator->nextElement(); |
---|
| 83 | } |
---|
| 84 | delete iterator; |
---|
| 85 | return retList; |
---|
| 86 | } |
---|
| 87 | |
---|
[5171] | 88 | /** |
---|
| 89 | * unregisters all Commands that exist |
---|
| 90 | */ |
---|
| 91 | void ShellCommandClass::unregisterAllCommands() |
---|
| 92 | { |
---|
| 93 | tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator(); |
---|
| 94 | ShellCommandClass* elem = iterator->firstElement(); |
---|
| 95 | while(elem != NULL) |
---|
| 96 | { |
---|
| 97 | delete elem; |
---|
| 98 | |
---|
| 99 | elem = iterator->nextElement(); |
---|
| 100 | } |
---|
| 101 | delete iterator; |
---|
| 102 | |
---|
| 103 | delete ShellCommandClass::commandClassList; |
---|
| 104 | ShellCommandClass::commandClassList = NULL; |
---|
| 105 | } |
---|
| 106 | |
---|
[5170] | 107 | const ShellCommandClass* ShellCommandClass::isRegistered(const char* className) |
---|
| 108 | { |
---|
| 109 | if (ShellCommandClass::commandClassList == NULL) |
---|
| 110 | initCommandClassList(); |
---|
| 111 | |
---|
| 112 | tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator(); |
---|
| 113 | ShellCommandClass* elem = iterator->firstElement(); |
---|
| 114 | while(elem != NULL) |
---|
| 115 | { |
---|
| 116 | if (!strcmp(className, elem->className)) |
---|
| 117 | { |
---|
[5171] | 118 | if (elem->classID == CL_NULL) |
---|
| 119 | elem->classID = ClassList::StringToID(className); |
---|
| 120 | |
---|
[5170] | 121 | delete iterator; |
---|
| 122 | return elem; |
---|
| 123 | } |
---|
| 124 | elem = iterator->nextElement(); |
---|
| 125 | } |
---|
| 126 | delete iterator; |
---|
| 127 | return NULL; |
---|
| 128 | } |
---|
| 129 | |
---|
[5172] | 130 | /** |
---|
| 131 | * searches for a CommandClass |
---|
| 132 | * @param className the name of the CommandClass |
---|
| 133 | * @returns the CommandClass if found, or a new CommandClass if not |
---|
| 134 | */ |
---|
[5170] | 135 | ShellCommandClass* ShellCommandClass::getCommandClass(const char* className) |
---|
| 136 | { |
---|
| 137 | if (ShellCommandClass::commandClassList == NULL) |
---|
| 138 | initCommandClassList(); |
---|
| 139 | |
---|
| 140 | tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator(); |
---|
| 141 | ShellCommandClass* elem = iterator->firstElement(); |
---|
| 142 | while(elem != NULL) |
---|
| 143 | { |
---|
| 144 | if (!strcmp(className, elem->className)) |
---|
| 145 | { |
---|
| 146 | delete iterator; |
---|
| 147 | return elem; |
---|
| 148 | } |
---|
| 149 | elem = iterator->nextElement(); |
---|
| 150 | } |
---|
| 151 | delete iterator; |
---|
| 152 | return new ShellCommandClass(className); |
---|
| 153 | } |
---|
| 154 | |
---|
[5172] | 155 | /** |
---|
| 156 | * initializes the CommandList (if it is NULL) |
---|
| 157 | */ |
---|
[5170] | 158 | void ShellCommandClass::initCommandClassList() |
---|
| 159 | { |
---|
| 160 | if (ShellCommandClass::commandClassList == NULL) |
---|
| 161 | { |
---|
| 162 | ShellCommandClass::commandClassList = new tList<ShellCommandClass>; |
---|
| 163 | ShellCommand<ShellCommandBase>::registerCommand("debug", "ShellCommand", &ShellCommandBase::debugDyn); |
---|
| 164 | } |
---|
| 165 | } |
---|
| 166 | |
---|
| 167 | tList<ShellCommandClass>* ShellCommandClass::commandClassList = NULL; |
---|
| 168 | |
---|
| 169 | /** |
---|
[5166] | 170 | * constructs and registers a new Command |
---|
| 171 | * @param commandName the name of the Command |
---|
| 172 | * @param className the name of the class to apply this command to |
---|
| 173 | * @param paramCount the count of parameters this command takes |
---|
| 174 | * @return self |
---|
| 175 | */ |
---|
[5161] | 176 | ShellCommandBase::ShellCommandBase(const char* commandName, const char* className, unsigned int paramCount, ...) |
---|
[3365] | 177 | { |
---|
[5141] | 178 | this->setClassID(CL_SHELL_COMMAND, "ShellCommand"); |
---|
| 179 | this->setName(commandName); |
---|
[5164] | 180 | this->description = NULL; |
---|
[5141] | 181 | |
---|
[5161] | 182 | // this->classID = classID; |
---|
[5170] | 183 | ShellCommandClass::getCommandClass(className)->commandList->add(this); //ClassList::IDToString(classID); |
---|
[5141] | 184 | |
---|
[5130] | 185 | // handling parameters, and storing them: |
---|
[5142] | 186 | if (paramCount > FUNCTOR_MAX_ARGUMENTS) |
---|
| 187 | paramCount = FUNCTOR_MAX_ARGUMENTS; |
---|
[5130] | 188 | this->paramCount = paramCount; |
---|
[5148] | 189 | this->parameters = new unsigned int[paramCount]; |
---|
[5130] | 190 | |
---|
[5148] | 191 | va_list parameterList; |
---|
| 192 | va_start(parameterList, paramCount); |
---|
| 193 | |
---|
[5130] | 194 | for (unsigned int i = 0; i < paramCount; i++) |
---|
[5142] | 195 | { |
---|
[5148] | 196 | this->parameters[i] = va_arg(parameterList, int); |
---|
[5130] | 197 | |
---|
[5146] | 198 | switch (this->parameters[i]) |
---|
[5142] | 199 | { |
---|
| 200 | case ParameterBool: |
---|
[5148] | 201 | this->defaultBools[i] = va_arg(parameterList, int); |
---|
[5142] | 202 | break; |
---|
| 203 | case ParameterChar: |
---|
| 204 | this->defaultStrings[i] = new char[2]; |
---|
[5148] | 205 | sprintf(this->defaultStrings[0], "%c", va_arg(parameterList, int)); |
---|
[5142] | 206 | break; |
---|
| 207 | case ParameterString: |
---|
[5148] | 208 | this->defaultStrings[i] = va_arg(parameterList, char*); |
---|
[5142] | 209 | break; |
---|
| 210 | case ParameterInt: |
---|
[5148] | 211 | this->defaultInts[i] = va_arg(parameterList, int); |
---|
[5142] | 212 | break; |
---|
| 213 | case ParameterUInt: |
---|
[5148] | 214 | this->defaultInts[i] = va_arg(parameterList, unsigned int); |
---|
[5142] | 215 | break; |
---|
| 216 | case ParameterFloat: |
---|
[5148] | 217 | this->defaultFloats[i] = va_arg(parameterList, double); |
---|
[5142] | 218 | break; |
---|
| 219 | case ParameterLong: |
---|
[5148] | 220 | this->defaultInts[i] = va_arg(parameterList, long); |
---|
[5142] | 221 | break; |
---|
| 222 | default: |
---|
| 223 | break; |
---|
| 224 | } |
---|
| 225 | } |
---|
[5068] | 226 | } |
---|
[4320] | 227 | |
---|
[5166] | 228 | /** |
---|
| 229 | * deconstructs a ShellCommand |
---|
| 230 | * @return |
---|
| 231 | */ |
---|
[5130] | 232 | ShellCommandBase::~ShellCommandBase() |
---|
| 233 | { |
---|
| 234 | delete[] this->parameters; |
---|
| 235 | } |
---|
[1853] | 236 | |
---|
[5166] | 237 | /** |
---|
| 238 | * unregister an existing commandName |
---|
| 239 | * @param className the name of the Class the command belongs to. |
---|
| 240 | * @param commandName the name of the command itself |
---|
| 241 | * |
---|
| 242 | * @todo implement |
---|
| 243 | */ |
---|
| 244 | void ShellCommandBase::unregisterCommand(const char* commandName, const char* className) |
---|
[5165] | 245 | { |
---|
[5171] | 246 | if (ShellCommandClass::commandClassList == NULL) |
---|
| 247 | ShellCommandClass::initCommandClassList(); |
---|
| 248 | |
---|
[5172] | 249 | const ShellCommandClass* checkClass = ShellCommandClass::isRegistered(className); |
---|
[5171] | 250 | |
---|
[5172] | 251 | if (checkClass != NULL) |
---|
[5171] | 252 | { |
---|
| 253 | tIterator<ShellCommandBase>* iterator = checkClass->commandList->getIterator(); |
---|
| 254 | ShellCommandBase* elem = iterator->firstElement(); |
---|
| 255 | while(elem != NULL) |
---|
| 256 | { |
---|
| 257 | if (!strcmp(commandName, elem->getName())) |
---|
| 258 | { |
---|
| 259 | checkClass->commandList->remove(elem); |
---|
| 260 | delete elem; |
---|
| 261 | break; |
---|
| 262 | } |
---|
| 263 | elem = iterator->nextElement(); |
---|
| 264 | } |
---|
| 265 | delete iterator; |
---|
| 266 | |
---|
| 267 | if (checkClass->commandList->getSize() == 0) |
---|
| 268 | { |
---|
| 269 | ShellCommandClass::commandClassList->remove(checkClass); |
---|
| 270 | delete checkClass; |
---|
| 271 | } |
---|
| 272 | } |
---|
[5165] | 273 | } |
---|
| 274 | |
---|
[5166] | 275 | /** |
---|
| 276 | * checks if a command has already been registered. |
---|
| 277 | * @param commandName the name of the Command |
---|
| 278 | * @param className the name of the Class the command should apply to. |
---|
| 279 | * @param paramCount how many arguments the Command takes |
---|
| 280 | * @returns true, if the command is registered/false otherwise |
---|
| 281 | * |
---|
| 282 | * This is used internally, to see, if we have multiple command subscriptions. |
---|
| 283 | * This is checked in the registerCommand-function. |
---|
| 284 | */ |
---|
[5161] | 285 | bool ShellCommandBase::isRegistered(const char* commandName, const char* className, unsigned int paramCount, ...) |
---|
[5113] | 286 | { |
---|
[5170] | 287 | if (ShellCommandClass::commandClassList == NULL) |
---|
[5072] | 288 | { |
---|
[5170] | 289 | ShellCommandClass::initCommandClassList(); |
---|
[5113] | 290 | return false; |
---|
| 291 | } |
---|
[5105] | 292 | |
---|
[5170] | 293 | const ShellCommandClass* checkClass = ShellCommandClass::isRegistered(className); |
---|
| 294 | if (checkClass != NULL) |
---|
[5113] | 295 | { |
---|
[5170] | 296 | tIterator<ShellCommandBase>* iterator = checkClass->commandList->getIterator(); |
---|
| 297 | ShellCommandBase* elem = iterator->firstElement(); |
---|
| 298 | while(elem != NULL) |
---|
| 299 | { |
---|
| 300 | if (!strcmp(commandName, elem->getName())) |
---|
| 301 | { |
---|
| 302 | PRINTF(2)("Command already registered\n"); |
---|
| 303 | delete iterator; |
---|
| 304 | return true; |
---|
| 305 | } |
---|
| 306 | elem = iterator->nextElement(); |
---|
| 307 | } |
---|
| 308 | delete iterator; |
---|
| 309 | return false; |
---|
[5113] | 310 | } |
---|
[5170] | 311 | else |
---|
| 312 | return false; |
---|
[5113] | 313 | } |
---|
| 314 | |
---|
[5140] | 315 | |
---|
[5145] | 316 | /** |
---|
| 317 | * executes commands |
---|
| 318 | * @param executionString the string containing the following input |
---|
[5148] | 319 | * ClassName [ObjectName] functionName [parameter1[,parameter2[,...]]] |
---|
[5145] | 320 | * @return true on success, false otherwise. |
---|
| 321 | */ |
---|
[5135] | 322 | bool ShellCommandBase::execute(const char* executionString) |
---|
| 323 | { |
---|
[5170] | 324 | // if (ShellCommandBase::commandList == NULL) |
---|
| 325 | // return false; |
---|
| 326 | // |
---|
| 327 | // tIterator<ShellCommandBase>* iterator = ShellCommandBase::commandList->getIterator(); |
---|
| 328 | // ShellCommandBase* elem = iterator->firstElement(); |
---|
| 329 | // while(elem != NULL) |
---|
| 330 | // { |
---|
| 331 | // printf("%s::%s\n", elem->className, elem->getName()); |
---|
| 332 | // if (!strncasecmp (executionString, elem->className, strlen(elem->className)) && |
---|
| 333 | // (*(executionString+strlen(elem->className)) == ' ' || |
---|
| 334 | // *(executionString+strlen(elem->className)) == ':' )) |
---|
| 335 | // { |
---|
| 336 | // const char* commandBegin = executionString + strlen(elem->className); |
---|
| 337 | // |
---|
| 338 | // PRINTF(4)("Class %s matches\n", elem->className); |
---|
| 339 | // BaseObject* objectPointer = NULL; |
---|
| 340 | // if (ClassList::StringToID(elem->className) & CL_MASK_SINGLETON == CL_MASK_SINGLETON) |
---|
| 341 | // { |
---|
| 342 | // while(*commandBegin == ' ') |
---|
| 343 | // commandBegin++; |
---|
| 344 | // if (strncmp (commandBegin, elem->getName(), strlen(elem->getName())) || |
---|
| 345 | // *(commandBegin + strlen(elem->getName())) != ' ' && |
---|
| 346 | // *(commandBegin + strlen(elem->getName())) != '\0') |
---|
| 347 | // { |
---|
| 348 | // elem = iterator->nextElement(); |
---|
| 349 | // continue; |
---|
| 350 | // } |
---|
| 351 | // PRINTF(4)("Command %s matches\n", elem->getName()); |
---|
| 352 | // // getting singleton-reference |
---|
| 353 | // tList<BaseObject>* list = ClassList::getList(elem->className); |
---|
| 354 | // if (list != NULL) |
---|
| 355 | // objectPointer = list->firstElement(); |
---|
| 356 | // } |
---|
| 357 | // else |
---|
| 358 | // { |
---|
| 359 | // // checking for the Object |
---|
| 360 | // while(*commandBegin == ' ') |
---|
| 361 | // commandBegin++; |
---|
| 362 | // tList<BaseObject>* list = ClassList::getList(elem->className); |
---|
| 363 | // if (list == NULL) |
---|
| 364 | // break; |
---|
| 365 | // tIterator<BaseObject>* iterBO = list->getIterator(); |
---|
| 366 | // BaseObject* enumBO = iterBO->firstElement(); |
---|
| 367 | // while(enumBO != NULL) |
---|
| 368 | // { |
---|
| 369 | // if(!strncmp(commandBegin, enumBO->getName(), strlen(enumBO->getName()))) |
---|
| 370 | // { |
---|
| 371 | // PRINTF(4)("Object %s matches\n", enumBO->getName()); |
---|
| 372 | // objectPointer = enumBO; |
---|
| 373 | // break; |
---|
| 374 | // } |
---|
| 375 | // enumBO = iterBO->nextElement(); |
---|
| 376 | // } |
---|
| 377 | // delete iterBO; |
---|
| 378 | // |
---|
| 379 | // // break on no object Found. We cannot operate on Classes, but on Objects |
---|
| 380 | // if (objectPointer == NULL) |
---|
| 381 | // break; |
---|
| 382 | // commandBegin = commandBegin + strlen(objectPointer->getName()); |
---|
| 383 | // while(*commandBegin == ' ') |
---|
| 384 | // commandBegin++; |
---|
| 385 | // // checking for the requested function. |
---|
| 386 | // if (strncmp (commandBegin, elem->getName(), strlen(elem->getName()))) |
---|
| 387 | // { |
---|
| 388 | // elem = iterator->nextElement(); |
---|
| 389 | // continue; |
---|
| 390 | // } |
---|
| 391 | // PRINTF(4)("Function '%s' found\n", commandBegin); |
---|
| 392 | // } |
---|
| 393 | // const char* paramBegin = strchr(commandBegin, ' '); |
---|
| 394 | // if (paramBegin == NULL) |
---|
| 395 | // paramBegin = commandBegin + strlen(elem->getName()); |
---|
| 396 | // while (*paramBegin == ' ') |
---|
| 397 | // paramBegin++; |
---|
| 398 | // |
---|
| 399 | // PRINTF(3)("Parameters to Pass: %s\n", paramBegin); |
---|
| 400 | // if (objectPointer != NULL && paramBegin != NULL) |
---|
| 401 | // { |
---|
| 402 | // elem->executeCommand(objectPointer, paramBegin); |
---|
| 403 | // delete iterator; |
---|
| 404 | // return true; |
---|
| 405 | // } |
---|
| 406 | // } |
---|
| 407 | // elem = iterator->nextElement(); |
---|
| 408 | // } |
---|
| 409 | // delete iterator; |
---|
| 410 | // return true; |
---|
[5135] | 411 | } |
---|
[5148] | 412 | |
---|
[5166] | 413 | /** |
---|
| 414 | * lets a command be described |
---|
| 415 | * @param description the description of the Given command |
---|
| 416 | */ |
---|
[5164] | 417 | ShellCommandBase* ShellCommandBase::describe(const char* description) |
---|
| 418 | { |
---|
| 419 | if (this == NULL) |
---|
| 420 | return NULL; |
---|
[5165] | 421 | else |
---|
| 422 | { |
---|
| 423 | this->description = description; |
---|
| 424 | return this; |
---|
| 425 | } |
---|
[5164] | 426 | } |
---|
| 427 | |
---|
[5166] | 428 | /** |
---|
| 429 | * see ShellCommandBase::debug() |
---|
| 430 | */ |
---|
[5161] | 431 | void ShellCommandBase::debugDyn() |
---|
| 432 | { |
---|
| 433 | this->debug(); |
---|
| 434 | } |
---|
[5148] | 435 | |
---|
[5166] | 436 | /** |
---|
| 437 | * prints out nice information about the Shells Commands |
---|
| 438 | */ |
---|
[5148] | 439 | void ShellCommandBase::debug() |
---|
| 440 | { |
---|
[5170] | 441 | if (ShellCommandClass::commandClassList == NULL) |
---|
[5148] | 442 | { |
---|
[5171] | 443 | PRINT(0)("No Command registered.\n"); |
---|
[5148] | 444 | return; |
---|
| 445 | } |
---|
| 446 | |
---|
[5170] | 447 | tIterator<ShellCommandClass>* iteratorCL = ShellCommandClass::commandClassList->getIterator(); |
---|
| 448 | ShellCommandClass* elemCL = iteratorCL->firstElement(); |
---|
| 449 | while(elemCL != NULL) |
---|
[5148] | 450 | { |
---|
[5171] | 451 | PRINT(0)("Class:'%s' registered %d commands: \n", elemCL->className, elemCL->commandList->getSize()); |
---|
[5170] | 452 | tIterator<ShellCommandBase>* iterator = elemCL->commandList->getIterator(); |
---|
| 453 | const ShellCommandBase* elem = iterator->firstElement(); |
---|
[5172] | 454 | while(elem != NULL) |
---|
[5170] | 455 | { |
---|
[5171] | 456 | PRINT(0)(" command:'%s' : params:%d: ", elem->getName(), elem->paramCount); |
---|
[5170] | 457 | for (unsigned int i = 0; i< elem->paramCount; i++) |
---|
| 458 | printf("%s ", ShellCommandBase::paramToString(elem->parameters[i])); |
---|
| 459 | if (elem->description != NULL) |
---|
| 460 | printf("- %s", elem->description); |
---|
| 461 | printf("\n"); |
---|
[5148] | 462 | |
---|
[5170] | 463 | elem = iterator->nextElement(); |
---|
| 464 | } |
---|
| 465 | delete iterator; |
---|
| 466 | elemCL = iteratorCL->nextElement(); |
---|
[5148] | 467 | } |
---|
[5170] | 468 | delete iteratorCL; |
---|
[5148] | 469 | } |
---|
| 470 | |
---|
[5166] | 471 | /** |
---|
| 472 | * converts a Parameter to a String |
---|
| 473 | * @param parameter the Parameter we have. |
---|
| 474 | * @returns the Name of the Parameter at Hand |
---|
| 475 | */ |
---|
[5148] | 476 | const char* ShellCommandBase::paramToString(long parameter) |
---|
| 477 | { |
---|
| 478 | switch (parameter) |
---|
| 479 | { |
---|
| 480 | case ParameterBool: |
---|
| 481 | return "BOOL"; |
---|
| 482 | break; |
---|
| 483 | case ParameterChar: |
---|
| 484 | return "CHAR"; |
---|
| 485 | break; |
---|
| 486 | case ParameterString: |
---|
| 487 | return "STRING"; |
---|
| 488 | break; |
---|
| 489 | case ParameterInt: |
---|
| 490 | return "INT"; |
---|
| 491 | break; |
---|
| 492 | case ParameterUInt: |
---|
| 493 | return "UINT"; |
---|
| 494 | break; |
---|
| 495 | case ParameterFloat: |
---|
| 496 | return "FLOAT"; |
---|
| 497 | break; |
---|
| 498 | case ParameterLong: |
---|
| 499 | return "LONG"; |
---|
| 500 | break; |
---|
| 501 | default: |
---|
| 502 | return "NULL"; |
---|
| 503 | break; |
---|
| 504 | } |
---|
| 505 | } |
---|