Sirikata
Namespaces | Enumerations | Functions
Sirikata::Path Namespace Reference

Utilities for getting information about paths, such as the executable file, executable directory, current directory, etc. More...

Namespaces

namespace  Placeholders
 

Path placeholders are strings that can be automatically substituted with standard locations, e.g.


Enumerations

enum  Key {
  PATH_START = 0, FILE_EXE, DIR_EXE, DIR_EXE_BUNDLE,
  DIR_CURRENT, DIR_USER, DIR_USER_HIDDEN, DIR_TEMP,
  DIR_SYSTEM_CONFIG, RESOURCE, PATH_END
}

Functions

SIRIKATA_FUNCTION_EXPORT String Get (Key key)
SIRIKATA_FUNCTION_EXPORT String Get (Key key, const String &relative_path)
SIRIKATA_FUNCTION_EXPORT bool Set (Key key, const String &path)
SIRIKATA_FUNCTION_EXPORT String Get (Key key, const String &relative_path, const String &alternate_base)
SIRIKATA_FUNCTION_EXPORT String SubstitutePlaceholders (const String &path)
 Substitute full values for placeholders in the given path.
SIRIKATA_FUNCTION_EXPORT String GetTempFilename (const String &prefix)
 Get temporary filename, i.e.

Detailed Description

Utilities for getting information about paths, such as the executable file, executable directory, current directory, etc.


Enumeration Type Documentation

Enumerator:
PATH_START 
FILE_EXE 
DIR_EXE 
DIR_EXE_BUNDLE 
DIR_CURRENT 
DIR_USER 
DIR_USER_HIDDEN 
DIR_TEMP 
DIR_SYSTEM_CONFIG 
RESOURCE 
PATH_END 

Function Documentation

String Sirikata::Path::Get ( Key  key)
String Sirikata::Path::Get ( Key  key,
const String &  relative_path 
)

References Get().

String Sirikata::Path::Get ( Key  key,
const String &  relative_path,
const String &  alternate_base 
)
String Sirikata::Path::GetTempFilename ( const String &  prefix)

Get temporary filename, i.e.

a file name with extra random characters to avoid conflicting files within a temporary directory.

NOTE: Be careful using this since it can't guarantee uniqueness, only make it unlikely. You generally should not leave prefix empty as this helps avoid conflicts.

References Sirikata::randInt().

Referenced by Sirikata::Models::ColladaSystem::convertVisual(), Sirikata::Graphics::OgreRenderer::initialize(), and Sirikata::JS::JSObjectScript::internalEval().

bool Sirikata::Path::Set ( Key  key,
const String &  path 
)
String Sirikata::Path::SubstitutePlaceholders ( const String &  path)