![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/sys/System.h>
Public Types | |
typedef int | access_t |
Static Public Member Functions | |
static Pair< SystemInStream *, SystemOutStream * > | pipe (void) |
static unsigned int | random (unsigned int top) |
static io::OutStream * | createFile (const Path &path) |
static io::OutStream * | appendFile (const Path &path) |
static io::InStream * | readFile (const Path &path) |
static io::RandomAccessStream * | openRandomFile (const Path &path, access_t access=READ) |
static io::RandomAccessStream * | createRandomFile (const Path &path, access_t access=READ) |
static Path | getUnitPath (void *address) |
static cstring | getEnv (cstring key) |
static bool | hasEnv (cstring key) |
static string | getLibraryFileName (const string &name) |
static string | getPluginFileName (const string &name) |
static void | makeDir (const sys::Path &path) |
static void | makeDirs (const sys::Path &path) |
static void | removeDir (const sys::Path &path) |
static void | removeFile (const Path &path) |
static void | remove (const Path &path) |
static sys::Path | getTempFile (void) |
static sys::Path | getTempDir (void) |
static int | coreCount (void) |
static void | exit (int code=0) |
static Path::DirReader | contentOf (const sys::Path &dir) |
Static Public Attributes | |
static const int | READ = 1 |
static const int | WRITE = 2 |
static const int | READ_WRITE = READ | WRITE |
static cstring | library_prefix = "lib" |
static cstring | library_suffix |
static cstring | exec_suffix |
Non-instatiable object giving access to system facilities.
typedef int access_t |
|
static |
Open a file for appending write. The opened file must be fried by the caller (causing the closure).
path | Path of the file to open. |
SystemException | Thrown if there is an error. |
References Path::asSysString().
Referenced by Path::append().
|
static |
|
static |
|
static |
Create a new file and open it to write. The created file must be fried by the caller (causing the file closure).
path | Path of the file to open. |
SystemException | Thrown if there is an error. |
References Path::asSysString().
Referenced by Saver::Saver(), and Path::write().
|
static |
Create a random access stream from a file, removing it if it already exists.
path | Path of the file to open. |
access | Type of access (one of READ, WRITE, READ_WRITE). |
IOException | Thrown if there is an error. |
References elm::_, Path::asSysString(), and System::READ.
Referenced by RandomAccessStream::createFile().
|
static |
Get the path of the object item (library, program) containing the symbol whose address is given.
address | Address of the looked symbol. |
References Path::canonical(), and elm::mod().
Referenced by Path::makeDir(), and Path::temp().
Referenced by Path::makeDirs().
|
static |
Open a random access stream from a file.
path | Path of the file to open. |
access | Type of access (one of READ, WRITE, READ_WRITE). |
IOException | Thrown if there is an error. |
References elm::_, and Path::asSysString().
Referenced by RandomAccessStream::openFile().
|
static |
Create a pipe with input / output end streams.
System | exception. |
References elm::win::getErrorMessage(), and elm::pair().
|
static |
Generate an integer random number in interval [0, top[.
top | Maximum exclusive value. |
|
static |
Open a file for reading. The opened file must be fried by the caller (causing the closure).
path | Path of the file to open. |
SystemException | Thrown if there is an error. |
References Path::asSysString().
Referenced by File::load(), Parser::parse(), Plugger::plugFile(), and Path::read().
Referenced by Path::remove().
|
static |
|
static |
Prefix of the dynamic libraries of the current OS.
|
static |
|
static |
Referenced by System::createRandomFile().
|
static |