.. index:: pair: class; EE::System::Sys .. _doxid-class_e_e_1_1_system_1_1_sys: class EE::System::Sys ===================== .. toctree:: :hidden: Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class Sys { public: // methods static :ref:`Uint64` :ref:`getProcessID`(); static std::string :ref:`getDateTimeStr`(); static std::string :ref:`epochToString`(const :ref:`Uint64`& epochTimestamp, const std::string& format = "%Y-%m-%d %H:%M"); static std::string :ref:`getConfigPath`(const std::string& appname); static std::string :ref:`getTempPath`(); static :ref:`Uint64` :ref:`getTicks`(); static void :ref:`sleep`(const :ref:`Uint32`& ms); static void :ref:`sleep`(const :ref:`Time`& time); static std::string :ref:`getProcessPath`(); static std::string :ref:`getProcessFilePath`(); static double :ref:`getSystemTime`(); static std::string :ref:`getOSName`(bool showReleaseName = false); static std::string :ref:`getOSArchitecture`(); static std::string :ref:`getPlatform`(); static int :ref:`getCPUCount`(); static void* :ref:`loadObject`(const std::string& sofile); static void :ref:`unloadObject`(void* handle); static void* :ref:`loadFunction`(void* handle, const std::string& name); static std::vector :ref:`parseArguments`(int argc, char* argv[]); static std::vector :ref:`getLogicalDrives`(); static std::string :ref:`which`(const std::string& exeName, const std::vector& customSearchPaths = {}); static std::string :ref:`getEnv`(const std::string& name); static std::vector :ref:`getEnvSplitted`(const std::string& name); static bool :ref:`windowAttachConsole`(); static void :ref:`execute`(const std::string& cmd); static bool :ref:`isMobile`(); static std::unordered_map :ref:`getEnvironmentVariables`(); }; .. _details-class_e_e_1_1_system_1_1_sys: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Methods ------- .. index:: pair: function; getProcessID .. _doxid-class_e_e_1_1_system_1_1_sys_1a4f97a5e5e3012e547a62a5170065df9d: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`Uint64` getProcessID() .. rubric:: Returns: The current process id .. index:: pair: function; getDateTimeStr .. _doxid-class_e_e_1_1_system_1_1_sys_1af7f3fabae5f87df59ea7fae2d2c83b70: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string getDateTimeStr() .. rubric:: Returns: the current date time .. index:: pair: function; epochToString .. _doxid-class_e_e_1_1_system_1_1_sys_1ad32a05c0267abb05896e354e8331e2ab: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string epochToString(const :ref:`Uint64`& epochTimestamp, const std::string& format = "%Y-%m-%d %H:%M") Converts any epoch timestmap to a formatted string. .. index:: pair: function; getConfigPath .. _doxid-class_e_e_1_1_system_1_1_sys_1ae36cea23a9a6424ae5823cdc0e0c6c82: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string getConfigPath(const std::string& appname) .. rubric:: Returns: A storage path for config files for every platform .. index:: pair: function; getTempPath .. _doxid-class_e_e_1_1_system_1_1_sys_1a4ed64e9c120c21d3511e62c077e09feb: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string getTempPath() .. rubric:: Returns: The path of the directory designated for temporary files. .. index:: pair: function; getTicks .. _doxid-class_e_e_1_1_system_1_1_sys_1a94edd2f1a2abd8c40cdbcce0efeb49b0: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`Uint64` getTicks() .. rubric:: Returns: The number of milliseconds since the first call. Note that this value wraps if the program runs for more than ~49 days. .. index:: pair: function; sleep .. _doxid-class_e_e_1_1_system_1_1_sys_1abf684d79a77c529be9ba2e89b90cf5db: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void sleep(const :ref:`Uint32`& ms) Wait a specified number of milliseconds before returning. .. index:: pair: function; sleep .. _doxid-class_e_e_1_1_system_1_1_sys_1a4b75863e41a6230e2eceb3d5dd20f918: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void sleep(const :ref:`Time`& time) Wait the time defined before returning. .. index:: pair: function; getProcessPath .. _doxid-class_e_e_1_1_system_1_1_sys_1a125037dfe91a83b274e08969cb874985: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string getProcessPath() .. rubric:: Returns: The application path ( the executable path without the executable ) .. index:: pair: function; getProcessFilePath .. _doxid-class_e_e_1_1_system_1_1_sys_1a65f267f60d44c420d84731cff93134ea: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string getProcessFilePath() .. rubric:: Returns: The process path ( the executable file path ) .. index:: pair: function; getSystemTime .. _doxid-class_e_e_1_1_system_1_1_sys_1af21c3530b6081e9bf543d7cec7518395: .. ref-code-block:: cpp :class: doxyrest-title-code-block static double getSystemTime() .. rubric:: Returns: The :ref:`System ` :ref:`Time ` .. index:: pair: function; getOSName .. _doxid-class_e_e_1_1_system_1_1_sys_1acb3d867c6ca78a3da3e8260468df6cf7: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string getOSName(bool showReleaseName = false) .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - showReleaseName - Instead of returning only the OS Name, it will append the release name or number. For Windows instead of "Windows" it will be "Windows 7", for "Linux" it will be "Linux 3.15" and so on. .. rubric:: Returns: The OS Name .. index:: pair: function; getOSArchitecture .. _doxid-class_e_e_1_1_system_1_1_sys_1a5f9322a176d15e170558eac9dafbf0d9: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string getOSArchitecture() .. rubric:: Returns: The OS Architecture .. index:: pair: function; getPlatform .. _doxid-class_e_e_1_1_system_1_1_sys_1aca199c47da7600173d9c4678e34395da: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string getPlatform() .. rubric:: Returns: The platform name. .. index:: pair: function; getCPUCount .. _doxid-class_e_e_1_1_system_1_1_sys_1a5ba5cdafbfa2c6fb2e8f2c275d1a0bda: .. ref-code-block:: cpp :class: doxyrest-title-code-block static int getCPUCount() .. rubric:: Returns: The Number of CPUs of the system. .. index:: pair: function; loadObject .. _doxid-class_e_e_1_1_system_1_1_sys_1a5aaafe67e4c2492997c67b7b06941245: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void* loadObject(const std::string& sofile) Dynamically load a shared object and return a pointer to the object handle. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - sofile - a system dependent name of the object file .. rubric:: Returns: The pointer to the object handle or NULL if there was an error .. index:: pair: function; unloadObject .. _doxid-class_e_e_1_1_system_1_1_sys_1a62d7960469b8e1a08f44ba318d8345f6: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void unloadObject(void* handle) Unloads a shared object from memory. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - handle - The object handle of the shared object to unload .. index:: pair: function; loadFunction .. _doxid-class_e_e_1_1_system_1_1_sys_1a2583d75e406b24213f1f032e8753d62f: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void* loadFunction(void* handle, const std::string& name) Looks up the address of the named function in the shared object and return it. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - handle - A valid shared object handle returned by Sys::LoadObject() * - name - The name of the function to look up .. rubric:: Returns: The pointer to the function or NULL if there was an error .. index:: pair: function; parseArguments .. _doxid-class_e_e_1_1_system_1_1_sys_1a49e6554d6c6190146f671886611c64f2: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::vector parseArguments(int argc, char* argv[]) .. rubric:: Returns: the argument list in a vector of std::strings in UTF-8, ignoring the first argument (the binary name) .. index:: pair: function; getLogicalDrives .. _doxid-class_e_e_1_1_system_1_1_sys_1aeafc6f0a8860511d1de08cd66337fd0f: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::vector getLogicalDrives() .. rubric:: Returns: The OS logical drives .. index:: pair: function; which .. _doxid-class_e_e_1_1_system_1_1_sys_1ac0c77d1cbdd1abe993989fe52c523272: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string which(const std::string& exeName, const std::vector& customSearchPaths = {}) Finds the location of a binary / executable file. .. rubric:: Returns: The executable file path, or an empty string if not found. .. index:: pair: function; getEnv .. _doxid-class_e_e_1_1_system_1_1_sys_1a2b6ee3ec87daf6255c4ad0a9bbd257b7: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string getEnv(const std::string& name) .. rubric:: Returns: An environment variable .. index:: pair: function; getEnvSplitted .. _doxid-class_e_e_1_1_system_1_1_sys_1a5564e63dcc9f992e2c02ea0620f37f32: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::vector getEnvSplitted(const std::string& name) .. rubric:: Returns: A splitted environment variable .. index:: pair: function; windowAttachConsole .. _doxid-class_e_e_1_1_system_1_1_sys_1a2fc4378d14448d95a3b48bcb26acb9e4: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool windowAttachConsole() It will attach the console to the parent process console if any. Windows only function. Other platforms will do nothing. .. index:: pair: function; execute .. _doxid-class_e_e_1_1_system_1_1_sys_1ab5f02c0e7cca28b71fdacb668e3e322b: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void execute(const std::string& cmd) Executes a command .. index:: pair: function; isMobile .. _doxid-class_e_e_1_1_system_1_1_sys_1ad994c1f15f7997e65eeffd4208b7c8ea: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool isMobile() .. rubric:: Returns: True if current running platform / os is a mobile one .. index:: pair: function; getEnvironmentVariables .. _doxid-class_e_e_1_1_system_1_1_sys_1aabcf32b8a92e08b2d677d015f0664120: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::unordered_map getEnvironmentVariables() .. rubric:: Returns: The process environment variables