ALib C++ Framework
by
Library Version: 2605 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
system.uni.cpp
1//##################################################################################################
2// ALib C++ Framework
3//
4// Copyright 2013-2026 A-Worx GmbH, Germany
5// Published under 'Boost Software License' (a free software license, see LICENSE.txt)
6//##################################################################################################
7//========================================= Global Fragment ========================================
8#include "alib_precompile.hpp"
12
13
14#if ALIB_SYSTEM_FILE_STATUS_IMPL == ALIB_SYSTEM_FILE_POSIX_STATUS
15# include <unistd.h>
16# if defined(__linux__)
17# include <asm/unistd.h>
18# endif
19# include <dirent.h>
20# if defined(__linux__)
21# include <linux/stat.h>
22# include <linux/magic.h>
23# endif
24# include <sys/stat.h>
25# if !defined(__APPLE__)
26# include <sys/vfs.h>
27# include <sys/sysmacros.h>
28# else
29# include <sys/types.h>
30# include <sys/mount.h>
31# endif
32# include <pwd.h>
33# include <fcntl.h>
34# include <pwd.h>
35# include <grp.h>
36#else
37# include <filesystem>
38 namespace fs = std::filesystem;
39
40 // Note: MacOS is currently (as of 231210) missing C++20 library features in the area of std::clock
41 #if defined(__APPLE__) || defined(_LIBCPP_VERSION) || defined(__ANDROID_NDK__)
42 namespace
43 {
44 template <typename TP>
45 std::time_t to_time_t(TP tp)
46 {
47 auto sctp = std::chrono::time_point_cast<std::chrono::system_clock::duration>(tp - TP::clock::now()
48 + std::chrono::system_clock::now());
49 return std::chrono::system_clock::to_time_t(sctp);
50 }
51 }
52 #endif
53#endif
54
55#if !defined (_WIN32)
56# include <pwd.h>
57# include <grp.h>
58#endif
59
60
61#if !DOXYGEN
62# include <cstdlib>
63# if defined( _WIN32 )
64# include <direct.h>
65# elif defined (__GLIBCXX__) || defined(_LIBCPP_VERSION) || defined(__APPLE__) || defined(__ANDROID_NDK__)
66# include <unistd.h>
67# else
68# pragma message ("Unknown Platform in file: " __FILE__ )
69# endif
70# if ALIB_SYSTEM_FILE_STATUS_IMPL == ALIB_SYSTEM_FILE_POSIX_STATUS
71# if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION) || defined(__ANDROID_NDK__)
72# include <sys/ioctl.h>
73# elif defined(__APPLE__)
74# include <sys/sysctl.h>
75# endif
76# if defined(__APPLE__)
77# include <libproc.h>
78# endif
79# endif
80# include <fstream>
81#endif // !DOXYGEN
82
83#if !defined(_WIN32)
84 #include <fcntl.h>
85 #include <sys/stat.h>
86 #if defined(_POSIX_MAPPED_FILES) && _POSIX_MAPPED_FILES > 0
87 #include <sys/mman.h>
88 #endif
89#else
90# include <sys/stat.h>
91#endif
92
93
94//============================================= Imports ============================================
95# include "ALib.Lang.H"
96# include "ALib.Threads.H"
98# include "ALib.System.H"
100//========================================== Implementation ========================================
102#include "console.cpp"
103#include "environment.cpp"
104#include "processinfo.cpp"
105#include "shellcommand.cpp"
106#include "path.cpp"
107#include "filestatus.cpp"
108#include "mappedfile.cpp"
#define ALIB_ALLOW_IMPLEMENTATION_INCLUSION
#define ALIB_POP_ALLOWANCE