jaulib v1.3.0
Jau Support Library (C++, Java, ..)
Namespaces | Classes | Enumerations | Functions
OS Support

OS Support Functionality. More...

Namespaces

namespace  jau::os::impl
 

Classes

class  jau::os::DynamicLinker
 Low level secure dynamic linker access. More...
 
class  jau::os::DynamicLookup
 Interface callers may use ProcAddressHelper's reset helper method to install function pointers into a ProcAddressTable. More...
 
class  jau::os::FuncAddrResolver
 
class  jau::os::NativeLibrary
 Runtime libary dynamic library (RTLD) access. More...
 
struct  jau::os::RuntimeOSInfo
 
class  jau::os::UserInfo
 User account information of the underlying OS. More...
 

Enumerations

enum class  jau::os::abi_type_t : uint16_t {
  jau::os::abi_type_t::generic = 0x00 , jau::os::abi_type_t::gnu_armel = 0x01 , jau::os::abi_type_t::gnu_armhf = 0x02 , jau::os::abi_type_t::aarch64 = 0x03 ,
  jau::os::abi_type_t::wasm32_gen = 0x20 , jau::os::abi_type_t::wasm32_ems = 0x21 , jau::os::abi_type_t::wasm64_gen = 0x2a , jau::os::abi_type_t::wasm64_ems = 0x2b
}
 
enum class  jau::os::os_type_t : uint32_t {
  jau::os::os_type_t::Unix = 0b00000000000000000000000000000001U , jau::os::os_type_t::Windows = 0b00000000000000000000000000000010U , jau::os::os_type_t::Linux = 0b00000000000000000000000100000001U , jau::os::os_type_t::Android = 0b00000000000000000000001100000001U ,
  jau::os::os_type_t::FreeBSD = 0b00000000000000000000010000000001U , jau::os::os_type_t::Darwin = 0b00000000000000000000100000000001U , jau::os::os_type_t::QnxNTO = 0b00000000000000000001000000000001U , jau::os::os_type_t::GenWasm = 0b00000001000000000000000000000000U ,
  jau::os::os_type_t::Emscripten = 0b00000001000000000000000000000001U , jau::os::os_type_t::native = impl::get_host_os_id()
}
 OS type bits and unique IDs. More...
 

Functions

constexpr_cxx20 std::string jau::os::dir_separator () noexcept
 Returns the OS's path separator as a string, e.g. More...
 
constexpr char jau::os::dir_separator_char () noexcept
 Returns the OS's path separator character, e.g. More...
 
abi_type_t jau::os::get_abi_type () noexcept
 
constexpr abi_type_t jau::os::get_abi_type (const jau::cpu::cpu_family_t cpu) noexcept
 
std::string jau::os::get_os_and_arch () noexcept
 Returns this hosts's common name, see get_os_and_arch() More...
 
std::string jau::os::get_os_and_arch (const os_type_t os, const jau::cpu::cpu_family_t cpu, const abi_type_t abi, const endian_t e) noexcept
 Returns the common name for the given os_type, jau::cpu::cpu_family, abi_type and endian. More...
 
std::string jau::os::get_platform_info () noexcept
 
std::string jau::os::get_platform_info (std::string &sb) noexcept
 
bool jau::os::get_rt_os_info (RuntimeOSInfo &info) noexcept
 
constexpr bool jau::os::is_android () noexcept
 Evaluates true if platform os_type::native contains os_type::Android. More...
 
constexpr bool jau::os::is_darwin () noexcept
 Evaluates true if platform os_type::native contains os_type::Darwin. More...
 
constexpr bool jau::os::is_defined_os_type (const os_type_t v) noexcept
 Evaluates true if the given os_type is defined, i.e. More...
 
constexpr bool jau::os::is_emscripten () noexcept
 Evaluates true if platform os_type::native contains os_type::Emscripten. More...
 
constexpr bool jau::os::is_freebsd () noexcept
 Evaluates true if platform os_type::native contains os_type::FreeBSD. More...
 
constexpr bool jau::os::is_generic_wasm () noexcept
 Evaluates true if platform os_type::native contains os_type::GenWasm. More...
 
constexpr bool jau::os::is_linux () noexcept
 Evaluates true if platform os_type::native contains os_type::Linux. More...
 
constexpr bool jau::os::is_qnxnto () noexcept
 Evaluates true if platform os_type::native contains os_type::QnxNTO. More...
 
constexpr bool jau::os::is_set (const os_type_t mask, const os_type_t bits) noexcept
 
constexpr bool jau::os::is_unix () noexcept
 Evaluates true if platform os_type::native contains os_type::Unix. More...
 
constexpr bool jau::os::is_windows () noexcept
 Evaluates true if platform os_type::native contains os_type::Windows. More...
 
constexpr uint32_t jau::os::number (const os_type_t rhs) noexcept
 
constexpr bool jau::os::operator!= (const os_type_t lhs, const os_type_t rhs) noexcept
 
constexpr os_type_t jau::os::operator& (const os_type_t lhs, const os_type_t rhs) noexcept
 
constexpr os_type_tjau::os::operator&= (os_type_t &lhs, const os_type_t rhs) noexcept
 
constexpr bool jau::os::operator== (const os_type_t lhs, const os_type_t rhs) noexcept
 
constexpr os_type_t jau::os::operator^ (const os_type_t lhs, const os_type_t rhs) noexcept
 
constexpr os_type_tjau::os::operator^= (os_type_t &lhs, const os_type_t rhs) noexcept
 
constexpr os_type_t jau::os::operator| (const os_type_t lhs, const os_type_t rhs) noexcept
 
constexpr os_type_tjau::os::operator|= (os_type_t &lhs, const os_type_t rhs) noexcept
 
constexpr os_type_t jau::os::operator~ (const os_type_t rhs) noexcept
 
constexpr_cxx20 std::string jau::os::path_separator () noexcept
 Returns the OS's path separator as a string, e.g. More...
 
constexpr char jau::os::path_separator_char () noexcept
 Returns the OS's path separator character, e.g. More...
 
std::string jau::os::to_string (const abi_type_t abi) noexcept
 
std::string jau::os::to_string (const os_type_t mask) noexcept
 Return the string representation of os_type. More...
 

Detailed Description

OS Support Functionality.

Available predefined macros denoting the Operating Systems

Further infos:

Enumeration Type Documentation

◆ os_type_t

enum class jau::os::os_type_t : uint32_t
strong

OS type bits and unique IDs.

Enumerator
Unix 

Unix bit, contained by: linux, android, freebsd, darwin.

Windows 

Windows bit.

Linux 

Linux bit, contained by: android; includes: unix

Android 

Android bit, includes: linux and unix

FreeBSD 

FreeBSD bit, includes: unix

Darwin 

Darwin (Apple OSX and iOS) bit, includes: unix

QnxNTO 

QNX NTO (>= 6) bit, includes: unix

GenWasm 

Generic WebAssembly bit.

Emscripten 

WebAssembly with Unix/Posix suport bit (emscripten)

native 

Identifier for native OS type, one of the above.

Definition at line 99 of file os_support.hpp.

◆ abi_type_t

enum class jau::os::abi_type_t : uint16_t
strong
Enumerator
generic 
gnu_armel 

ARM GNU-EABI ARMEL -mfloat-abi=softfp.

gnu_armhf 

ARM GNU-EABI ARMHF -mfloat-abi=hard.

aarch64 

ARM EABI AARCH64 (64bit)

wasm32_gen 

WASM Generic (32bit)

wasm32_ems 

WASM Emscripten (32bit)

wasm64_gen 

WASM Generic (64bit)

wasm64_ems 

WASM Emscripten (64bit)

Definition at line 244 of file os_support.hpp.

Function Documentation

◆ number()

constexpr uint32_t jau::os::number ( const os_type_t  rhs)
constexprnoexcept

Definition at line 121 of file os_support.hpp.

Here is the caller graph for this function:

◆ operator~()

constexpr os_type_t jau::os::operator~ ( const os_type_t  rhs)
constexprnoexcept

Definition at line 124 of file os_support.hpp.

◆ operator^()

constexpr os_type_t jau::os::operator^ ( const os_type_t  lhs,
const os_type_t  rhs 
)
constexprnoexcept

Definition at line 127 of file os_support.hpp.

◆ operator|()

constexpr os_type_t jau::os::operator| ( const os_type_t  lhs,
const os_type_t  rhs 
)
constexprnoexcept

Definition at line 130 of file os_support.hpp.

◆ operator&()

constexpr os_type_t jau::os::operator& ( const os_type_t  lhs,
const os_type_t  rhs 
)
constexprnoexcept

Definition at line 133 of file os_support.hpp.

◆ operator|=()

constexpr os_type_t & jau::os::operator|= ( os_type_t lhs,
const os_type_t  rhs 
)
constexprnoexcept

Definition at line 136 of file os_support.hpp.

◆ operator&=()

constexpr os_type_t & jau::os::operator&= ( os_type_t lhs,
const os_type_t  rhs 
)
constexprnoexcept

Definition at line 140 of file os_support.hpp.

◆ operator^=()

constexpr os_type_t & jau::os::operator^= ( os_type_t lhs,
const os_type_t  rhs 
)
constexprnoexcept

Definition at line 144 of file os_support.hpp.

◆ operator==()

constexpr bool jau::os::operator== ( const os_type_t  lhs,
const os_type_t  rhs 
)
constexprnoexcept

Definition at line 148 of file os_support.hpp.

◆ operator!=()

constexpr bool jau::os::operator!= ( const os_type_t  lhs,
const os_type_t  rhs 
)
constexprnoexcept

Definition at line 151 of file os_support.hpp.

◆ is_set()

constexpr bool jau::os::is_set ( const os_type_t  mask,
const os_type_t  bits 
)
constexprnoexcept

Definition at line 154 of file os_support.hpp.

Here is the caller graph for this function:

◆ to_string() [1/2]

std::string jau::os::to_string ( const os_type_t  mask)
noexcept

Return the string representation of os_type.

Parameters
maskthe os_type to convert
Returns
the string representation.

Definition at line 60 of file os_support.cpp.

Here is the caller graph for this function:

◆ is_defined_os_type()

constexpr bool jau::os::is_defined_os_type ( const os_type_t  v)
constexprnoexcept

Evaluates true if the given os_type is defined, i.e.

Unix, Windows, Linux, Android, ...

Definition at line 168 of file os_support.hpp.

Here is the caller graph for this function:

◆ is_unix()

constexpr bool jau::os::is_unix ( )
constexprnoexcept

Evaluates true if platform os_type::native contains os_type::Unix.

Definition at line 197 of file os_support.hpp.

◆ is_windows()

constexpr bool jau::os::is_windows ( )
constexprnoexcept

Evaluates true if platform os_type::native contains os_type::Windows.

Definition at line 200 of file os_support.hpp.

Here is the caller graph for this function:

◆ is_linux()

constexpr bool jau::os::is_linux ( )
constexprnoexcept

Evaluates true if platform os_type::native contains os_type::Linux.

Definition at line 203 of file os_support.hpp.

◆ is_android()

constexpr bool jau::os::is_android ( )
constexprnoexcept

Evaluates true if platform os_type::native contains os_type::Android.

Definition at line 206 of file os_support.hpp.

◆ is_freebsd()

constexpr bool jau::os::is_freebsd ( )
constexprnoexcept

Evaluates true if platform os_type::native contains os_type::FreeBSD.

Definition at line 209 of file os_support.hpp.

◆ is_darwin()

constexpr bool jau::os::is_darwin ( )
constexprnoexcept

Evaluates true if platform os_type::native contains os_type::Darwin.

Definition at line 212 of file os_support.hpp.

Here is the caller graph for this function:

◆ is_qnxnto()

constexpr bool jau::os::is_qnxnto ( )
constexprnoexcept

Evaluates true if platform os_type::native contains os_type::QnxNTO.

Definition at line 215 of file os_support.hpp.

◆ is_generic_wasm()

constexpr bool jau::os::is_generic_wasm ( )
constexprnoexcept

Evaluates true if platform os_type::native contains os_type::GenWasm.

Definition at line 218 of file os_support.hpp.

◆ is_emscripten()

constexpr bool jau::os::is_emscripten ( )
constexprnoexcept

Evaluates true if platform os_type::native contains os_type::Emscripten.

Definition at line 221 of file os_support.hpp.

◆ get_rt_os_info()

bool jau::os::get_rt_os_info ( RuntimeOSInfo info)
noexcept

Definition at line 69 of file os_support.cpp.

Here is the caller graph for this function:

◆ get_abi_type() [1/2]

constexpr abi_type_t jau::os::get_abi_type ( const jau::cpu::cpu_family_t  cpu)
constexprnoexcept

Definition at line 261 of file os_support.hpp.

Here is the caller graph for this function:

◆ get_abi_type() [2/2]

abi_type_t jau::os::get_abi_type ( )
inlinenoexcept

Definition at line 281 of file os_support.hpp.

◆ to_string() [2/2]

std::string jau::os::to_string ( const abi_type_t  abi)
noexcept

Definition at line 97 of file os_support.cpp.

◆ get_os_and_arch() [1/2]

std::string jau::os::get_os_and_arch ( const os_type_t  os,
const jau::cpu::cpu_family_t  cpu,
const abi_type_t  abi,
const endian_t  e 
)
noexcept

Returns the common name for the given os_type, jau::cpu::cpu_family, abi_type and endian.

An excerpt of supported os.and.arch strings:

  • android-armv6
  • android-aarch64
  • android-x86
  • linux-armv6
  • linux-armv6hf
  • linux-i586
  • linux-ppc
  • linux-mips
  • linux-mipsel
  • linux-superh
  • linux-sparc
  • linux-aarch64
  • linux-amd64
  • linux-ppc64
  • linux-ppc64le
  • linux-mips64
  • linux-ia64
  • linux-sparcv9
  • linux-risc2.0
  • freebsd-i586
  • freebsd-amd64
  • darwin-universal
  • windows-amd64
  • windows-i586
Returns
The os.and.arch value.

Definition at line 105 of file os_support.cpp.

Here is the caller graph for this function:

◆ get_os_and_arch() [2/2]

std::string jau::os::get_os_and_arch ( )
inlinenoexcept

Returns this hosts's common name, see get_os_and_arch()

Definition at line 322 of file os_support.hpp.

◆ path_separator_char()

constexpr char jau::os::path_separator_char ( )
constexprnoexcept

Returns the OS's path separator character, e.g.

; for Windows and : for Unix (rest of the world)

Definition at line 327 of file os_support.hpp.

Here is the caller graph for this function:

◆ path_separator()

constexpr_cxx20 std::string jau::os::path_separator ( )
noexcept

Returns the OS's path separator as a string, e.g.

; for Windows and : for Unix (rest of the world)

Definition at line 335 of file os_support.hpp.

Here is the caller graph for this function:

◆ dir_separator_char()

constexpr char jau::os::dir_separator_char ( )
constexprnoexcept

Returns the OS's path separator character, e.g.

\\ for Windows and / for Unix (rest of the world)

Definition at line 340 of file os_support.hpp.

Here is the caller graph for this function:

◆ dir_separator()

constexpr_cxx20 std::string jau::os::dir_separator ( )
noexcept

Returns the OS's path separator as a string, e.g.

\\ for Windows and / for Unix (rest of the world)

Definition at line 349 of file os_support.hpp.

◆ get_platform_info() [1/2]

std::string jau::os::get_platform_info ( std::string &  sb)
noexcept

Definition at line 207 of file os_support.cpp.

Here is the caller graph for this function:

◆ get_platform_info() [2/2]

std::string jau::os::get_platform_info ( )
inlinenoexcept

Definition at line 354 of file os_support.hpp.