Changeset 1001 for code/branches/core2/src/util/MultiTypeString.h
- Timestamp:
- Apr 8, 2008, 1:51:25 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core2/src/util/MultiTypeString.h
r947 r1001 33 33 #include <iostream> 34 34 #include "UtilPrereqs.h" 35 #include "XMLIncludes.h"36 #include "tinyxml/ticpp.h"37 35 38 36 #include "MultiTypePrimitive.h" … … 57 55 inline MultiTypeString(const char* value) { this->setValue(value); } 58 56 inline MultiTypeString(const std::string& value) { this->setValue(value); } 59 inline MultiTypeString(const orxonox::Element& value) { this->setValue(value); }60 57 inline MultiTypeString(const MultiTypeString& mts) { this->setValue(mts); } 61 58 virtual inline ~MultiTypeString() {} … … 64 61 inline MultiTypeString& operator=(const char* value) { this->setValue(value); return *this; } 65 62 inline MultiTypeString& operator=(const std::string& value) { this->setValue(value); return *this; } 66 inline MultiTypeString& operator=(const orxonox::Element& value) { this->setValue(value); return *this; }67 63 inline MultiTypeString& operator=(const MultiTypeString& mts) { this->setValue(mts); return *this; } 68 64 … … 70 66 inline bool operator==(const char* value) const { return (this->string_ == std::string(value)); } 71 67 inline bool operator==(const std::string& value) const { return (this->string_ == value); } 72 inline bool operator==(const orxonox::Element& value) const { return (&this->xmlelement_ == &value); }73 68 bool operator==(const MultiTypeString& mts) const; 74 69 … … 76 71 inline bool operator!=(const char* value) const { return (this->string_ != std::string(value)); } 77 72 inline bool operator!=(const std::string& value) const { return (this->string_ != value); } 78 inline bool operator!=(const orxonox::Element& value) const { return (&this->xmlelement_ != &value); }79 73 bool operator!=(const MultiTypeString& mts) const; 80 74 … … 94 88 virtual operator std::string() const; 95 89 virtual operator const char*() const; 96 virtual operator orxonox::Element() const;97 90 98 91 using MultiTypePrimitive::setValue; 99 92 inline void setValue(const char* value) { this->type_ = MT_string; this->string_ = std::string(value); } 100 93 inline void setValue(const std::string& value) { this->type_ = MT_string; this->string_ = value; } 101 inline void setValue(const orxonox::Element& value) { this->type_ = MT_xmlelement; this->xmlelement_ = value; }102 94 void setValue(const MultiTypeString& mts); 103 95 104 96 inline std::string getString() const { return this->string_; } 105 97 inline const char* getConstChar() const { return this->string_.c_str(); } 106 inline orxonox::Element getXMLElement() const { return this->xmlelement_; }107 98 108 99 inline std::string& getString() { return this->string_; } 109 100 inline const char* getConstChar() { return this->string_.c_str(); } 110 inline orxonox::Element& getXMLElement() { return this->xmlelement_; }111 101 112 102 using MultiTypePrimitive::getValue; 113 103 inline void getValue(std::string* variable) const { (*variable) = this->string_; } 114 104 inline void getValue(const char** variable) const { (*variable) = this->string_.c_str(); } 115 inline void getValue(orxonox::Element* variable) const { (*variable) = this->xmlelement_; }116 105 117 106 virtual std::string getTypename() const; … … 122 111 protected: 123 112 std::string string_; 124 orxonox::Element xmlelement_;125 113 }; 126 114
Note: See TracChangeset
for help on using the changeset viewer.