Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7218 in orxonox.OLD


Ignore:
Timestamp:
Mar 12, 2006, 3:00:04 PM (18 years ago)
Author:
bensch
Message:

orxonox/std:: more strings

Location:
branches/std/src
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • branches/std/src/lib/graphics/effects/lense_flare.cc

    r7216 r7218  
    131131 * @param mode the mode character
    132132 */
    133 GLint LenseFlare::charToFogMode(const char* mode)
     133GLint LenseFlare::stringToFogMode(const std::string& mode)
    134134{}
    135135
  • branches/std/src/lib/graphics/effects/lense_flare.h

    r7216 r7218  
    4343
    4444  private:
    45     GLint charToFogMode(const char* mode);
     45    GLint stringToFogMode(const std::string& mode);
    4646    void setSourceVisibility(bool visibility) ;
    4747
  • branches/std/src/lib/graphics/importer/static_model.cc

    r7210 r7218  
    499499 * String is different from the argument addFace,
    500500 * in this, that the first Vertex/Normal/Texcoord is 1 instead of 0
     501 *
     502 * @TODO make it std::string conform
    501503 */
    502504bool StaticModel::addFace (const std::string& faceStringInput)
  • branches/std/src/lib/graphics/importer/texture_sequence.cc

    r6624 r7218  
    124124 * @returns true on success
    125125 */
    126 bool TextureSequence::addFrame(const char* imageName)
     126bool TextureSequence::addFrame(const std::string& imageName)
    127127{
    128   if (imageName == NULL)
    129     return false;
    130 
    131   SDL_Surface* addSurface = IMG_Load(imageName);
     128  SDL_Surface* addSurface = IMG_Load(imageName.c_str());
    132129  bool success = this->addFrame(addSurface);
    133130  delete addSurface;
  • branches/std/src/lib/graphics/importer/texture_sequence.h

    r7195 r7218  
    2323    bool loadImageSeries(unsigned int count, ...);
    2424    bool loadImageSeries(unsigned int count, va_list textureNames);
    25     bool addFrame(const char* image);
     25    bool addFrame(const std::string& image);
    2626    bool addFrame(SDL_Surface* surface);
    2727    bool addFrame(GLuint texture);
  • branches/std/src/lib/gui/gl_gui/glgui_button.cc

    r6287 r7218  
    5454}
    5555
    56 void GLGuiButton::setLabel(const char* label)
     56void GLGuiButton::setLabel(const std::string& label)
    5757{
    5858  this->label->setText(label);
  • branches/std/src/lib/gui/gl_gui/glgui_button.h

    r5427 r7218  
    3535
    3636   void init();
    37    void setLabel(const char* label);
     37   void setLabel(const std::string& label);
    3838
    3939   virtual void draw() const;
  • branches/std/src/lib/gui/gl_gui/glgui_menu.h

    r5391 r7218  
    2424  void init();
    2525
    26   void addItem(const char* itemName);
    27   void removeItem(const char* itemName);
     26  void addItem(const std::string& itemName);
     27  void removeItem(const std::string& itemName);
    2828  void removeItem(unsigned int itemNumber);
    29   void selectItem(const char* itemName);
     29  void selectItem(const std::string& itemName);
    3030  void selectItem(unsigned int itemNumber);
    3131
  • branches/std/src/lib/gui/gl_gui/glgui_widget.h

    r7062 r7218  
    4747    virtual char* save() {};
    4848    /** loads options of the Widget. @param loadString a string containing the Options */
    49     virtual void load(const char* loadString) {};
     49    virtual void load(const std::string& loadString) {};
    5050
    5151    void show();
  • branches/std/src/lib/lang/base_object.cc

    r7216 r7218  
    3434BaseObject::BaseObject()
    3535{
     36  this->classID = CL_BASE_OBJECT;
    3637  this->className = "BaseObject";
    37   this->classID = CL_BASE_OBJECT;
    3838
    3939  this->objectName = "";
     
    7878 * @param className the class name
    7979*/
    80 void BaseObject::setClassID(ClassID classID, const char* className)
     80void BaseObject::setClassID(ClassID classID, const std::string& className)
    8181{
    8282  //printf("%s(0x%.8X)->%s(0x%.8X)\n", this->className, this->classID, className, classID);
     
    150150 * @returns true if it is, false otherwise
    151151 */
    152 bool BaseObject::isA (const char* className) const
     152bool BaseObject::isA (const std::string& className) const
    153153{
    154154  ClassID classID = ClassList::StringToID(className);
     
    163163 * @returns true on match, false otherwise.
    164164 */
    165 bool BaseObject::operator==(const char* objectName)
    166 {
    167   return (objectName != NULL && this->objectName == objectName);
     165bool BaseObject::operator==(const std::string& objectName)
     166{
     167  return (this->objectName == objectName);
    168168}
    169169
  • branches/std/src/lib/lang/base_object.h

    r7214 r7218  
    3838
    3939  /** @returns the className of the corresponding Object */
    40   inline const char* getClassName() const { return this->className; };
     40  inline const char* getClassName() const { return this->className.c_str(); };
    4141  /** @returns the classID of the corresponding Object */
    4242  inline int getClassID() const { return this->classID; };
     
    4444
    4545  bool isA (ClassID classID) const;
    46   bool isA (const char* className) const;
     46  bool isA (const std::string& className) const;
    4747  void whatIs() const;
    4848
    49   bool operator==(const char* objectName);
     49  bool operator==(const std::string& objectName);
    5050  /** @param classID comparer for a ClassID @returns true on match, false otherwise */
    5151  bool operator==(ClassID classID) { return this->isA(classID); };
     
    5555
    5656 protected:
    57   void setClassID(ClassID classID, const char* className);
     57   void setClassID(ClassID classID, const std::string& className);
    5858
    5959 private:
    60     const char*        className;        //!< the name of the class
     60    std::string        className;        //!< the name of the class
    6161    long               classID;          //!< this is the id from the class_id.h enumeration
    6262    std::string        objectName;       //!< The name of this object
  • branches/std/src/lib/shell/shell_command.cc

    r7216 r7218  
    186186            {
    187187
    188               (*alias)->getCommand()->executor->execute(objectList->front(), executionString.substr(inputSplits.getOffset(1), executionString.size())); /// TODO CHECK IF OK
     188              (*alias)->getCommand()->executor->execute(objectList->front(), executionString.substr(inputSplits.getOffset(1))); /// TODO CHECK IF OK
    189189            }
    190190            else
     
    243243              return false;
    244244            if (inputSplits.getCount() > fktPos+1)
    245               (*cmdIT)->executor->execute(objectPointer, executionString.substr(inputSplits.getOffset(fktPos +1), executionString.size())); /// TODO CHECK IF OK
     245              (*cmdIT)->executor->execute(objectPointer, executionString.substr(inputSplits.getOffset(fktPos +1))); /// TODO CHECK IF OK
    246246            else
    247247              (*cmdIT)->executor->execute(objectPointer, "");
  • branches/std/src/lib/util/executor/functor_list.h

    r7216 r7218  
    7474//#define l_VECTOR_DEFAULT   Vector(0,0,0)        //!< Default value for a VECTOR
    7575
    76 #define l_CSTRING_TYPE     const char*          //!< The type of a CSTRING
    77 #define l_CSTRING_FUNC     isCString            //!< The function to parse a CSTRING
    78 #define l_CSTRING_NAME     "cstring"            //!< The name of a CSTRING
    79 #define l_CSTRING_PARAM    MT_STRING            //!< the type of the parameter CSTRING
    80 #define l_CSTRING_DEFAULT  ""                   //!< a default Value for an CSTRING
    81 
    8276#define l_STRING_TYPE      const std::string&   //!< The type of a STRING
    8377#define l_STRING_FUNC      isString             //!< The function to parse a STRING
    8478#define l_STRING_NAME      "string"             //!< The name of a STRING
    85 #define l_STRING_PARAM     MT_CSTRING           //!< the type of the parameter STRING
     79#define l_STRING_PARAM     MT_STRING           //!< the type of the parameter STRING
    8680#define l_STRING_DEFAULT   ""                   //!< a default Value for an STRING
    8781
  • branches/std/src/lib/util/loading/resource_manager.cc

    r7210 r7218  
    849849  {
    850850    std::string homeDir;
    851     std::string newName = name.substr(1, name.size()-1);
     851    std::string newName = name.substr(1);
    852852#ifdef __WIN32__
    853853    homeDir = getenv("USERPROFILE");
  • branches/std/src/lib/util/multi_type.cc

    r7214 r7218  
    5555      break;
    5656    case MT_STRING:
    57     case MT_CSTRING:
    5857      this->storedString = "";
    5958      break;
  • branches/std/src/lib/util/multi_type.h

    r7214 r7218  
    2424  MT_EXT1            = 32,                 //!< An external Type.
    2525  MT_EXT2            = 64,                 //!< An external Type.
    26 
    27   MT_CSTRING         = 128,                //!< An entire String.
    2826} MT_Type;
    2927
  • branches/std/src/subprojects/others/TTFtoIMG.cc

    r6348 r7218  
    22#include <SDL/SDL.h>
    33#include <SDL/SDL_ttf.h>
    4 
     4#include <string>
    55
    66
     
    1616
    1717
    18 void createAsciiImage(const char* fileName, unsigned int size)
     18void createAsciiImage(const std::string& fileName, unsigned int size)
    1919{
    2020  if (fontTTF == NULL)
     
    6868    }
    6969  }
    70   SDL_SaveBMP(tmpSurf, fileName);
     70  SDL_SaveBMP(tmpSurf, fileName.c_str());
    7171  SDL_FreeSurface(tmpSurf);
    7272}
     
    8181
    8282  fontTTF = TTF_OpenFont(argv[1], renderSize);
    83  
     83
    8484  createAsciiImage(argv[2], renderSize);
    85  
     85
    8686  //  delete fontTTF;
    8787  TTF_Quit();
  • branches/std/src/util/fast_factory.h

    r7216 r7218  
    121121  {
    122122  public:
    123     static tFastFactory<T>* getFastFactory(ClassID classID, const char* fastFactoryName = NULL);
     123    static tFastFactory<T>* getFastFactory(ClassID classID, const std::string& fastFactoryName = NULL);
    124124
    125125  private:
    126     tFastFactory(ClassID classID, const char* fastFactoryName);
     126    tFastFactory(ClassID classID, const std::string& fastFactoryName);
    127127
    128128    virtual void fabricate();
     
    136136 */
    137137template<class T>
    138 tFastFactory<T>::tFastFactory(ClassID classID, const char* fastFactoryName)
     138tFastFactory<T>::tFastFactory(ClassID classID, const std::string& fastFactoryName)
    139139    : FastFactory(classID, fastFactoryName)
    140140{}
     
    147147 */
    148148template<class T>
    149 tFastFactory<T>* tFastFactory<T>::getFastFactory(ClassID classID, const char* fastFactoryName)
     149    tFastFactory<T>* tFastFactory<T>::getFastFactory(ClassID classID, const std::string& fastFactoryName)
    150150{
    151151  tFastFactory<T>* tmpFac = NULL;
Note: See TracChangeset for help on using the changeset viewer.