Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 22, 2006, 6:55:52 PM (18 years ago)
Author:
bensch
Message:

renaming for namespace-purposes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/util/loading/resource.cc

    r9787 r9788  
    1919#include "filesys/file.h"
    2020
    21 ObjectListDefinition(Resource);
     21ObjectListDefinition(NewResource);
    2222
    2323
    24 std::vector<Resource::Type*>    Resource::_resourceTypes;
     24std::vector<NewResource::Type*>    NewResource::_resourceTypes;
    2525
    2626//! GLOBALS
    27 Directory Resource::_mainGlobalPath;
    28 std::vector<Directory>        Resource::_globalPaths;
     27Directory NewResource::_mainGlobalPath;
     28std::vector<Directory>        NewResource::_globalPaths;
    2929
    3030
     
    3232 * standard constructor
    3333*/
    34 Resource::Resource (Resource::Type* type)
     34NewResource::NewResource (NewResource::Type* type)
    3535    : _pointer(NULL), _type(type)
    3636{
    37   this->registerObject(this, Resource::_objectList);
     37  this->registerObject(this, NewResource::_objectList);
    3838
    3939  if(this->_type->id() == -1)
    4040  {
    41     Resource::_resourceTypes.push_back(this->_type);
    42     this->_type->setID(Resource::_resourceTypes.size()-1);
     41    NewResource::_resourceTypes.push_back(this->_type);
     42    this->_type->setID(NewResource::_resourceTypes.size()-1);
    4343  }
    4444
     
    4848 * standard deconstructor
    4949 */
    50 Resource::~Resource ()
     50NewResource::~NewResource ()
    5151{
    5252  // delete what has to be deleted here
     
    5454
    5555
    56 std::string Resource::locateFile(const std::string& fileName)
     56std::string NewResource::locateFile(const std::string& fileName)
    5757{
    5858  if (File(fileName).exists())
    5959    return fileName;
    60   else if ((Resource::_mainGlobalPath+File(fileName)) . exists() )
    61     return (Resource::_mainGlobalPath + File(fileName)).name();
     60  else if ((NewResource::_mainGlobalPath+File(fileName)) . exists() )
     61    return (NewResource::_mainGlobalPath + File(fileName)).name();
    6262
    6363  return std::string("/home/bensch/svn/orxonox/data/") + fileName;
     
    6666
    6767
    68 Resource::Pointer* Resource::acquireResource(const std::string& loadString)
     68NewResource::Pointer* NewResource::acquireResource(const std::string& loadString)
    6969{
    70   //const Resource::Type* const type = Resource::_resourceTypes[this->_type->id()];
     70  //const NewResource::Type* const type = NewResource::_resourceTypes[this->_type->id()];
    7171
    7272  for (unsigned int i = 0; i < _type->storedResources().size(); ++i)
     
    7979}
    8080
    81 void Resource::setMainGlobalPath(const Directory& directory)
     81void NewResource::setMainGlobalPath(const Directory& directory)
    8282{
    83   Resource::_mainGlobalPath = directory;
    84   Resource::_mainGlobalPath.open();
     83  NewResource::_mainGlobalPath = directory;
     84  NewResource::_mainGlobalPath.open();
    8585}
    8686
    87 void Resource::addGlobalPath(const Directory& directory)
     87void NewResource::addGlobalPath(const Directory& directory)
    8888{
    89   std::vector<Directory>::const_iterator it = std::find(Resource::_globalPaths.begin(), Resource::_globalPaths.end(), directory);
    90   if (it == Resource::_globalPaths.end())
    91     Resource::_globalPaths.push_back(directory);
     89  std::vector<Directory>::const_iterator it = std::find(NewResource::_globalPaths.begin(), NewResource::_globalPaths.end(), directory);
     90  if (it == NewResource::_globalPaths.end())
     91    NewResource::_globalPaths.push_back(directory);
    9292}
    9393
    9494
    9595
    96 void Resource::addResource(Resource::Pointer* pointer)
     96void NewResource::addResource(NewResource::Pointer* pointer)
    9797{
    9898  this->_type->addResource(pointer);
     
    108108
    109109
    110 void Resource::KeepLevel::setKeepLevelName(unsigned int level, const std::string& name)
     110void NewResource::KeepLevel::setKeepLevelName(unsigned int level, const std::string& name)
    111111{
    112112  if (_keepLevelName.size() <= level)
     
    117117
    118118
    119 void Resource::Type::addResource(Resource::Pointer* resource)
     119void NewResource::Type::addResource(NewResource::Pointer* resource)
    120120{
    121121  this->_storedResources.push_back(resource);
     
    124124
    125125
    126 Resource::Pointer::Pointer(const std::string& loadString, const Resource::KeepLevel& keeplevel)
     126NewResource::Pointer::Pointer(const std::string& loadString, const NewResource::KeepLevel& keeplevel)
    127127  : _loadString(loadString), _keepLevel(keeplevel)
    128128{}
    129129
    130130
    131 void Resource::Type::setID(int id)
     131void NewResource::Type::setID(int id)
    132132{
    133133  this->_id = id;
Note: See TracChangeset for help on using the changeset viewer.