Changeset 1325
- Timestamp:
- May 19, 2008, 3:54:50 PM (17 years ago)
- Location:
- code/branches/console/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/console/src/core/ConfigValueContainer.cc
r1324 r1325 87 87 88 88 if (defvalue.size() > 0) 89 this->value_ = defvalue[0]; 90 91 for (unsigned int i = 0; i < defvalue.size(); i++) 92 ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, defvalue[i].toString(), this->value_.isA(MT_string)); 93 94 for (unsigned int i = 0; i < defvalue.size(); i++) 95 this->defvalueStringVector_.push_back(defvalue[i].toString()); 96 97 this->update(); 89 { 90 this->value_ = defvalue[0]; 91 92 for (unsigned int i = 0; i < defvalue.size(); i++) 93 { 94 ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, defvalue[i].toString(), this->value_.isA(MT_string)); 95 this->defvalueStringVector_.push_back(defvalue[i].toString()); 96 } 97 98 this->update(); 99 } 98 100 } 99 101 … … 282 284 { 283 285 if (i < this->defvalueStringVector_.size()) 286 { 284 287 this->value_.fromString(ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, this->defvalueStringVector_[i], this->value_.isA(MT_string))); 288 } 285 289 else 286 this->value_.fromString(ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, MultiTypeMath(), this->value_.isA(MT_string))); 290 { 291 this->value_.fromString(ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, "abc", this->value_.isA(MT_string))); 292 } 287 293 288 294 this->valueVector_.push_back(this->value_); -
code/branches/console/src/core/ConfigValueContainer.h
r1324 r1325 94 94 { 95 95 this->value_ = T(); 96 this->update(); 96 97 } 97 98 -
code/branches/console/src/core/Shell.cc
r1324 r1325 80 80 SetConfigValue(maxHistoryLength_, 100); 81 81 SetConfigValue(historyOffset_, 0); 82 SetConfigValueVector(commandHistory_, std::vector<std::string>( 1, ""));82 SetConfigValueVector(commandHistory_, std::vector<std::string>()); 83 83 84 84 if (this->historyOffset_ >= this->maxHistoryLength_) -
code/branches/console/src/util/MultiTypePrimitive.h
r1320 r1325 138 138 void setValue(const MultiTypePrimitive& mtp); 139 139 140 inline void* getVoid() const { return this->value_.void_; 140 inline void* getVoid() const { return this->value_.void_; } 141 141 inline int getInt() const { return this->value_.int_; } 142 142 inline unsigned int getUnsignedInt() const { return this->value_.uint_; } -
code/branches/console/src/util/MultiTypeString.h
r1320 r1325 61 61 inline MultiTypeString(long double value) : MultiTypePrimitive(value) {} 62 62 inline MultiTypeString(bool value) : MultiTypePrimitive(value) {} 63 inline MultiTypeString(const char* value) 64 inline MultiTypeString(const std::string& value) 65 inline MultiTypeString(const MultiTypeString& mts) 63 inline MultiTypeString(const char* value) { this->setValue(value); } 64 inline MultiTypeString(const std::string& value) { this->setValue(value); } 65 inline MultiTypeString(const MultiTypeString& mts) { this->setValue(mts); } 66 66 virtual inline ~MultiTypeString() {} 67 67 68 68 using MultiTypePrimitive::operator=; 69 inline MultiTypeString& operator=(const char* value){ this->setValue(value); return *this; }70 inline MultiTypeString& operator=(const std::string& value){ this->setValue(value); return *this; }71 inline MultiTypeString& operator=(const MultiTypeString& mts) 69 inline MultiTypeString& operator=(const char* value) { this->setValue(value); return *this; } 70 inline MultiTypeString& operator=(const std::string& value) { this->setValue(value); return *this; } 71 inline MultiTypeString& operator=(const MultiTypeString& mts) { this->setValue(mts); return *this; } 72 72 73 73 using MultiTypePrimitive::operator==; 74 inline bool operator==(const char* value) const { return (this->string_== std::string(value)); }75 inline bool operator==(const std::string& value) const { return (this->string_== value); }74 inline bool operator==(const char* value) const { return (this->string_ == std::string(value)); } 75 inline bool operator==(const std::string& value) const { return (this->string_ == value); } 76 76 bool operator==(const MultiTypeString& mts) const; 77 77 78 78 using MultiTypePrimitive::operator!=; 79 inline bool operator!=(const char* value) const { return (this->string_!= std::string(value)); }80 inline bool operator!=(const std::string& value) const { return (this->string_!= value); }79 inline bool operator!=(const char* value) const { return (this->string_ != std::string(value)); } 80 inline bool operator!=(const std::string& value) const { return (this->string_ != value); } 81 81 bool operator!=(const MultiTypeString& mts) const; 82 82 83 virtual operator void*() 84 virtual operator int() 85 virtual operator unsigned int() 86 virtual operator char() 87 virtual operator unsigned char() 88 virtual operator short() 89 virtual operator unsigned short() 90 virtual operator long() 91 virtual operator unsigned long() 92 virtual operator float () 93 virtual operator double () 94 virtual operator long double() 95 virtual operator bool() 96 virtual operator std::string() 97 virtual operator const char*() 83 virtual operator void*() const; 84 virtual operator int() const; 85 virtual operator unsigned int() const; 86 virtual operator char() const; 87 virtual operator unsigned char() const; 88 virtual operator short() const; 89 virtual operator unsigned short() const; 90 virtual operator long() const; 91 virtual operator unsigned long() const; 92 virtual operator float () const; 93 virtual operator double () const; 94 virtual operator long double() const; 95 virtual operator bool() const; 96 virtual operator std::string() const; 97 virtual operator const char*() const; 98 98 99 99 using MultiTypePrimitive::setValue; 100 inline void setValue(const char* value) { this->type_ = MT_string; this->string_= std::string(value); }101 inline void setValue(const std::string& value) { this->type_ = MT_string; this->string_= value; }100 inline void setValue(const char* value) { this->type_ = MT_string; this->string_ = std::string(value); } 101 inline void setValue(const std::string& value) { this->type_ = MT_string; this->string_ = value; } 102 102 void setValue(const MultiTypeString& mts); 103 103 104 inline std::string getString() 105 inline const char* getConstChar() 104 inline std::string getString() const { return this->string_; } 105 inline const char* getConstChar() const { return this->string_.c_str(); } 106 106 107 inline std::string& getString() 108 inline const char* getConstChar() 107 inline std::string& getString() { return this->string_; } 108 inline const char* getConstChar() { return this->string_.c_str(); } 109 109 110 110 using MultiTypePrimitive::getValue; 111 inline void getValue(std::string* 112 inline void getValue(const char** 111 inline void getValue(std::string* variable) const { (*variable) = this->string_; } 112 inline void getValue(const char** variable) const { (*variable) = this->string_.c_str(); } 113 113 114 114 virtual std::string getTypename() const;
Note: See TracChangeset
for help on using the changeset viewer.