Sirikata
|
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. |
Utilities for getting information about paths, such as the executable file, executable directory, current directory, etc.
enum Sirikata::Path::Key |
String Sirikata::Path::Get | ( | Key | key | ) |
References DIR_CURRENT, DIR_EXE, DIR_EXE_BUNDLE, DIR_SYSTEM_CONFIG, DIR_TEMP, DIR_USER, DIR_USER_HIDDEN, Sirikata::Logging::fatal, FILE_EXE, MAX_PATH, RESOURCE, and SILOG.
Referenced by Sirikata::JS::JSObjectScript::absoluteImport(), Sirikata::Models::ColladaSystem::convertVisual(), Sirikata::JS::CreateJSResult(), Sirikata::JS::CreateJSResult_Vec3Impl(), Sirikata::Transfer::DiskCacheLayer::DiskCacheLayer(), Get(), Sirikata::Transfer::OAuthHttpManager::get(), Sirikata::Graphics::OgreRenderer::initialize(), Sirikata::DynamicLibrary::Initialize(), Sirikata::JS::JSObjectScript::internalEval(), Sirikata::Graphics::OgreRenderer::loadBuiltinPlugins(), and SubstitutePlaceholders().
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 | ||
) |
References DIR_EXE_BUNDLE, Sirikata::Logging::fatal, Get(), RESOURCE, and SILOG.
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 | ||
) |
References DIR_CURRENT.
Referenced by Sirikata::JS::JSPresenceStruct::getAllData().
String Sirikata::Path::SubstitutePlaceholders | ( | const String & | path | ) |
Substitute full values for placeholders in the given path.
References Sirikata::Path::Placeholders::All, Get(), and RESOURCE.
Referenced by Sirikata::JS::JSObjectScript::debug_fileRead(), Sirikata::JS::JSObjectScript::debug_fileWrite(), Sirikata::JS::JSObjectScript::pushEvalContextScopeDirectory(), and Sirikata::JS::JSObjectScript::resolveImport().