TRLC Platform Library  1.0.0
Header-only C++ library for compile-time platform detection and abstraction
platform.hpp File Reference

Operating system and environment detection utilities. More...

Go to the source code of this file.

Classes

struct  trlc::platform::PlatformInfo
 Platform information structure. More...
 

Namespaces

 trlc
 
 trlc::platform
 

Macros

#define TRLC_PLATFORM_WINDOWS   0
 Check if current platform is Windows (preprocessor-compatible) More...
 
#define TRLC_PLATFORM_LINUX   0
 Check if current platform is Linux (preprocessor-compatible) More...
 
#define TRLC_PLATFORM_MACOS   0
 Check if current platform is macOS (preprocessor-compatible) More...
 
#define TRLC_PLATFORM_POSIX   0
 Check if current platform supports POSIX (preprocessor-compatible) More...
 
#define TRLC_PLATFORM_BSD   0
 Check if current platform is BSD-based (preprocessor-compatible) More...
 
#define TRLC_PLATFORM_UNIX   0
 Check if current platform is Unix-like (preprocessor-compatible) More...
 
#define TRLC_PLATFORM_MOBILE   0
 Check if current platform is mobile (preprocessor-compatible) More...
 
#define TRLC_PLATFORM_CASE_SENSITIVE_FS   0
 Check if current platform has case-sensitive filesystem (preprocessor-compatible) More...
 

Enumerations

enum class  trlc::platform::OperatingSystem : int {
  trlc::platform::unknown = 0 , trlc::platform::windows , trlc::platform::linux_generic , trlc::platform::ubuntu ,
  trlc::platform::debian , trlc::platform::redhat , trlc::platform::macos , trlc::platform::freebsd ,
  trlc::platform::openbsd , trlc::platform::netbsd , trlc::platform::android , trlc::platform::ios
}
 Operating system identification enumeration. More...
 
enum class  trlc::platform::EnvironmentType : int {
  trlc::platform::unknown = 0 , trlc::platform::desktop , trlc::platform::server , trlc::platform::embedded ,
  trlc::platform::mobile
}
 Environment type identification enumeration. More...
 

Functions

static OperatingSystem trlc::platform::getOperatingSystem ()
 Detects the current operating system at compile time. More...
 
static EnvironmentType trlc::platform::getEnvironmentType ()
 Detects the current environment type at compile time. More...
 
static PlatformInfo trlc::platform::getPlatformInfo ()
 Gets comprehensive platform information. More...
 
static bool trlc::platform::hasPosixApi ()
 Checks if the platform supports POSIX APIs. More...
 
static bool trlc::platform::hasWin32Api ()
 Checks if the platform supports Win32 APIs. More...
 
static bool trlc::platform::supportsCaseSensitiveFilesystem ()
 Checks if the platform supports case-sensitive filesystems. More...
 

Detailed Description

Operating system and environment detection utilities.

This header provides compile-time platform detection for operating systems, environments, and platform-specific feature detection for cross-platform C++ development.

Definition in file platform.hpp.

Macro Definition Documentation

◆ TRLC_PLATFORM_BSD

#define TRLC_PLATFORM_BSD   0

Check if current platform is BSD-based (preprocessor-compatible)

Definition at line 363 of file platform.hpp.

◆ TRLC_PLATFORM_CASE_SENSITIVE_FS

#define TRLC_PLATFORM_CASE_SENSITIVE_FS   0

Check if current platform has case-sensitive filesystem (preprocessor-compatible)

Definition at line 390 of file platform.hpp.

◆ TRLC_PLATFORM_LINUX

#define TRLC_PLATFORM_LINUX   0

Check if current platform is Linux (preprocessor-compatible)

Definition at line 333 of file platform.hpp.

◆ TRLC_PLATFORM_MACOS

#define TRLC_PLATFORM_MACOS   0

Check if current platform is macOS (preprocessor-compatible)

Definition at line 342 of file platform.hpp.

◆ TRLC_PLATFORM_MOBILE

#define TRLC_PLATFORM_MOBILE   0

Check if current platform is mobile (preprocessor-compatible)

Definition at line 381 of file platform.hpp.

◆ TRLC_PLATFORM_POSIX

#define TRLC_PLATFORM_POSIX   0

Check if current platform supports POSIX (preprocessor-compatible)

Definition at line 353 of file platform.hpp.

◆ TRLC_PLATFORM_UNIX

#define TRLC_PLATFORM_UNIX   0

Check if current platform is Unix-like (preprocessor-compatible)

Definition at line 372 of file platform.hpp.

◆ TRLC_PLATFORM_WINDOWS

#define TRLC_PLATFORM_WINDOWS   0

Check if current platform is Windows (preprocessor-compatible)

Definition at line 324 of file platform.hpp.