Changeset 8225 for code/branches/kicklib/src/libraries/core
- Timestamp:
- Apr 10, 2011, 9:03:59 PM (14 years ago)
- Location:
- code/branches/kicklib/src/libraries/core
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib/src/libraries/core/CorePrereqs.h
r8071 r8225 261 261 namespace boost 262 262 { 263 #if BOOST_VERSION < 104400 263 #if (BOOST_VERSION < 104400) 264 264 265 namespace filesystem 265 266 { … … 268 269 typedef basic_path<std::string, path_traits> path; 269 270 } 270 #elif BOOST_VERSION < 104600 271 272 #elif (BOOST_VERSION < 104800) 273 274 # if BOOST_FILESYSTEM_VERSION == 2 271 275 namespace filesystem2 272 276 { … … 281 285 using filesystem2::path; 282 286 } 283 # else287 # elif BOOST_FILESYSTEM_VERSION == 3 284 288 namespace filesystem3 285 289 { … … 290 294 using filesystem3::path; 291 295 } 296 # endif 297 298 #elif 299 300 // TODO: Check this once boost 1.48 is released 301 namespace filesystem 302 { 303 class path; 304 } 305 292 306 #endif 307 293 308 class thread; 294 309 class mutex; -
code/branches/kicklib/src/libraries/core/GraphicsManager.cc
r8129 r8225 61 61 #include "command/ConsoleCommand.h" 62 62 63 // Differentiate Boost Filesystem v2 and v3 64 #if (BOOST_FILESYSTEM_VERSION < 3) 65 # define BF_NATIVE_STRING file_string 66 #else 67 # define BF_NATIVE_STRING string 68 #endif 69 63 70 namespace orxonox 64 71 { … … 243 250 // Use backslash paths on Windows! file_string() already does that though. 244 251 for (unsigned int i = 0; i < plugins.size(); ++i) 245 #if BOOST_FILESYSTEM_VERSION < 3 246 ogreRoot_->loadPlugin((folder / plugins[i]).file_string()); 247 #else 248 ogreRoot_->loadPlugin((folder / plugins[i]).string()); 249 #endif 252 ogreRoot_->loadPlugin((folder / plugins[i]).BF_NATIVE_STRING()); 250 253 } 251 254 -
code/branches/kicklib/src/libraries/core/PathConfig.cc
r8089 r8225 33 33 #include <cstdio> 34 34 #include <vector> 35 #include <boost/version.hpp>36 35 #include <boost/filesystem.hpp> 37 36 … … 56 55 #include "CommandLineParser.h" 57 56 58 // Boost 1.36 has some issues with deprecated functions that have been omitted59 #if (BOOST_ VERSION == 103600)60 # define B OOST_LEAF_FUNCTION filename61 # elif (BOOST_FILESYSTEM_VERSION < 3)62 # define B OOST_LEAF_FUNCTION leaf57 // Differentiate Boost Filesystem v2 and v3 58 #if (BOOST_FILESYSTEM_VERSION < 3) 59 # define BF_LEAF leaf 60 # define BF_GENERIC_STRING string 61 # define BF_NATIVE_STRING file_string 63 62 #else 64 # define BOOST_LEAF_FUNCTION path().filename().string 63 # define BF_LEAF path().filename().string 64 # define BF_GENERIC_STRING generic_string 65 # define BF_NATIVE_STRING string 65 66 #endif 66 67 … … 242 243 { 243 244 ThrowException(General, std::string("The ") + it->second + " directory has been preoccupied by a file! \ 244 Please remove " + it->first. string());245 Please remove " + it->first.BF_GENERIC_STRING()); 245 246 } 246 247 if (bf::create_directories(it->first)) // function may not return true at all (bug?) … … 261 262 // Add that path to the PATH variable in case a module depends on another one 262 263 std::string pathVariable(getenv("PATH")); 263 putenv(const_cast<char*>(("PATH=" + pathVariable + ';' + modulePath_. string()).c_str()));264 putenv(const_cast<char*>(("PATH=" + pathVariable + ';' + modulePath_.BF_NATIVE_STRING()).c_str())); 264 265 265 266 // Make sure the path exists, otherwise don't load modules … … 273 274 while (file != end) 274 275 { 275 std::string filename = file->B OOST_LEAF_FUNCTION();276 std::string filename = file->BF_LEAF(); 276 277 277 278 // Check if the file ends with the extension in question … … 282 283 // We've found a helper file 283 284 const std::string& library = filename.substr(0, filename.size() - moduleextensionlength); 284 #if BOOST_FILESYSTEM_VERSION < 3 285 modulePaths.push_back((modulePath_ / library).file_string()); 286 #else 287 modulePaths.push_back((modulePath_ / library).string()); 288 #endif 285 modulePaths.push_back((modulePath_ / library).BF_NATIVE_STRING()); 289 286 } 290 287 } … … 297 294 /*static*/ std::string PathConfig::getRootPathString() 298 295 { 299 return getInstance().rootPath_. string() + '/';296 return getInstance().rootPath_.BF_GENERIC_STRING() + '/'; 300 297 } 301 298 302 299 /*static*/ std::string PathConfig::getExecutablePathString() 303 300 { 304 return getInstance().executablePath_. string() + '/';301 return getInstance().executablePath_.BF_GENERIC_STRING() + '/'; 305 302 } 306 303 307 304 /*static*/ std::string PathConfig::getDataPathString() 308 305 { 309 return getInstance().dataPath_. string() + '/';306 return getInstance().dataPath_.BF_GENERIC_STRING() + '/'; 310 307 } 311 308 312 309 /*static*/ std::string PathConfig::getExternalDataPathString() 313 310 { 314 return getInstance().externalDataPath_. string() + '/';311 return getInstance().externalDataPath_.BF_GENERIC_STRING() + '/'; 315 312 } 316 313 317 314 /*static*/ std::string PathConfig::getConfigPathString() 318 315 { 319 return getInstance().configPath_. string() + '/';316 return getInstance().configPath_.BF_GENERIC_STRING() + '/'; 320 317 } 321 318 322 319 /*static*/ std::string PathConfig::getLogPathString() 323 320 { 324 return getInstance().logPath_. string() + '/';321 return getInstance().logPath_.BF_GENERIC_STRING() + '/'; 325 322 } 326 323 327 324 /*static*/ std::string PathConfig::getModulePathString() 328 325 { 329 return getInstance().modulePath_. string() + '/';326 return getInstance().modulePath_.BF_GENERIC_STRING() + '/'; 330 327 } 331 328 } -
code/branches/kicklib/src/libraries/core/Resource.cc
r8081 r8225 33 33 #include <OgreFileSystem.h> 34 34 #include <OgreResourceGroupManager.h> 35 36 // Differentiate Boost Filesystem v2 and v3 37 #if (BOOST_FILESYSTEM_VERSION < 3) 38 # define BF_GENERIC_STRING string 39 #else 40 # define BF_GENERIC_STRING generic_string 41 #endif 35 42 36 43 namespace orxonox … … 98 105 boost::filesystem::path base(it->archive->getName()); 99 106 base /= it->filename; 100 ptr->fileSystemPath = base. string();107 ptr->fileSystemPath = base.BF_GENERIC_STRING(); 101 108 } 102 109 return ptr; -
code/branches/kicklib/src/libraries/core/command/ArgumentCompletionFunctions.cc
r8066 r8225 35 35 36 36 #include <map> 37 #include <boost/version.hpp>38 37 #include <boost/filesystem.hpp> 39 38 … … 47 46 #include "TclThreadManager.h" 48 47 49 // Boost 1.36 has some issues with deprecated functions that have been omitted 50 #if (BOOST_VERSION == 103600) 51 # define BOOST_LEAF_FUNCTION filename 52 # define BOOST_DICTIONARY_ENTRY_NAME string 53 #elif (BOOST_FILESYSTEM_VERSION < 3) 54 # define BOOST_LEAF_FUNCTION leaf 55 # define BOOST_DICTIONARY_ENTRY_NAME string 48 // Differentiate Boost Filesystem v2 and v3 49 #if (BOOST_FILESYSTEM_VERSION < 3) 50 # define BF_LEAF leaf 51 # define BF_GENERIC_STRING string 52 # define BF_DICTIONARY_ENTRY_NAME string 56 53 #else 57 # define BOOST_LEAF_FUNCTION path().filename().string 58 # define BOOST_DICTIONARY_ENTRY_NAME path().string 54 # define BF_LEAF path().filename().string 55 # define BF_GENERIC_STRING generic_string 56 # define BF_DICTIONARY_ENTRY_NAME path().string 59 57 #endif 60 58 … … 250 248 else 251 249 { 252 const std::string& dir = startdirectory. string();250 const std::string& dir = startdirectory.BF_GENERIC_STRING(); 253 251 if (dir.size() > 0 && dir[dir.size() - 1] == ':') 254 252 startdirectory = dir + '/'; … … 262 260 { 263 261 if (boost::filesystem::is_directory(*file)) 264 dirlist.push_back(ArgumentCompletionListElement(file->B OOST_DICTIONARY_ENTRY_NAME() + '/', getLowercase(file->BOOST_DICTIONARY_ENTRY_NAME()) + '/', file->BOOST_LEAF_FUNCTION() + '/'));262 dirlist.push_back(ArgumentCompletionListElement(file->BF_DICTIONARY_ENTRY_NAME() + '/', getLowercase(file->BF_DICTIONARY_ENTRY_NAME()) + '/', file->BF_LEAF() + '/')); 265 263 else 266 filelist.push_back(ArgumentCompletionListElement(file->B OOST_DICTIONARY_ENTRY_NAME(), getLowercase(file->BOOST_DICTIONARY_ENTRY_NAME()), file->BOOST_LEAF_FUNCTION()));264 filelist.push_back(ArgumentCompletionListElement(file->BF_DICTIONARY_ENTRY_NAME(), getLowercase(file->BF_DICTIONARY_ENTRY_NAME()), file->BF_LEAF())); 267 265 ++file; 268 266 }
Note: See TracChangeset
for help on using the changeset viewer.