Orxonox  0.0.5 Codename: Arcturus
Static Public Member Functions | Private Member Functions | List of all members
orxonox::Resource Class Reference

Provides simple functions to easily access the Ogre::ResourceGroupManager. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/Resource.h>

Static Public Member Functions

static bool exists (const std::string &name)
 Find out if the named file exists. More...
 
static StringVectorPtr findResourceNames (const std::string &pattern)
 Retrieves a list with all resources matching a certain pattern. More...
 
static const std::string & getDefaultResourceGroup ()
 Name of the default resource group (usually "General") More...
 
static std::shared_ptr< ResourceInfogetInfo (const std::string &name)
 Get struct with information about path and size. More...
 
static DataStreamPtr open (const std::string &name)
 Open a single resource by name and return a DataStream pointing at the source of the data. More...
 
static DataStreamPtr open (std::shared_ptr< ResourceInfo > fileInfo)
 Similar to open(string, string, bool), but with a fileInfo struct. More...
 
static DataStreamListPtr openMulti (const std::string &pattern)
 Open all resources matching a given pattern (which can contain the character '*' as a wildcard), and return a collection of DataStream objects on them. More...
 

Private Member Functions

 Resource ()=delete
 
 Resource (const Resource &)=delete
 
 ~Resource ()=delete
 
Resourceoperator= (const Resource &)=delete
 

Detailed Description

Provides simple functions to easily access the Ogre::ResourceGroupManager.

The wrapper functions also avoid having to deal with resource groups.

Constructor & Destructor Documentation

orxonox::Resource::Resource ( )
privatedelete
orxonox::Resource::Resource ( const Resource )
privatedelete
orxonox::Resource::~Resource ( )
privatedelete

Member Function Documentation

bool orxonox::Resource::exists ( const std::string &  name)
static

Find out if the named file exists.

Parameters
nameFully qualified name of the file to test for
StringVectorPtr orxonox::Resource::findResourceNames ( const std::string &  pattern)
static

Retrieves a list with all resources matching a certain pattern.

Parameters
patternThe pattern to look for. If resource locations have been added recursively, subdirectories will be searched too so this does not need to be fully qualified.
const std::string & orxonox::Resource::getDefaultResourceGroup ( )
static

Name of the default resource group (usually "General")

std::shared_ptr< ResourceInfo > orxonox::Resource::getInfo ( const std::string &  name)
static

Get struct with information about path and size.

Parameters
nameFully qualified name of the file to test for
DataStreamPtr orxonox::Resource::open ( const std::string &  name)
static

Open a single resource by name and return a DataStream pointing at the source of the data.

Parameters
nameThe name of the resource to locate. Even if resource locations are added recursively, you must provide a fully qualified name to this method.
Returns
Shared pointer to data stream containing the data. Will be destroyed automatically when no longer referenced.
static DataStreamPtr orxonox::Resource::open ( std::shared_ptr< ResourceInfo fileInfo)
inlinestatic

Similar to open(string, string, bool), but with a fileInfo struct.

DataStreamListPtr orxonox::Resource::openMulti ( const std::string &  pattern)
static

Open all resources matching a given pattern (which can contain the character '*' as a wildcard), and return a collection of DataStream objects on them.

Parameters
patternThe pattern to look for. If resource locations have been added recursively, subdirectories will be searched too so this does not need to be fully qualified.
Returns
Shared pointer to a data stream list , will be destroyed automatically when no longer referenced
Resource& orxonox::Resource::operator= ( const Resource )
privatedelete

The documentation for this class was generated from the following files: