Various convenient helpers are defined here. More...
Typedefs | |
typedef ::SDL_RWops | DataStream |
A DataStream is a way of writing and/or reading for an opaque data storage, which can be actually a file, a buffer in memory, or anything else. | |
Functions | |
OSDL_DLL const std::string | getBackendLastError () |
Returns a description of the main back-end related internal error. | |
OSDL_DLL Ceylan::Latin1Char | getNativeDirectorySeparator () |
OSDL_DLL std::string | getProgramPath () |
Returns the path where the program resides. | |
OSDL_DLL std::string | getUserDirectory () |
Returns the path where the user's home directory resides. | |
OSDL_DLL DataStream & | createDataStreamFrom (Ceylan::System::File &sourceFile) |
Returns a DataStream corresponding to specific file object, which can be of any sort (ex: standard file, embedded file, etc. | |
OSDL_DLL void | deleteDataStream (DataStream &datastream) |
Deletes specified datastream. |
Various convenient helpers are defined here.
typedef ::SDL_RWops OSDL::Utils::DataStream |
A DataStream is a way of writing and/or reading for an opaque data storage, which can be actually a file, a buffer in memory, or anything else.
DataStream abstracts back-end specific SDL_RWops.
Definition at line 142 of file OSDLUtils.h.
OSDL::Utils::DataStream & OSDL::Utils::createDataStreamFrom | ( | Ceylan::System::File & | sourceFile | ) |
Returns a DataStream corresponding to specific file object, which can be of any sort (ex: standard file, embedded file, etc.
).
sourceFile | the file from which the DataStream will be created. |
OSDL::Exception | if the operation failed. |
Definition at line 418 of file OSDLUtils.cc.
References closeCallback(), readCallback(), seekCallback(), and writeCallback().
Referenced by OSDL::Video::TwoDimensional::Text::TrueTypeFont::load(), OSDL::Audio::Sound::load(), OSDL::Audio::Music::load(), OSDL::Video::TwoDimensional::Image::Load(), OSDL::Video::TwoDimensional::Image::LoadBMP(), OSDL::Video::TwoDimensional::Image::LoadGIF(), OSDL::Video::TwoDimensional::Image::LoadJPG(), OSDL::Video::TwoDimensional::Image::LoadLBM(), OSDL::Video::TwoDimensional::Image::LoadPCX(), OSDL::Video::TwoDimensional::Image::LoadPNG(), OSDL::Video::TwoDimensional::Image::LoadPNM(), OSDL::Video::TwoDimensional::Image::LoadTGA(), and OSDL::Video::TwoDimensional::Image::LoadXPM().
void OSDL::Utils::deleteDataStream | ( | DataStream & | datastream | ) |
Deletes specified datastream.
OSDL::Exception | if the operation failed. |
Definition at line 459 of file OSDLUtils.cc.
const string OSDL::Utils::getBackendLastError | ( | ) |
Returns a description of the main back-end related internal error.
Definition at line 69 of file OSDLUtils.cc.
Referenced by OSDL::Audio::AudioModule::AudioModule(), OSDL::Video::TwoDimensional::Text::FixedFont::basicBlitLatin1Glyph(), OSDL::Video::Overlay::blit(), OSDL::Video::Surface::blitTo(), OSDL::CDROMDriveHandler::CDROMDriveHandler(), OSDL::Video::Surface::clone(), OSDL::CDROMDrive::eject(), OSDL::Video::Pixels::getGammaRamp(), OSDL::Video::OpenGL::OpenGLContext::GetGLAttribute(), OSDL::Events::JoystickHandler::JoystickHandler(), OSDL::Video::TwoDimensional::Image::Load(), OSDL::Video::TwoDimensional::Image::LoadBMP(), OSDL::Video::TwoDimensional::Image::LoadGIF(), OSDL::Video::TwoDimensional::Image::LoadJPG(), OSDL::Video::TwoDimensional::Image::LoadLBM(), OSDL::Video::TwoDimensional::Image::LoadPCX(), OSDL::Video::TwoDimensional::Image::LoadPNG(), OSDL::Video::TwoDimensional::Image::LoadPNM(), OSDL::Video::TwoDimensional::Image::LoadTGA(), OSDL::Video::TwoDimensional::Image::LoadXPM(), OSDL::Video::TwoDimensional::MouseCursor::MouseCursor(), OSDL::CDROMDrive::open(), OSDL::CDROMDrive::pause(), OSDL::CDROMDrive::playFrames(), OSDL::CDROMDrive::playTracks(), OSDL::Video::Surface::resize(), OSDL::CDROMDrive::resume(), OSDL::Video::Surface::saveBMP(), OSDL::Video::TwoDimensional::Image::SaveBMP(), OSDL::Video::Pixels::setGamma(), OSDL::Video::Pixels::setGammaRamp(), OSDL::Video::OpenGL::OpenGLContext::SetGLAttribute(), OSDL::Video::VideoModule::setMode(), OSDL::Video::VideoModule::toggleFullscreen(), OSDL::Video::OpenGL::OpenGLContext::TrySettingGLAttribute(), OSDL::Video::Surface::update(), and OSDL::Video::VideoModule::VideoModule().
Ceylan::Latin1Char OSDL::Utils::getNativeDirectorySeparator | ( | ) |
Definition at line 87 of file OSDLUtils.cc.
std::string OSDL::Utils::getProgramPath | ( | ) |
Returns the path where the program resides.
This is the program base directory, i.e. the directory where it was run from, which is probably the installation directory, and may or may not be the process's current working directory.
OSDL::Exception | if the operation failed. |
Definition at line 127 of file OSDLUtils.cc.
References OSDL::EmbeddedFileSystemManager::SecureEmbeddedFileSystemManager().
std::string OSDL::Utils::getUserDirectory | ( | ) |
Returns the path where the user's home directory resides.
This is meant to be a suggestion of where a specific user of the system can store files. On Unix, this is her home directory. On systems with no concept of multiple home directories (MacOS, win95), this will default to something like: "C:\mybasedir\users\username", where "username" will either be the login name, or "default" if the platform does not support multiple users, either.
OSDL::Exception | if the operation failed. |
Definition at line 148 of file OSDLUtils.cc.
References OSDL::EmbeddedFileSystemManager::SecureEmbeddedFileSystemManager().