[Summary]
StormByte System is the C++26 process, device and host layer of the StormByte suite.
It depends directly on StormByte Base 2.0.0 or newer. This repository is not Base, Buffer, Config, Crypto, Database, Logger, Multimedia or Network.
Spawn children with piped stdin/stdout/stderr, classify the medium behind a path, resolve directories and the current executable, inspect the machine, name the calling thread, and expand environment strings. POSIX and Windows stay behind one API. Failures are StormByte::Error::Fault in a per-type domain (StormByte.System.*). Nothing in this module throws. Text that crosses a DLL boundary is StormByte::Safe::String / StormByte::Safe::CString (and wide counterparts), not std::string by value.
From 2.0.0, original System sources are dual-licensed: GNU Lesser General Public License v3.0 or later, or a commercial license from the copyright holder. That change does not cover other StormByte modules or third-party material under thirdparty/ (including bundled StormByte Base).
If you landed here from a release link and have not read the tree:
- What this module is, how to build it, and short examples: README.md
- License: dual license LGPL-3.0-or-later or commercial, LICENSE
Added
- Device: classify the medium behind a path (
Kind,Accessbitmask, nominalThroughput, suggestedWindow).- Copyable; stores only the caller accessor as
StormByte::Safe::String. - Probe is on-demand.
operator boolis probe success, not permission. - Errors are
StormByte::System::Device::Errorin domainStormByte.System.Device, held asStormByte::Error::Fault.
- Copyable; stores only the caller accessor as
- Directory: current, home, temporary and current-executable directories.
bool+ outString;LastError()is TLS in this module. - File:
Temporary(prefix, suffix)creates an empty file the caller unlinks;CurrentExecutableis the running image. - Host: name, architecture, CPU brand, OS, kernel, page size, physical/available memory, logical processors, process bitness.
- ThisThread:
Sleep; get/set thread name (TooLongif the platform limit is exceeded; the name is not truncated). - Dual license on original System sources: LGPL-3.0-or-later or commercial (
LICENSE+COPYING.LGPLv3). - Shared vs static follows CMake
BUILD_SHARED_LIBS(declared inlib/, default ON). There is noSTORMBYTE_SYSTEM_SHAREDCMake option. When the library is shared, the compile definitionSTORMBYTE_SYSTEM_SHAREDis still set sovisibility.hcan distinguishdllexport/dllimport/ static. CI passes-DBUILD_SHARED_LIBS=ON. Vendored StormByte Base follows the sameBUILD_SHARED_LIBSmode and is configured withENABLE_TEST=OFF.
Changed
- Breaking: Process no longer throws. Spawn, wait and stdin failures are
StormByte::System::Process::Errorin domainStormByte.System.Process, held asFault().operator boolis true only while a child is live (RUNNINGorSUSPENDED).- Timed
WaitsetsTimedOutand leaves the child running. A second wait after a successful reap setsAlreadyExited. - A failed stdin write sets
BrokenPipe.
- Breaking:
Variable::ExpandreturnsStormByte::Safe::String. On Windows, a failedExpandEnvironmentStringsWreturns the original text (same as a missing UNIX home). - Breaking: Process constructor arguments are
std::vector<StormByte::Safe::String>. - Pipe construction and I/O no longer throw. Invalid pipes convert to
false. - Public text across a DLL boundary uses
StormByte::Safe::String/StormByte::Safe::CString. - Breaking: System vendors StormByte Base 2.0.0 directly instead of StormByte-String and exposes Base's
StormByte::Safeowned-text types in its public API. Headers includeStormByte/safe/*.hxxinstead ofStormByte/string/*.hxx,StormByte/cstring.hxxandStormByte/wcstring.hxx. - Visibility macros follow Base/Logger (
EXPORTS/STORMBYTE_SYSTEM_SHARED/ static empty). - Windows Device probe links
iphlpapiandws2_32. Host CPU name linksadvapi32. macOS Device probe links IOKit and CoreFoundation. - Breaking:
Host::PageSize,PhysicalMemoryandAvailableMemoryreturnByteSize. They are octet lengths. - Breaking:
Device::WindowisByteSize.Device::Throughputstores octets per second asByteSize, notstd::size_t. - Breaking:
Process::operator>>andStderrtakeStormByte::Safe::String, notstd::string. The captured text is owned by Base.operator<<(std::ostream&, const Process&)isSTORMBYTE_FORCE_INLINE, so the stream buffer grows in the caller.operator<<onProcessandPipeacceptsstd::string_viewandString.operator>>staysStringonly: a view cannot own the bytes that were read. - Process path. Both constructors copy
std::filesystem::pathinside the DLL. The rvalue overload no longer moves the caller buffer intom_program.
Removed
- Breaking:
StormByte/system/exception.hxx(Exception,FileIOError,ExecutableNotFound,ProcessCreationError). - Breaking:
StormByte::System::ErrorandStormByte/system/error.hxx(domainStormByte.System). Device, Process, Directory, File, Host and ThisThread keep their own domains.