ALib C++ Framework
by
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::system Namespace Reference

Description:

This is the reference documentation of module ALib System, which exposes it's entities in this namespace.

Type Index:

class  Console
 This class provides system-dependent features in respect the console attached to a process. More...
struct  EnvironmentVariables
class  Path
class  ProcessInfo
 This class represents process information. More...
class  TShellCommand

Type Definition Index:

using CPathString = strings::TCString<PathCharType>
 The string-type used with this ALib Module.
using PathCharType = std::filesystem::path::value_type
using PathString = strings::TString<PathCharType>
 The string-type used with this ALib Module.
using PathStringMA = strings::TAString<PathCharType, PoolAllocator >
 A mono-allocated string representing a path.
using PathStringPA = strings::TAString<PathCharType, PoolAllocator >
 A pool-allocated string representing a path.
using PathSubstring = strings::TSubstring<PathCharType>
 The string-type used with this ALib Module.

Enumeration Index:

enum class  SystemFolders {
  Root , Current , Home , HomeConfig ,
  Module , Temp , VarTemp
}

Variable Index:

constexpr PathCharType DIRECTORY_SEPARATOR = '/'
 The standard path separator character. Defaults to '\' on Windows OS, '/' else.
constexpr PathString EMPTY_PATH
 An empty path string.
constexpr PathString NULL_PATH
 A nulled path string.

Type Definition Details:

◆ CPathString

The string-type used with this ALib Module.

Definition at line 36 of file path.inl.

◆ PathCharType

using alib::system::PathCharType = std::filesystem::path::value_type

The character type that this ALib Module uses for String representations. This is taken from the C++ standard library.

Definition at line 12 of file path.inl.

◆ PathString

The string-type used with this ALib Module.

Definition at line 33 of file path.inl.

◆ PathStringMA

A mono-allocated string representing a path.

Definition at line 43 of file path.inl.

◆ PathStringPA

A pool-allocated string representing a path.

Definition at line 46 of file path.inl.

◆ PathSubstring

The string-type used with this ALib Module.

Definition at line 39 of file path.inl.

Enumeration Details:

◆ SystemFolders

enum class alib::system::SystemFolders
strong

Enumerates special system folders like "home", "temp", "config", etc. This enumeration is primarily used with class Path and this documentation refers to this type.

Enumerator
Root 

The root directory .

Current 

The current directory of the process.

Home 

The user's home directory.

HomeConfig 

The user's configuration directory. This is evaluated as follows:

  • Using environment variable HOME (under WindowsOS a combination of HOMEDRIVE and HOMEPATH), the home directory is determined.
  • If within this directory ".config" exists, it is used, otherwise
  • if within this direcotory the directories "AppData/Roaming" exist, this is used.
Module 

The directory of the executable of the process.

Temp 

A directory to be used for creation of temporary files.

  • On GNU/Linux OS this defaults to /tmp.
  • On Windows OS, environment variables "TMP" and "TEMP" are evaluated.

If the directory does not exist, then (on all OS), a new directory named ".tmp" is created in the user's home directory and returned (if not existent already). If this fails, the home directory itself is returned.

Note
With the potential creation of the directory ".tmp" in the user's home directory, a small readme.txt file is created containing the name of the running application and the reason of the creation.

To overrule this behavior, public static variable static PathString tempDirEvaluatedOnce may be set arbitrarily before using this enum value.

VarTemp 

A directory to be used for creation of temporary files that survives reboots of the host machine.

  • On GNU/Linux OS this defaults to /var/tmp.
  • On Windows OS, environment variables "TMP" and "TEMP" are evaluated (same as with SystemFolders::Temp).

If the directory does not exist, then (on all OS), a new directory named ".var.tmp" is created in the user's home directory and returned (if not existent already). If this fails, the home directory itself is returned.

Note
With the potential creation of the directory ".var.tmp" in the user's home directory, a small readme.txt file is created, containing the name of the running application and the reason of the creation.

To overrule this behavior, public static variable static PathString varTempDirEvaluatedOnce may be set arbitrarily before using this enum value.

Definition at line 85 of file path.inl.

Variable Details:

◆ DIRECTORY_SEPARATOR

PathCharType alib::system::DIRECTORY_SEPARATOR = '/'
inlineconstexpr

The standard path separator character. Defaults to '\' on Windows OS, '/' else.

Definition at line 63 of file path.inl.

◆ EMPTY_PATH

PathString alib::system::EMPTY_PATH
inlineconstexpr

An empty path string.

Definition at line 54 of file path.inl.

◆ NULL_PATH

PathString alib::system::NULL_PATH
inlineconstexpr

A nulled path string.

Definition at line 51 of file path.inl.