Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 28, 2007, 10:30:29 PM (18 years ago)
Author:
rgrieder
Message:
  • added Vector2, Vector3, Matrix3, ColourValue, Quaternion and String to the misc folder as header files (each of them contains #include <string> … typedef std::string String , etc.)
  • please use String from now on by including <misc/String.h"
  • removed #include <OgreVector3.h", etc. from "CoreIncludes.h" (adjusted all source files)
  • adjusted all the source files (except network, that keeps <string> for the moment) (what a mess..)
  • moved usleep hack to misc/Sleep.h
  • relative include paths for files from other root directories (like misc, network, etc.) (but it stills writes "../Orxonox.h" when in folder orxonox/objects)
  • "OgreSceneManager.h" —> <OgreSceneManager.h>
  • included OrxonoxPrereqs in every file in folder orxonox
  • moved HUD and ParticleInterface to namespace orxonox
  • removed some using namespace Ogre/std when appropriate
  • I hope I haven't forgotten important points..
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/core/ConfigValueContainer.h

    r705 r708  
    4343#define _ConfigValueContainer_H__
    4444
    45 #include <string>
    4645#include <list>
    4746
    4847#include "CorePrereqs.h"
    4948
    50 #include "OgreVector2.h"
    51 #include "OgreVector3.h"
    52 #include "OgreColourValue.h"
     49#include "misc/Vector2.h"
     50#include "misc/Vector3.h"
     51#include "misc/Matrix3.h"
     52#include "misc/Quaternion.h"
     53#include "misc/String.h"
     54#include "misc/ColourValue.h"
    5355#include "Language.h"
    5456
     
    8587                Bool,
    8688                ConstChar,
    87                 String,
    88                 Vector2,
    89                 Vector3,
    90                 ColourValue
     89                _String,
     90                _Vector2,
     91                _Vector3,
     92                _ColourValue
    9193            };
    9294
    93             ConfigValueContainer(const std::string& classname, const std::string& varname, int defvalue);
    94             ConfigValueContainer(const std::string& classname, const std::string& varname, unsigned int defvalue);
    95             ConfigValueContainer(const std::string& classname, const std::string& varname, char defvalue);
    96             ConfigValueContainer(const std::string& classname, const std::string& varname, unsigned char defvalue);
    97             ConfigValueContainer(const std::string& classname, const std::string& varname, float defvalue);
    98             ConfigValueContainer(const std::string& classname, const std::string& varname, double defvalue);
    99             ConfigValueContainer(const std::string& classname, const std::string& varname, long double defvalue);
    100             ConfigValueContainer(const std::string& classname, const std::string& varname, bool defvalue);
    101             ConfigValueContainer(const std::string& classname, const std::string& varname, const std::string& defvalue);
    102             ConfigValueContainer(const std::string& classname, const std::string& varname, const char* defvalue);
    103             ConfigValueContainer(const std::string& classname, const std::string& varname, Ogre::Vector2 defvalue);
    104             ConfigValueContainer(const std::string& classname, const std::string& varname, Ogre::Vector3 defvalue);
    105             ConfigValueContainer(const std::string& classname, const std::string& varname, Ogre::ColourValue defvalue);
     95            ConfigValueContainer(const String& classname, const String& varname, int defvalue);
     96            ConfigValueContainer(const String& classname, const String& varname, unsigned int defvalue);
     97            ConfigValueContainer(const String& classname, const String& varname, char defvalue);
     98            ConfigValueContainer(const String& classname, const String& varname, unsigned char defvalue);
     99            ConfigValueContainer(const String& classname, const String& varname, float defvalue);
     100            ConfigValueContainer(const String& classname, const String& varname, double defvalue);
     101            ConfigValueContainer(const String& classname, const String& varname, long double defvalue);
     102            ConfigValueContainer(const String& classname, const String& varname, bool defvalue);
     103            ConfigValueContainer(const String& classname, const String& varname, const String& defvalue);
     104            ConfigValueContainer(const String& classname, const String& varname, const char* defvalue);
     105            ConfigValueContainer(const String& classname, const String& varname, Vector2 defvalue);
     106            ConfigValueContainer(const String& classname, const String& varname, Vector3 defvalue);
     107            ConfigValueContainer(const String& classname, const String& varname, ColourValue defvalue);
    106108
    107109            /** @returns the value. @param value This is only needed to determine the right type. */
     
    122124            inline ConfigValueContainer& getValue(bool& value)                          { value = this->value_.value_bool_; return *this; }
    123125            /** @returns the value. @param value This is only needed to determine the right type. */
    124             inline ConfigValueContainer& getValue(std::string& value)                   { value = this->value_string_; return *this; }
     126            inline ConfigValueContainer& getValue(String& value)                   { value = this->value_string_; return *this; }
    125127            /** @returns the value. @param value This is only needed to determine the right type. */
    126128            inline ConfigValueContainer& getValue(const char* value)                    { value = this->value_string_.c_str(); return *this; }
    127129            /** @returns the value. @param value This is only needed to determine the right type. */
    128             inline ConfigValueContainer& getValue(Ogre::Vector2& value)                 { value = this->value_vector2_; return *this; }
     130            inline ConfigValueContainer& getValue(Vector2& value)                 { value = this->value_vector2_; return *this; }
    129131            /** @returns the value. @param value This is only needed to determine the right type. */
    130             inline ConfigValueContainer& getValue(Ogre::Vector3& value)                 { value = this->value_vector3_; return *this; }
     132            inline ConfigValueContainer& getValue(Vector3& value)                 { value = this->value_vector3_; return *this; }
    131133            /** @returns the value. @param value This is only needed to determine the right type. */
    132             inline ConfigValueContainer& getValue(Ogre::ColourValue& value)             { value = this->value_colourvalue_; return *this; }
     134            inline ConfigValueContainer& getValue(ColourValue& value)             { value = this->value_colourvalue_; return *this; }
    133135
    134             void description(const std::string& description);
     136            void description(const String& description);
    135137
    136             bool parseSting(const std::string& input);
     138            bool parseSting(const String& input);
    137139            void resetConfigFileEntry();
    138140            void resetConfigValue();
    139141
    140             static std::string getStrippedLine(const std::string& line);
    141             static bool isEmpty(const std::string& line);
    142             static bool isComment(const std::string& line);
     142            static String getStrippedLine(const String& line);
     143            static bool isEmpty(const String& line);
     144            static bool isComment(const String& line);
    143145
    144146        private:
    145             bool parseSting(const std::string& input, int defvalue);
    146             bool parseSting(const std::string& input, unsigned int defvalue);
    147             bool parseSting(const std::string& input, char defvalue);
    148             bool parseSting(const std::string& input, unsigned char defvalue);
    149             bool parseSting(const std::string& input, float defvalue);
    150             bool parseSting(const std::string& input, double defvalue);
    151             bool parseSting(const std::string& input, long double defvalue);
    152             bool parseSting(const std::string& input, bool defvalue);
    153             bool parseSting(const std::string& input, const std::string& defvalue);
    154             bool parseSting(const std::string& input, const char* defvalue);
    155             bool parseSting(const std::string& input, const Ogre::Vector2& defvalue);
    156             bool parseSting(const std::string& input, const Ogre::Vector3& defvalue);
    157             bool parseSting(const std::string& input, const Ogre::ColourValue& defvalue);
     147            bool parseSting(const String& input, int defvalue);
     148            bool parseSting(const String& input, unsigned int defvalue);
     149            bool parseSting(const String& input, char defvalue);
     150            bool parseSting(const String& input, unsigned char defvalue);
     151            bool parseSting(const String& input, float defvalue);
     152            bool parseSting(const String& input, double defvalue);
     153            bool parseSting(const String& input, long double defvalue);
     154            bool parseSting(const String& input, bool defvalue);
     155            bool parseSting(const String& input, const String& defvalue);
     156            bool parseSting(const String& input, const char* defvalue);
     157            bool parseSting(const String& input, const Vector2& defvalue);
     158            bool parseSting(const String& input, const Vector3& defvalue);
     159            bool parseSting(const String& input, const ColourValue& defvalue);
    158160
    159             static std::list<std::string>& getConfigFileLines();
     161            static std::list<String>& getConfigFileLines();
    160162            static bool finishedReadingConfigFile(bool finished = false);
    161163            void searchConfigFileLine();
    162             std::string parseValueString(bool bStripped = true);
     164            String parseValueString(bool bStripped = true);
    163165
    164             static void readConfigFile(const std::string& filename);
    165             static void writeConfigFile(const std::string& filename);
     166            static void readConfigFile(const String& filename);
     167            static void writeConfigFile(const String& filename);
    166168
    167             std::string         classname_;                     //!< The name of the class the variable belongs to
    168             std::string         varname_;                       //!< The name of the variable
    169             std::string         defvalueString_;                //!< The string of the default-variable
     169            String         classname_;                     //!< The name of the class the variable belongs to
     170            String         varname_;                       //!< The name of the variable
     171            String         defvalueString_;                //!< The string of the default-variable
    170172
    171173            union MultiType
     
    181183            } value_;                                           //!< The value of the variable
    182184
    183             std::string         value_string_;                  //!< The value, if the variable is of the type string
    184             Ogre::Vector2       value_vector2_;                 //!< The value, if the variable is of the type Vector2
    185             Ogre::Vector3       value_vector3_;                 //!< The value, if the variable is of the type Vector3
    186             Ogre::ColourValue   value_colourvalue_;             //!< The value, if the variable is of the type ColourValue
     185            String         value_string_;                  //!< The value, if the variable is of the type string
     186            Vector2       value_vector2_;                 //!< The value, if the variable is of the type Vector2
     187            Vector3       value_vector3_;                 //!< The value, if the variable is of the type Vector3
     188            ColourValue   value_colourvalue_;             //!< The value, if the variable is of the type ColourValue
    187189
    188             std::list<std::string>::iterator configFileLine_;   //!< An iterator, pointing to the entry of the variable in the config-file
     190            std::list<String>::iterator configFileLine_;   //!< An iterator, pointing to the entry of the variable in the config-file
    189191
    190192            VariableType type_;                                 //!< The type of the variable
Note: See TracChangeset for help on using the changeset viewer.