Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 31, 2010, 1:00:20 AM (14 years ago)
Author:
landauf
Message:

until now we could group words and values in console commands and XML values using parentheses (…). now we have to use braces {…}, because that works better in connection with Tcl. in practice however this feature was never used before, so this change shouldn't affect anything.

Location:
code/branches/consolecommands3/src/libraries/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/consolecommands3/src/libraries/util/Math.cc

    r6417 r7276  
    234234    bool ConverterFallback<std::string, orxonox::Vector2>::convert(orxonox::Vector2* output, const std::string& input)
    235235    {
    236         size_t opening_parenthesis, closing_parenthesis = input.find(')');
    237         if ((opening_parenthesis = input.find('(')) == std::string::npos)
     236        size_t opening_parenthesis, closing_parenthesis = input.find('}');
     237        if ((opening_parenthesis = input.find('{')) == std::string::npos)
    238238            opening_parenthesis = 0;
    239239        else
     
    257257    bool ConverterFallback<std::string, orxonox::Vector3>::convert(orxonox::Vector3* output, const std::string& input)
    258258    {
    259         size_t opening_parenthesis, closing_parenthesis = input.find(')');
    260         if ((opening_parenthesis = input.find('(')) == std::string::npos)
     259        size_t opening_parenthesis, closing_parenthesis = input.find('}');
     260        if ((opening_parenthesis = input.find('{')) == std::string::npos)
    261261            opening_parenthesis = 0;
    262262        else
     
    282282    bool ConverterFallback<std::string, orxonox::Vector4>::convert(orxonox::Vector4* output, const std::string& input)
    283283    {
    284         size_t opening_parenthesis, closing_parenthesis = input.find(')');
    285         if ((opening_parenthesis = input.find('(')) == std::string::npos)
     284        size_t opening_parenthesis, closing_parenthesis = input.find('}');
     285        if ((opening_parenthesis = input.find('{')) == std::string::npos)
    286286            opening_parenthesis = 0;
    287287        else
     
    309309    bool ConverterFallback<std::string, orxonox::Quaternion>::convert(orxonox::Quaternion* output, const std::string& input)
    310310    {
    311         size_t opening_parenthesis, closing_parenthesis = input.find(')');
    312         if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
     311        size_t opening_parenthesis, closing_parenthesis = input.find('}');
     312        if ((opening_parenthesis = input.find('{')) == std::string::npos)
     313            opening_parenthesis = 0;
     314        else
     315            opening_parenthesis++;
    313316
    314317        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
     
    332335    bool ConverterFallback<std::string, orxonox::ColourValue>::convert(orxonox::ColourValue* output, const std::string& input)
    333336    {
    334         size_t opening_parenthesis, closing_parenthesis = input.find(')');
    335         if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
     337        size_t opening_parenthesis, closing_parenthesis = input.find('}');
     338        if ((opening_parenthesis = input.find('{')) == std::string::npos)
     339            opening_parenthesis = 0;
     340        else
     341            opening_parenthesis++;
    336342
    337343        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
  • code/branches/consolecommands3/src/libraries/util/SubString.h

    r5738 r7276  
    8181            SL_SAFEESCAPE,        //!< In safe mode with the internal escape character, that escapes even the savemode character.
    8282            SL_COMMENT,           //!< In Comment mode.
    83             SL_PARENTHESES,       //!< Between parentheses (usually '(' and ')')
     83            SL_PARENTHESES,       //!< Between parentheses (usually '{' and '}')
    8484            SL_PARENTHESESESCAPE, //!< Between parentheses with the internal escape character, that escapes even the closing paranthesis character.
    8585        } SPLIT_LINE_STATE;
     
    9292                  const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries=false,
    9393                  char escapeChar ='\\', bool removeEscapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
    94                   char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
     94                  char openparenthesis_char = '{', char closeparenthesis_char = '}',  bool removeParenthesisChars = true, char comment_char = '\0');
    9595        SubString(unsigned int argc, const char** argv);
    9696        /** @brief create a Substring as a copy of another one. @param subString the SubString to copy. */
     
    116116                           const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries = false,
    117117                           char escapeChar ='\\', bool removeExcapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
    118                            char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
     118                           char openparenthesis_char = '{', char closeparenthesis_char = '}',  bool removeParenthesisChars = true, char comment_char = '\0');
    119119        std::string join(const std::string& delimiter = " ") const;
    120120        ////////////////////////////////////////
     
    155155                                          char safemode_char = '"',
    156156                                          bool removeSafemodeChar = true,
    157                                           char openparenthesis_char = '(',
    158                                           char closeparenthesis_char = ')',
     157                                          char openparenthesis_char = '{',
     158                                          char closeparenthesis_char = '}',
    159159                                          bool removeParenthesisChars = true,
    160160                                          char comment_char = '\0',
Note: See TracChangeset for help on using the changeset viewer.