Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9756 in orxonox.OLD for branches/new_class_id/src


Ignore:
Timestamp:
Sep 18, 2006, 9:37:01 PM (18 years ago)
Author:
bensch
Message:

doxygened SubString and MultiType

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  
    195195 *
    196196 * This is a pure Value copy. The current type will be preserved.
    197  *
    198  * @TODO speedup
    199197 */
    200198void MultiType::setValueOf(const MultiType& mt)
     
    284282  else if (this->type & MT_STRING) return (this->storedString == "true" ||
    285283                                            this->storedString == "TRUE" ||
    286                                             this->storedString != "0"); //! @TODO make this better...
     284                                            this->storedString != "0"); // TODO make this better...
    287285
    288286  return false;
  • branches/new_class_id/src/lib/util/multi_type.h

    r9730 r9756  
    1717  MT_BOOL            = 1,                  //!< A bool Value.
    1818  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
    2121  MT_FLOAT           = 4,                  //!< A float Value.
    2222  MT_CHAR            = 8,                  //!< A single char.
     
    4444
    4545    MultiType& operator=(const MultiType& mt);
     46    /** @param value the value to set (here a bool) @returns the MultiType where this the bool is stored */
    4647    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 */
    4749    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 */
    4851    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 */
    4953    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 */
    5055    MultiType& operator=(const std::string& value) { this->setString(value); return *this; };
    5156
    5257    bool operator==(const MultiType& mt) const;
     58    /** @param value the value to compare this MultiType against @returns true if comparison was io */
    5359    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 */
    5461    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 */
    5563    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 */
    5665    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 */
    5767    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 */
    5869    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 */
    5971    bool operator!=(MT_Type type) const { return (this->type != type); }
    6072
     
    6880
    6981    // for your convenience.
     82    /** @param value the value to set. Here a bool */
    7083    inline void setValue(bool value) { this->setBool(value); };
     84    /** @param value the value to set. Here an int */
    7185    inline void setValue(int value) { this->setInt(value); };
     86    /** @param value the value to set. Here a float */
    7287    inline void setValue(float value) { this->setFloat(value); };
     88    /** @param value the value to set. Here a char */
    7389    inline void setValue(char value) { this->setChar(value); };
     90    /** @param value the value to set. Here a char array (string) */
    7491    inline void setValue(const char* value) { this->setString(value); };
     92    /** @param value the value to set. Here a string */
    7593    inline void setValue(const std::string& value) { this->setString(value); };
    7694    void setValueOf(const MultiType& mt);
  • branches/new_class_id/src/lib/util/substring.cc

    r9736 r9756  
    5151 * @param delimiters multiple set of characters at what to split. (delimiters)
    5252 * @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.
    5354 * @param escapeChar The Escape Character that overrides splitters commends and so on...
    5455 * @param safemode_char within these characters splitting won't happen
     
    147148 * @brief comparator.
    148149 * @param subString the SubString to compare against this one.
     150 * @param length how many entries to compare. (from 0 to length)
    149151 * @returns true if the Stored Strings match
    150152 */
     
    275277 * @brief splits line into tokens and stores them in ret.
    276278 * @param ret the Array, where the Splitted strings will be stored in
    277  * @param offsets an Array of Offsets, here the distance from the inputstring
    278279 * to the beginning of the current token is stored
    279280 * @param line the inputLine to split
    280281 * @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.
    282283 * @param emptyEntries: if empty Strings are added to the List of Strings.
    283284 * @param escape_char: Escape carater (escapes splitters)
  • branches/new_class_id/src/lib/util/substring.h

    r9736 r9756  
    3333{
    3434public:
     35  //! An enumerator for the State the Parser is in
    3536  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.
    4142  } SPLIT_LINE_STATE;
    4243
     
    4849            const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries=false,
    4950            char escapeChar ='\\', char safemode_char = '"', char comment_char = '\0');
     51  SubString(unsigned int argc, const char** argv);
    5052  /** @brief create a Substring as a copy of another one. @param subString the SubString to copy. */
    51   SubString(unsigned int argc, const char** argv);
    5253  SubString(const SubString& subString) { *this = subString; };
    5354  SubString(const SubString& subString, unsigned int subSetBegin);
Note: See TracChangeset for help on using the changeset viewer.