[Orxonox-commit 2571] r7276 - in code/branches/consolecommands3: data/levels data/levels/old src/libraries/core src/libraries/core/command src/libraries/core/input src/libraries/util

landauf at orxonox.net landauf at orxonox.net
Tue Aug 31 01:00:20 CEST 2010


Author: landauf
Date: 2010-08-31 01:00:20 +0200 (Tue, 31 Aug 2010)
New Revision: 7276

Modified:
   code/branches/consolecommands3/data/levels/fps_test.oxw
   code/branches/consolecommands3/data/levels/old/physicstest2.oxw
   code/branches/consolecommands3/data/levels/presentation_FS10.oxw
   code/branches/consolecommands3/data/levels/presentation_FS10_ed.oxw
   code/branches/consolecommands3/src/libraries/core/CommandLineParser.h
   code/branches/consolecommands3/src/libraries/core/ConfigValueContainer.cc
   code/branches/consolecommands3/src/libraries/core/GraphicsManager.cc
   code/branches/consolecommands3/src/libraries/core/command/ArgumentCompletionFunctions.cc
   code/branches/consolecommands3/src/libraries/core/command/CommandEvaluation.cc
   code/branches/consolecommands3/src/libraries/core/command/Executor.cc
   code/branches/consolecommands3/src/libraries/core/input/Button.cc
   code/branches/consolecommands3/src/libraries/util/Math.cc
   code/branches/consolecommands3/src/libraries/util/SubString.h
Log:
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.

Modified: code/branches/consolecommands3/data/levels/fps_test.oxw
===================================================================
--- code/branches/consolecommands3/data/levels/fps_test.oxw	2010-08-30 21:45:44 UTC (rev 7275)
+++ code/branches/consolecommands3/data/levels/fps_test.oxw	2010-08-30 23:00:20 UTC (rev 7276)
@@ -19,8 +19,8 @@
    ambientlight = "0.1, 0.1, 0.1"
    skybox       = "Orxonox/skypanoramagen1"
    gravity      = "0,-1000,0"
-   negativeWorldRange = "(-100000, -100000, -100000)"
-   positiveWorldRange = "( 100000,  100000,  100000)"
+   negativeWorldRange = "-100000, -100000, -100000"
+   positiveWorldRange = " 100000,  100000,  100000"
    hasPhysics   = true
   >
     <Light type=directional position="0,-100000,0" direction="0.02, -1, 0.05" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />

Modified: code/branches/consolecommands3/data/levels/old/physicstest2.oxw
===================================================================
--- code/branches/consolecommands3/data/levels/old/physicstest2.oxw	2010-08-30 21:45:44 UTC (rev 7275)
+++ code/branches/consolecommands3/data/levels/old/physicstest2.oxw	2010-08-30 23:00:20 UTC (rev 7276)
@@ -12,8 +12,8 @@
   <Scene
    ambientlight = "0.5, 0.5, 0.5"
    skybox       = "Orxonox/Starbox"
-   negativeWorldRange = "(-100000, -100000, -100000)"
-   positiveWorldRange = "( 100000,  100000,  100000)"
+   negativeWorldRange = "-100000, -100000, -100000"
+   positiveWorldRange = " 100000,  100000,  100000"
    hasPhysics   = true
   >
       <!--SpawnPoint position="0,   0,  100"           spawnclass=SpaceShip pawndesign=spaceshipassff />

Modified: code/branches/consolecommands3/data/levels/presentation_FS10.oxw
===================================================================
--- code/branches/consolecommands3/data/levels/presentation_FS10.oxw	2010-08-30 21:45:44 UTC (rev 7275)
+++ code/branches/consolecommands3/data/levels/presentation_FS10.oxw	2010-08-30 23:00:20 UTC (rev 7276)
@@ -19,8 +19,8 @@
    ambientlight = "0.1, 0.1, 0.1"
    skybox       = "Orxonox/skypanoramagen1"
    gravity      = "0,-1000,0"
-   negativeWorldRange = "(-100000, -100000, -100000)"
-   positiveWorldRange = "( 100000,  100000,  100000)"
+   negativeWorldRange = "-100000, -100000, -100000"
+   positiveWorldRange = " 100000,  100000,  100000"
    hasPhysics   = true
   >
     <Light type=directional position="0,-100000,0" direction="0.02, -1, 0.05" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
@@ -98,4 +98,4 @@
 
 
   </Scene>
-</Level>
\ No newline at end of file
+</Level>

Modified: code/branches/consolecommands3/data/levels/presentation_FS10_ed.oxw
===================================================================
--- code/branches/consolecommands3/data/levels/presentation_FS10_ed.oxw	2010-08-30 21:45:44 UTC (rev 7275)
+++ code/branches/consolecommands3/data/levels/presentation_FS10_ed.oxw	2010-08-30 23:00:20 UTC (rev 7276)
@@ -19,8 +19,8 @@
    ambientlight = "0.1, 0.1, 0.1"
    skybox       = "Orxonox/skypanoramagen1"
    gravity      = "0,-1000,0"
-   negativeWorldRange = "(-100000, -100000, -100000)"
-   positiveWorldRange = "( 100000,  100000,  100000)"
+   negativeWorldRange = "-100000, -100000, -100000"
+   positiveWorldRange = " 100000,  100000,  100000"
    hasPhysics   = true
   >
     <Light type=directional position="0,-100000,0" direction="0.02, -1, 0.05" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
@@ -172,4 +172,4 @@
 
 
   </Scene>
-</Level>
\ No newline at end of file
+</Level>

Modified: code/branches/consolecommands3/src/libraries/core/CommandLineParser.h
===================================================================
--- code/branches/consolecommands3/src/libraries/core/CommandLineParser.h	2010-08-30 21:45:44 UTC (rev 7275)
+++ code/branches/consolecommands3/src/libraries/core/CommandLineParser.h	2010-08-30 23:00:20 UTC (rev 7276)
@@ -63,7 +63,7 @@
         There is a possibility to define a short cut so you can write "-p 20" instead of "--port 20".
         Note the difference between "-" and "--"!
         Also, there is no restriction to the number of strings you add after --name.
-        So "--startVector (2, 4, 5)" is perfectly legal.
+        So "--startVector {2, 4, 5}" is perfectly legal.
 
         Retrieving an argument is possible with the getCommandLineArgument function of the
         CommandLineParser class. It is a Singleton, but the public interface is static.

Modified: code/branches/consolecommands3/src/libraries/core/ConfigValueContainer.cc
===================================================================
--- code/branches/consolecommands3/src/libraries/core/ConfigValueContainer.cc	2010-08-30 21:45:44 UTC (rev 7275)
+++ code/branches/consolecommands3/src/libraries/core/ConfigValueContainer.cc	2010-08-30 23:00:20 UTC (rev 7276)
@@ -301,7 +301,7 @@
     */
     bool ConfigValueContainer::callFunctionWithIndex(bool (ConfigValueContainer::* function) (unsigned int, const MultiType&), const std::string& input)
     {
-        SubString token(input, " ", SubString::WhiteSpaces, true, '\\', false, '"', false, '(', ')', false, '\0');
+        SubString token(input, " ", SubString::WhiteSpaces, true, '\\', false, '"', false, '\0', '\0', false, '\0');
         int index = -1;
         bool success = false;
 

Modified: code/branches/consolecommands3/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/branches/consolecommands3/src/libraries/core/GraphicsManager.cc	2010-08-30 21:45:44 UTC (rev 7275)
+++ code/branches/consolecommands3/src/libraries/core/GraphicsManager.cc	2010-08-30 23:00:20 UTC (rev 7276)
@@ -292,7 +292,7 @@
 
         boost::filesystem::path folder(ogrePluginsDirectory_);
         // Do some SubString magic to get the comma separated list of plugins
-        SubString plugins(ogrePlugins_, ",", " ", false, '\\', false, '"', false, '(', ')', false, '\0');
+        SubString plugins(ogrePlugins_, ",", " ", false, '\\', false, '"', false, '{', '}', false, '\0');
         // Use backslash paths on Windows! file_string() already does that though.
         for (unsigned int i = 0; i < plugins.size(); ++i)
             ogreRoot_->loadPlugin((folder / plugins[i]).file_string());

Modified: code/branches/consolecommands3/src/libraries/core/command/ArgumentCompletionFunctions.cc
===================================================================
--- code/branches/consolecommands3/src/libraries/core/command/ArgumentCompletionFunctions.cc	2010-08-30 21:45:44 UTC (rev 7275)
+++ code/branches/consolecommands3/src/libraries/core/command/ArgumentCompletionFunctions.cc	2010-08-30 23:00:20 UTC (rev 7276)
@@ -146,7 +146,7 @@
 
         ARGUMENT_COMPLETION_FUNCTION_IMPLEMENTATION_MULTI(hiddencommand)(const std::string& fragment)
         {
-            SubString tokens(fragment, " ", SubString::WhiteSpaces, false, '\\', true, '"', true, '(', ')', true, '\0');
+            SubString tokens(fragment, " ", SubString::WhiteSpaces, false, '\\', true, '"', true, '{', '}', true, '\0');
 
             if (tokens.size() == 0)
                 return detail::_groupsandcommands(fragment, true);

Modified: code/branches/consolecommands3/src/libraries/core/command/CommandEvaluation.cc
===================================================================
--- code/branches/consolecommands3/src/libraries/core/command/CommandEvaluation.cc	2010-08-30 21:45:44 UTC (rev 7275)
+++ code/branches/consolecommands3/src/libraries/core/command/CommandEvaluation.cc	2010-08-30 23:00:20 UTC (rev 7276)
@@ -52,7 +52,7 @@
         this->bTriedToEvaluatedParams_ = false;
         this->numberOfEvaluatedParams_ = 0;
 
-        this->tokens_.split(command, " ", SubString::WhiteSpaces, false, '\\', true, '"', true, '(', ')', true, '\0');
+        this->tokens_.split(command, " ", SubString::WhiteSpaces, false, '\\', true, '"', true, '{', '}', true, '\0');
     }
 
     unsigned int CommandEvaluation::getNumberOfArguments() const

Modified: code/branches/consolecommands3/src/libraries/core/command/Executor.cc
===================================================================
--- code/branches/consolecommands3/src/libraries/core/command/Executor.cc	2010-08-30 21:45:44 UTC (rev 7275)
+++ code/branches/consolecommands3/src/libraries/core/command/Executor.cc	2010-08-30 23:00:20 UTC (rev 7276)
@@ -58,7 +58,7 @@
 
     MultiType Executor::parse(const std::string& arguments, int* error, const std::string& delimiter, bool bPrintError) const
     {
-        return this->parse(SubString(arguments, delimiter, SubString::WhiteSpaces, false, '\\', true, '"', true, '(', ')', true, '\0'), error, delimiter, bPrintError);
+        return this->parse(SubString(arguments, delimiter, SubString::WhiteSpaces, false, '\\', true, '"', true, '{', '}', true, '\0'), error, delimiter, bPrintError);
     }
 
     MultiType Executor::parse(const SubString& arguments, int* error, const std::string& delimiter, bool bPrintError) const

Modified: code/branches/consolecommands3/src/libraries/core/input/Button.cc
===================================================================
--- code/branches/consolecommands3/src/libraries/core/input/Button.cc	2010-08-30 21:45:44 UTC (rev 7275)
+++ code/branches/consolecommands3/src/libraries/core/input/Button.cc	2010-08-30 23:00:20 UTC (rev 7276)
@@ -116,14 +116,14 @@
 
         // separate the commands
         SubString commandStrings(bindingString_, "|", SubString::WhiteSpaces, false,
-            '\\', false, '"', false, '(', ')', false, '\0');
+            '\\', false, '"', false, '{', '}', false, '\0');
 
         for (unsigned int iCommand = 0; iCommand < commandStrings.size(); iCommand++)
         {
             if (!commandStrings[iCommand].empty())
             {
                 SubString tokens(commandStrings[iCommand], " ", SubString::WhiteSpaces, false,
-                    '\\', false, '"', false, '(', ')', false, '\0');
+                    '\\', false, '"', false, '{', '}', false, '\0');
 
                 KeybindMode::Value mode = KeybindMode::None;
                 float paramModifier = 1.0f;

Modified: code/branches/consolecommands3/src/libraries/util/Math.cc
===================================================================
--- code/branches/consolecommands3/src/libraries/util/Math.cc	2010-08-30 21:45:44 UTC (rev 7275)
+++ code/branches/consolecommands3/src/libraries/util/Math.cc	2010-08-30 23:00:20 UTC (rev 7276)
@@ -233,8 +233,8 @@
     // std::string to Vector2
     bool ConverterFallback<std::string, orxonox::Vector2>::convert(orxonox::Vector2* output, const std::string& input)
     {
-        size_t opening_parenthesis, closing_parenthesis = input.find(')');
-        if ((opening_parenthesis = input.find('(')) == std::string::npos)
+        size_t opening_parenthesis, closing_parenthesis = input.find('}');
+        if ((opening_parenthesis = input.find('{')) == std::string::npos)
             opening_parenthesis = 0;
         else
             opening_parenthesis++;
@@ -256,8 +256,8 @@
     // std::string to Vector3
     bool ConverterFallback<std::string, orxonox::Vector3>::convert(orxonox::Vector3* output, const std::string& input)
     {
-        size_t opening_parenthesis, closing_parenthesis = input.find(')');
-        if ((opening_parenthesis = input.find('(')) == std::string::npos)
+        size_t opening_parenthesis, closing_parenthesis = input.find('}');
+        if ((opening_parenthesis = input.find('{')) == std::string::npos)
             opening_parenthesis = 0;
         else
             opening_parenthesis++;
@@ -281,8 +281,8 @@
     // std::string to Vector4
     bool ConverterFallback<std::string, orxonox::Vector4>::convert(orxonox::Vector4* output, const std::string& input)
     {
-        size_t opening_parenthesis, closing_parenthesis = input.find(')');
-        if ((opening_parenthesis = input.find('(')) == std::string::npos)
+        size_t opening_parenthesis, closing_parenthesis = input.find('}');
+        if ((opening_parenthesis = input.find('{')) == std::string::npos)
             opening_parenthesis = 0;
         else
             opening_parenthesis++;
@@ -308,8 +308,11 @@
     // std::string to Quaternion
     bool ConverterFallback<std::string, orxonox::Quaternion>::convert(orxonox::Quaternion* output, const std::string& input)
     {
-        size_t opening_parenthesis, closing_parenthesis = input.find(')');
-        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+        size_t opening_parenthesis, closing_parenthesis = input.find('}');
+        if ((opening_parenthesis = input.find('{')) == std::string::npos)
+            opening_parenthesis = 0;
+        else
+            opening_parenthesis++;
 
         SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
         if (tokens.size() >= 4)
@@ -331,8 +334,11 @@
     // std::string to ColourValue
     bool ConverterFallback<std::string, orxonox::ColourValue>::convert(orxonox::ColourValue* output, const std::string& input)
     {
-        size_t opening_parenthesis, closing_parenthesis = input.find(')');
-        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+        size_t opening_parenthesis, closing_parenthesis = input.find('}');
+        if ((opening_parenthesis = input.find('{')) == std::string::npos)
+            opening_parenthesis = 0;
+        else
+            opening_parenthesis++;
 
         SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
         if (tokens.size() >= 3)

Modified: code/branches/consolecommands3/src/libraries/util/SubString.h
===================================================================
--- code/branches/consolecommands3/src/libraries/util/SubString.h	2010-08-30 21:45:44 UTC (rev 7275)
+++ code/branches/consolecommands3/src/libraries/util/SubString.h	2010-08-30 23:00:20 UTC (rev 7276)
@@ -80,7 +80,7 @@
             SL_SAFEMODE,          //!< In safe mode (between "" mostly).
             SL_SAFEESCAPE,        //!< In safe mode with the internal escape character, that escapes even the savemode character.
             SL_COMMENT,           //!< In Comment mode.
-            SL_PARENTHESES,       //!< Between parentheses (usually '(' and ')')
+            SL_PARENTHESES,       //!< Between parentheses (usually '{' and '}')
             SL_PARENTHESESESCAPE, //!< Between parentheses with the internal escape character, that escapes even the closing paranthesis character.
         } SPLIT_LINE_STATE;
 
@@ -91,7 +91,7 @@
         SubString(const std::string& string,
                   const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries=false,
                   char escapeChar ='\\', bool removeEscapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
-                  char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
+                  char openparenthesis_char = '{', char closeparenthesis_char = '}',  bool removeParenthesisChars = true, char comment_char = '\0');
         SubString(unsigned int argc, const char** argv);
         /** @brief create a Substring as a copy of another one. @param subString the SubString to copy. */
         SubString(const SubString& subString) { *this = subString; };
@@ -115,7 +115,7 @@
         unsigned int split(const std::string& string,
                            const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries = false,
                            char escapeChar ='\\', bool removeExcapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
-                           char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
+                           char openparenthesis_char = '{', char closeparenthesis_char = '}',  bool removeParenthesisChars = true, char comment_char = '\0');
         std::string join(const std::string& delimiter = " ") const;
         ////////////////////////////////////////
 
@@ -154,8 +154,8 @@
                                           bool removeExcapeChar = true,
                                           char safemode_char = '"',
                                           bool removeSafemodeChar = true,
-                                          char openparenthesis_char = '(',
-                                          char closeparenthesis_char = ')',
+                                          char openparenthesis_char = '{',
+                                          char closeparenthesis_char = '}',
                                           bool removeParenthesisChars = true,
                                           char comment_char = '\0',
                                           SPLIT_LINE_STATE start_state = SL_NORMAL);




More information about the Orxonox-commit mailing list