CppCommon 1.0.5.0
C++ Common Library
Loading...
Searching...
No Matches
environment.h
Go to the documentation of this file.
1
9#ifndef CPPCOMMON_SYSTEM_ENVIRONMENT_H
10#define CPPCOMMON_SYSTEM_ENVIRONMENT_H
11
12#include "errors/exceptions.h"
13
14#include <map>
15#include <string>
16
17namespace CppCommon {
18
20
27{
28public:
29 Environment() = delete;
30 Environment(const Environment&) = delete;
32 ~Environment() = delete;
33
36
38 static bool Is32BitOS();
40 static bool Is64BitOS();
41
43 static bool Is32BitProcess();
45 static bool Is64BitProcess();
46
48 static bool IsDebug();
50 static bool IsRelease();
51
53 static bool IsBigEndian();
55 static bool IsLittleEndian();
56
58 static std::string OSVersion();
59
61 static std::string EndLine();
62
64 static std::string UnixEndLine();
66 static std::string WindowsEndLine();
67
69
72 static std::map<std::string, std::string> envars();
73
75
79 static std::string GetEnvar(const std::string name);
81
85 static void SetEnvar(const std::string name, const std::string value);
87
90 static void ClearEnvar(const std::string name);
91};
92
95} // namespace CppCommon
96
97#endif // CPPCOMMON_SYSTEM_ENVIRONMENT_H
Environment management static class.
Definition environment.h:27
static bool IsBigEndian()
Is big-endian system?
static bool Is64BitProcess()
Is 64-bit running process?
Environment & operator=(const Environment &)=delete
Environment & operator=(Environment &&)=delete
static std::string UnixEndLine()
Get Unix text end line separator.
static bool Is64BitOS()
Is 64-bit OS?
static bool Is32BitProcess()
Is 32-bit running process?
static void SetEnvar(const std::string name, const std::string value)
Set environment variable value by the given name.
static bool IsRelease()
Is compiled in release mode?
static void ClearEnvar(const std::string name)
Clear environment variable by the given name.
Environment(Environment &&)=delete
Environment(const Environment &)=delete
static std::map< std::string, std::string > envars()
Get all environment variables.
static bool IsDebug()
Is compiled in debug mode?
static std::string OSVersion()
Get OS version string.
static bool Is32BitOS()
Is 32-bit OS?
static bool IsLittleEndian()
Is little-endian system?
static std::string EndLine()
Get text end line separator.
static std::string WindowsEndLine()
Get Windows text end line separator.
static std::string GetEnvar(const std::string name)
Get environment variable value by the given name.
Exceptions definition.
C++ Common project definitions.