Free Electron
Static Public Member Functions | Static Private Attributes | List of all members
fe::System Class Reference

System call wrappers. More...

#include <System.h>

Static Public Member Functions

static void FE_CDECL printBannerOnce (void)
 Print a startup message only one time. More...
 
static bool FE_CDECL getEnvironmentVariable (const String &name, String &value)
 Get an environment variable. More...
 
static bool FE_CDECL getHomePath (String &value)
 Get the active user's home directory. More...
 
static String FE_CDECL getVerbose (void)
 Get general verbosity setting. More...
 
static String FE_CDECL buildDate (void)
 Return the date when System.cc was compiled. More...
 
static String FE_CDECL getExePath (BWORD a_prune)
 Get the full path to the running executable. More...
 
static String FE_CDECL getLoadPath (void *a_symbol, BWORD a_prune)
 Get the full path to the symbol's library. More...
 
static String FE_CDECL getCurrentWorkingDirectory (void)
 Get the path for all relative file operations. More...
 
static bool FE_CDECL setCurrentWorkingDirectory (const String &a_path)
 Set the path for all relative file operations. More...
 
static bool FE_CDECL createDirectory (const String &a_path)
 Make a directory for the given path. More...
 
static bool FE_CDECL createParentDirectories (const String &a_filename)
 Make all directories parent to the given file. More...
 
static bool FE_CDECL listDirectory (String a_path, std::vector< String > &a_rEntries)
 Get all the entries in a directory. More...
 
static String FE_CDECL demangle (const String a_symbol, BWORD a_emptyDefault=FALSE)
 
static String FE_CDECL getExecutablePath (void)
 Return the path of the enclosing executable. More...
 
static String FE_CDECL getModulePath (void)
 Return the path of the enclosing module. More...
 
static String FE_CDECL getBinarySuffix (void)
 Return the binary suffix that the current libs were built with. More...
 
static String FE_CDECL findFile (String a_filename, std::vector< String > a_paths)
 Find first instance of file among paths. More...
 
static String FE_CDECL findFile (String a_filename, String a_delimitedPaths, String a_delimiter=":")
 Find first instance of file among paths. More...
 
static String FE_CDECL localTime (String a_format="%Y%m%d %H:%M:%S")
 Return formatted time. More...
 

Static Private Attributes

static BWORD ms_bannerPrinted
 

Detailed Description

System call wrappers.

Member Function Documentation

◆ buildDate()

String fe::System::buildDate ( void  )
static

Return the date when System.cc was compiled.

◆ createDirectory()

bool fe::System::createDirectory ( const String a_path)
static

Make a directory for the given path.

References fe::String::c_str().

Referenced by createParentDirectories(), and fe::ext::SplatterSystem::image().

◆ createParentDirectories()

bool fe::System::createParentDirectories ( const String a_filename)
static

Make all directories parent to the given file.

References createDirectory(), and fe::String::empty().

◆ findFile() [1/2]

String fe::System::findFile ( String  a_filename,
std::vector< String a_paths 
)
static

Find first instance of file among paths.

The first path with the file is returned, or an empty string if there is no match.

References fe::String::c_str().

Referenced by findFile().

◆ findFile() [2/2]

String fe::System::findFile ( String  a_filename,
String  a_delimitedPaths,
String  a_delimiter = ":" 
)
static

Find first instance of file among paths.

The paths argument is a colon delimited string. The first path with the file is returned, or an empty string if there is no match.

References findFile().

◆ getBinarySuffix()

String fe::System::getBinarySuffix ( void  )
static

Return the binary suffix that the current libs were built with.

References getEnvironmentVariable().

◆ getCurrentWorkingDirectory()

String fe::System::getCurrentWorkingDirectory ( void  )
static

Get the path for all relative file operations.

◆ getEnvironmentVariable()

bool fe::System::getEnvironmentVariable ( const String name,
String value 
)
static

Get an environment variable.

TRUE is returned only if the variable exists.

Referenced by getBinarySuffix(), fe::ext::MOAViewer::getDefaultBgColor(), and getVerbose().

◆ getExecutablePath()

String fe::System::getExecutablePath ( void  )
static

Return the path of the enclosing executable.

◆ getExePath()

String fe::System::getExePath ( BWORD  a_prune)
static

Get the full path to the running executable.

Pruning will resolve all '..' tokens in the path.

References fe::String::pathname().

◆ getHomePath()

bool fe::System::getHomePath ( String value)
static

Get the active user's home directory.

TRUE is returned only if the value is found.

◆ getLoadPath()

String fe::System::getLoadPath ( void *  a_symbol,
BWORD  a_prune 
)
static

Get the full path to the symbol's library.

Pruning will resolve all '..' tokens in the path.

◆ getModulePath()

String fe::System::getModulePath ( void  )
static

Return the path of the enclosing module.

◆ getVerbose()

String fe::System::getVerbose ( void  )
static

Get general verbosity setting.

References fe::String::empty(), and getEnvironmentVariable().

Referenced by feRegisterSegvHandler(), and printBannerOnce().

◆ listDirectory()

bool fe::System::listDirectory ( String  a_path,
std::vector< String > &  a_rEntries 
)
static

Get all the entries in a directory.

The entries arg is populated with all the files and subdirectories under the given path.

References fe::String::c_str().

◆ localTime()

String fe::System::localTime ( String  a_format = "%Y%m%d %H:%M:%S")
static

Return formatted time.

The format follows strftime(), except that the format sequence '${MILLISECONDS}' can be used to indicate milliseconds.

References fe::String::c_str(), fe::String::length(), and fe::String::sPrintf().

◆ printBannerOnce()

void fe::System::printBannerOnce ( void  )
static

Print a startup message only one time.

Additional calls will print nothing.

References getVerbose().

◆ setCurrentWorkingDirectory()

bool fe::System::setCurrentWorkingDirectory ( const String a_path)
static

Set the path for all relative file operations.

References fe::String::c_str().


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