AndroMeta  2.0.0
Static Public Member Functions
Meta::MSys Class Reference

A platform independent and easy-to-use system interface. More...

#include <MSys.h>

List of all members.

Static Public Member Functions

static mvar sysInfo ()
static mstr hostname ()
static mstr joinPath (const mstr &path, const mstr &ext)
static mstr basename (const mstr &path)
static mstr parentDirectory (const mstr &path)
static bool makeDir (const mstr &path)
static mstr tempPath ()
static mstr tempFilePath (const mstr &extension="")
static long processId ()
static bool exists (const mstr &path)
static double cpuBenchmark1 ()
static mstr currentDir ()
static bool getEnv (const mstr &key, mstr &value)
static bool setEnv (const mstr &key, const mstr &value, bool redef=true)
static void setTimeZone (const mstr &zone)
static mstr hiddenInput ()
static bool rename (const mstr &sourcePath, const mstr &destPath)
static mstr fileExtension (const mstr &filePath)
static mstr normalizePath (const mstr &path)
static mstr stripPath (const mstr &path)

Detailed Description

A platform independent and easy-to-use system interface.


Member Function Documentation

static mstr Meta::MSys::basename ( const mstr path) [static]
Returns:
The basename of path.
static double Meta::MSys::cpuBenchmark1 ( ) [static]

Run a CPU-intensive benchmark.

Returns:
A benchmark of CPU performance with higher values being better.
static mstr Meta::MSys::currentDir ( ) [static]
Returns:
The path to the current working directory.
static bool Meta::MSys::exists ( const mstr path) [static]
Returns:
true if the file referred to by path exists.
static mstr Meta::MSys::fileExtension ( const mstr filePath) [static]

Extract the filename extension from a path.

Returns:
Empty string if no extension found.
static bool Meta::MSys::getEnv ( const mstr key,
mstr value 
) [static]

Get an environment variable's value.

Parameters:
keyThe environment variable name.
valueOn output, the value the environment variable holds.
Returns:
false on failure, i.e: environment variable does not exist.
static mstr Meta::MSys::hiddenInput ( ) [static]

Useful for reading password from the terminal.

Returns:
A line read from stdin with output supressed.
static mstr Meta::MSys::hostname ( ) [static]
Returns:
The hostname of this machine.
static mstr Meta::MSys::joinPath ( const mstr path,
const mstr ext 
) [static]
Returns:
The joined path of path and ext.
static bool Meta::MSys::makeDir ( const mstr path) [static]

Make a directory path.

Returns:
true on success.
static mstr Meta::MSys::normalizePath ( const mstr path) [static]
Returns:
path normalized such that it can be used in a shell command.
static mstr Meta::MSys::parentDirectory ( const mstr path) [static]
Returns:
The parent directory of the specified path or the empty string if no parent directory.
static long Meta::MSys::processId ( ) [static]
Returns:
The caller's process id.
static bool Meta::MSys::rename ( const mstr sourcePath,
const mstr destPath 
) [static]

Rename/move sourcePath to destPath.

Returns:
true on success.
static bool Meta::MSys::setEnv ( const mstr key,
const mstr value,
bool  redef = true 
) [static]

Set an environment variable's value.

Parameters:
keyThe environment variable name.
valueThe value to assign the environment variable to.
redeftrue if value is to be redefined if environment variable already exists.
Returns:
false on failure, i.e: environment variable exists and redef was false.
static void Meta::MSys::setTimeZone ( const mstr zone) [static]

Set the time zone that the current process uses.

Parameters:
zoneA valid UNIX TZ environment variable specification.
static mstr Meta::MSys::stripPath ( const mstr path) [static]
Returns:
path stripped of trailing '/' characters
static mvar Meta::MSys::sysInfo ( ) [static]
Returns:
System information as it is available to a specific platform.
static mstr Meta::MSys::tempFilePath ( const mstr extension = "") [static]
Parameters:
extensionFilename extension, .e.g: "txt"
Returns:
A path to a unique temporary name. The file is not actually created by this call.
static mstr Meta::MSys::tempPath ( ) [static]
Returns:
The temporary file path.

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