Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7218 in orxonox.OLD for branches/std/src/lib/lang


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

orxonox/std:: more strings

Location:
branches/std/src/lib/lang
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.