Changeset 9756 in orxonox.OLD for branches/new_class_id/src/lib/util
- Timestamp:
- Sep 18, 2006, 9:37:01 PM (18 years ago)
- Location:
- branches/new_class_id/src/lib/util
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/util/multi_type.cc
r9730 r9756 195 195 * 196 196 * This is a pure Value copy. The current type will be preserved. 197 *198 * @TODO speedup199 197 */ 200 198 void MultiType::setValueOf(const MultiType& mt) … … 284 282 else if (this->type & MT_STRING) return (this->storedString == "true" || 285 283 this->storedString == "TRUE" || 286 this->storedString != "0"); // ! @TODO make this better...284 this->storedString != "0"); // TODO make this better... 287 285 288 286 return false; -
branches/new_class_id/src/lib/util/multi_type.h
r9730 r9756 17 17 MT_BOOL = 1, //!< A bool Value. 18 18 MT_INT = 2, //!< An int Value. 19 MT_UINT = 2, 20 MT_LONG = 2, 19 MT_UINT = 2, //!< A insigned int Value. 20 MT_LONG = 2, //!< A long Value 21 21 MT_FLOAT = 4, //!< A float Value. 22 22 MT_CHAR = 8, //!< A single char. … … 44 44 45 45 MultiType& operator=(const MultiType& mt); 46 /** @param value the value to set (here a bool) @returns the MultiType where this the bool is stored */ 46 47 MultiType& operator=(bool value) { this->setBool(value); return *this; }; 48 /** @param value the value to set (here an int) @returns the MultiType where this the int is stored */ 47 49 MultiType& operator=(int value) { this->setInt(value); return *this; }; 50 /** @param value the value to set (here an int) @returns the MultiType where this the float is stored */ 48 51 MultiType& operator=(float value) { this->setFloat(value); return *this; }; 52 /** @param value the value to set (here a char) @returns the MultiType where this the char is stored */ 49 53 MultiType& operator=(char value) { this->setChar(value); return *this; }; 54 /** @param value the value to set (here a string) @returns the MultiType where this the string is stored */ 50 55 MultiType& operator=(const std::string& value) { this->setString(value); return *this; }; 51 56 52 57 bool operator==(const MultiType& mt) const; 58 /** @param value the value to compare this MultiType against @returns true if comparison was io */ 53 59 bool operator==(bool value) const { return (this->getBool() == value); }; 60 /** @param value the value to compare this MultiType against @returns true if comparison was io */ 54 61 bool operator==(int value) const { return (this->getInt() == value); }; 62 /** @param value the value to compare this MultiType against @returns true if comparison was io */ 55 63 bool operator==(float value) const { return (this->getFloat() == value); }; 64 /** @param value the value to compare this MultiType against @returns true if comparison was io */ 56 65 bool operator==(char value) const { return (this->getChar() == value); }; 66 /** @param value the value to compare this MultiType against @returns true if comparison was io */ 57 67 bool operator==(const std::string& value) const { return (this->getString() == value); }; 68 /** @param type the Type to compare this MultiType against @returns true if the types matched */ 58 69 bool operator==(MT_Type type) const { return (this->type == type); } 70 /** @param type the type to compare this MultiType against @returns true if the types do not match */ 59 71 bool operator!=(MT_Type type) const { return (this->type != type); } 60 72 … … 68 80 69 81 // for your convenience. 82 /** @param value the value to set. Here a bool */ 70 83 inline void setValue(bool value) { this->setBool(value); }; 84 /** @param value the value to set. Here an int */ 71 85 inline void setValue(int value) { this->setInt(value); }; 86 /** @param value the value to set. Here a float */ 72 87 inline void setValue(float value) { this->setFloat(value); }; 88 /** @param value the value to set. Here a char */ 73 89 inline void setValue(char value) { this->setChar(value); }; 90 /** @param value the value to set. Here a char array (string) */ 74 91 inline void setValue(const char* value) { this->setString(value); }; 92 /** @param value the value to set. Here a string */ 75 93 inline void setValue(const std::string& value) { this->setString(value); }; 76 94 void setValueOf(const MultiType& mt); -
branches/new_class_id/src/lib/util/substring.cc
r9736 r9756 51 51 * @param delimiters multiple set of characters at what to split. (delimiters) 52 52 * @param delimiterNeighbours neighbours of the delimiters, that will be erased only when near a delimiter. 53 * @param emptyEntries If empty entries should be allewed or removed. 53 54 * @param escapeChar The Escape Character that overrides splitters commends and so on... 54 55 * @param safemode_char within these characters splitting won't happen … … 147 148 * @brief comparator. 148 149 * @param subString the SubString to compare against this one. 150 * @param length how many entries to compare. (from 0 to length) 149 151 * @returns true if the Stored Strings match 150 152 */ … … 275 277 * @brief splits line into tokens and stores them in ret. 276 278 * @param ret the Array, where the Splitted strings will be stored in 277 * @param offsets an Array of Offsets, here the distance from the inputstring278 279 * to the beginning of the current token is stored 279 280 * @param line the inputLine to split 280 281 * @param delimiters a String of Delimiters (here the input will be splitted) 281 * @param delimiterNeighbour Naighbours to the Delimitter, that will be removed if they are to the left or the right of a Delimiter.282 * @param delimiterNeighbours Naighbours to the Delimitter, that will be removed if they are to the left or the right of a Delimiter. 282 283 * @param emptyEntries: if empty Strings are added to the List of Strings. 283 284 * @param escape_char: Escape carater (escapes splitters) -
branches/new_class_id/src/lib/util/substring.h
r9736 r9756 33 33 { 34 34 public: 35 //! An enumerator for the State the Parser is in 35 36 typedef enum { 36 SL_NORMAL, 37 SL_ESCAPE, 38 SL_SAFEMODE, 39 SL_SAFEESCAPE, 40 SL_COMMENT, 37 SL_NORMAL, //!< Normal state 38 SL_ESCAPE, //!< After an escape character 39 SL_SAFEMODE, //!< In safe mode (between "" mostly). 40 SL_SAFEESCAPE, //!< In safe mode with the internal escape character, that escapes even the savemode character. 41 SL_COMMENT, //!< In Comment mode. 41 42 } SPLIT_LINE_STATE; 42 43 … … 48 49 const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries=false, 49 50 char escapeChar ='\\', char safemode_char = '"', char comment_char = '\0'); 51 SubString(unsigned int argc, const char** argv); 50 52 /** @brief create a Substring as a copy of another one. @param subString the SubString to copy. */ 51 SubString(unsigned int argc, const char** argv);52 53 SubString(const SubString& subString) { *this = subString; }; 53 54 SubString(const SubString& subString, unsigned int subSetBegin);
Note: See TracChangeset
for help on using the changeset viewer.