Changeset 2278 for code/branches/buildsystem/src/core
- Timestamp:
- Nov 26, 2008, 5:35:16 PM (16 years ago)
- Location:
- code/branches/buildsystem/src/core
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem/src/core/ConfigFileManager.cc
r1795 r2278 255 255 if (!isEmpty(temp) && !isComment(temp)) 256 256 { 257 unsigned int pos1 = temp.find('[');257 size_t pos1 = temp.find('['); 258 258 if (pos1 == 0) pos1 = line.find('['); else pos1 = std::string::npos; 259 unsigned int pos2 = line.find(']');259 size_t pos2 = line.find(']'); 260 260 261 261 if (pos1 != std::string::npos && pos2 != std::string::npos && pos2 > pos1 + 1) … … 282 282 else 283 283 { 284 unsigned int pos1 = line.find('=');284 size_t pos1 = line.find('='); 285 285 286 286 if (pos1 != std::string::npos && pos1 > 0) 287 287 { 288 288 // New entry 289 unsigned int pos2 = line.find('[');290 unsigned int pos3 = line.find(']');291 unsigned int commentposition = getNextCommentPosition(line, pos1 + 1);289 size_t pos2 = line.find('['); 290 size_t pos3 = line.find(']'); 291 size_t commentposition = getNextCommentPosition(line, pos1 + 1); 292 292 while (isBetweenQuotes(line, commentposition)) 293 293 { -
code/branches/buildsystem/src/core/Executor.h
r1786 r2278 177 177 inline FunctionType getType() const 178 178 { return this->functor_->getType(); } 179 inline MultiTypegetReturnvalue() const179 inline const MultiType& getReturnvalue() const 180 180 { return this->functor_->getReturnvalue(); } 181 inline std::stringgetTypenameParam(unsigned int param) const181 inline const std::string& getTypenameParam(unsigned int param) const 182 182 { return this->functor_->getTypenameParam(param); } 183 inline std::stringgetTypenameReturnvalue() const183 inline const std::string& getTypenameReturnvalue() const 184 184 { return this->functor_->getTypenameReturnvalue(); } 185 185 -
code/branches/buildsystem/src/core/Functor.h
r1786 r2278 34 34 35 35 #include "util/MultiType.h" 36 #include "util/String.h" 36 37 #include "util/Debug.h" 37 38 … … 103 104 inline bool hasReturnvalue() const { return this->hasReturnValue_; } 104 105 inline FunctionType getType() const { return this->type_; } 105 inline MultiTypegetReturnvalue() const { return this->returnedValue_; }106 107 std::string getTypenameParam(unsigned int param) const { return (param >= 0 && param < 5) ? this->typeParam_[param] : ""; }108 std::stringgetTypenameReturnvalue() const { return this->typeReturnvalue_; }106 inline const MultiType& getReturnvalue() const { return this->returnedValue_; } 107 108 const std::string& getTypenameParam(unsigned int param) const { return (param < 5) ? this->typeParam_[param] : blankString; } 109 const std::string& getTypenameReturnvalue() const { return this->typeReturnvalue_; } 109 110 110 111 virtual void evaluateParam(unsigned int index, MultiType& param) const = 0; -
code/branches/buildsystem/src/core/Namespace.cc
r1854 r2278 63 63 64 64 std::string name = this->getName(); 65 unsigned int pos = 0;65 size_t pos = 0; 66 66 while ((pos = name.find(',')) != std::string::npos) 67 67 name.replace(pos, 1, " "); -
code/branches/buildsystem/src/core/NamespaceNode.cc
r1747 r2278 56 56 else 57 57 { 58 unsigned int pos = name.find("::");58 size_t pos = name.find("::"); 59 59 std::string firstPart = name; 60 60 std::string secondPart; -
code/branches/buildsystem/src/core/Script.cc
r2239 r2278 134 134 } 135 135 136 unsigned int Script::getNextQuote(const std::string& text, unsigned int start)137 {138 unsigned int quote = start - 1;139 140 while ((quote = text.find('\"', quote + 1)) != std::string::npos)141 {142 unsigned int backslash = quote;143 unsigned int numbackslashes = 0;144 for (; backslash > 0; backslash--, numbackslashes++)145 if (text[backslash - 1] != '\\')146 break;147 148 if (numbackslashes % 2 == 0)149 break;150 }151 152 return quote;153 }154 155 136 std::string Script::replaceLuaTags(const std::string& text) 156 137 { 157 138 // chreate map with all Lua tags 158 std::map< unsigned int, bool> luaTags;159 { 160 unsigned int pos = 0;139 std::map<size_t, bool> luaTags; 140 { 141 size_t pos = 0; 161 142 while ((pos = text.find("<?lua", pos)) != std::string::npos) 162 143 luaTags[pos++] = true; 163 144 } 164 145 { 165 unsigned int pos = 0;146 size_t pos = 0; 166 147 while ((pos = text.find("?>", pos)) != std::string::npos) 167 148 luaTags[pos++] = false; … … 170 151 // erase all tags from the map that are between two quotes 171 152 { 172 std::map< unsigned int, bool>::iterator it = luaTags.begin();173 std::map< unsigned int, bool>::iterator it2 = it;153 std::map<size_t, bool>::iterator it = luaTags.begin(); 154 std::map<size_t, bool>::iterator it2 = it; 174 155 bool bBetweenQuotes = false; 175 unsigned int pos = 0;156 size_t pos = 0; 176 157 while ((pos = getNextQuote(text, pos)) != std::string::npos) 177 158 { … … 196 177 { 197 178 bool expectedValue = true; 198 for (std::map< unsigned int, bool>::iterator it = luaTags.begin(); it != luaTags.end(); ++it)179 for (std::map<size_t, bool>::iterator it = luaTags.begin(); it != luaTags.end(); ++it) 199 180 { 200 181 if (it->second == expectedValue) … … 215 196 std::string output; 216 197 { 217 std::map< unsigned int, bool>::iterator it = luaTags.begin();198 std::map<size_t, bool>::iterator it = luaTags.begin(); 218 199 bool bInPrintFunction = true; 219 unsigned int start = 0;220 unsigned int end = 0;200 size_t start = 0; 201 size_t end = 0; 221 202 222 203 do … … 234 215 std::string temp = text.substr(start, end - start); 235 216 { 236 unsigned int pos = 0;217 size_t pos = 0; 237 218 while ((pos = temp.find('[', pos)) != std::string::npos) 238 219 { 239 220 unsigned int tempCounter = 1; 240 unsigned int tempPos = pos++;221 size_t tempPos = pos++; 241 222 while(temp[++tempPos] == '=') { 242 223 tempCounter++; … … 253 234 } 254 235 { 255 unsigned int pos = 0;236 size_t pos = 0; 256 237 while ((pos = temp.find(']', pos)) != std::string::npos) 257 238 { 258 239 unsigned int tempCounter = 1; 259 unsigned int tempPos = pos++;240 size_t tempPos = pos++; 260 241 while(temp[++tempPos] == '=') { 261 242 tempCounter++; -
code/branches/buildsystem/src/core/Script.h
r2234 r2278 75 75 inline void clearLuaOutput() { output_ = ""; } 76 76 77 unsigned int getNextQuote(const std::string& text, unsigned int start);78 77 std::string replaceLuaTags(const std::string& text); 79 78 -
code/branches/buildsystem/src/core/XMLPort.h
r1856 r2278 83 83 */ 84 84 #define XMLPortParamTemplate(classname, paramname, loadfunction, savefunction, xmlelement, mode, ...) \ 85 XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, classname, this, paramname, orxonox::createExecutor(orxonox::createFunctor< __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode)85 XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, classname, this, paramname, orxonox::createExecutor(orxonox::createFunctor<classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode) 86 86 87 87 // -------------------- … … 105 105 */ 106 106 #define XMLPortParamLoadOnlyTemplate(classname, paramname, loadfunction, xmlelement, mode, ...) \ 107 XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, classname, this, paramname, orxonox::createExecutor(orxonox::createFunctor< __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), 0, xmlelement, mode)107 XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, classname, this, paramname, orxonox::createExecutor(orxonox::createFunctor<classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), 0, xmlelement, mode) 108 108 109 109 // ------------------ … … 135 135 */ 136 136 #define XMLPortParamExternTemplate(classname, externclass, object, paramname, loadfunction, savefunction, xmlelement, mode, ...) \ 137 XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, externclass, object, paramname, orxonox::createExecutor(orxonox::createFunctor< __VA_ARGS__ >(&externclass::loadfunction), std::string( #externclass ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&externclass::savefunction), std::string( #externclass ) + "::" + #savefunction), xmlelement, mode);137 XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, externclass, object, paramname, orxonox::createExecutor(orxonox::createFunctor<externclass, __VA_ARGS__ >(&externclass::loadfunction), std::string( #externclass ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&externclass::savefunction), std::string( #externclass ) + "::" + #savefunction), xmlelement, mode); 138 138 139 139 // -------------------
Note: See TracChangeset
for help on using the changeset viewer.