Repository navigation
Version 2.0.0
[Summary]
StormByte Config is the configuration-document module of the StormByte C++ suite.
It depends on StormByte Base ≥ 2.0.0. This repository is not Base, Buffer, Crypto, Database, Logger, Multimedia, Network or System.
Public headers under StormByte/config/ cover text and versioned binary documents: values, groups, lists, comments, hooks and Save / Load.
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: GNU Lesser General Public License version 3 or later, LICENSE
Changed
- Config item classes are registered with Base's
MaybeSafetrait when their Base-owned storage and out-of-line destruction satisfy the documented DLL-boundary contract. Plain exception messages acceptstd::string_viewand are copied into Base-owned exception storage inside the Config module. - Shared vs static follows CMake
BUILD_SHARED_LIBS(declared in the project root, default ON). There is noSTORMBYTE_CONFIG_SHAREDCMake option. When the library is shared, the compile definitionSTORMBYTE_CONFIG_SHAREDis still set sovisibility.hcan distinguishdllexport/dllimport/ static. CI passes-DBUILD_SHARED_LIBS=ON. - Breaking: Item model and storage APIs:
Item::Value<T>is gone. There is one concreteItem::Valueleaf. Typed access isBase::As<T>(): node types (Value,Group,List,Comment<...>) or leaf tags (Integer,Double,Bool,Text,Binary).item.As<Value>() = 3.65andint i = item.As<Integer>()are the public getters. Integer promotes to Double; Double does not narrow to Integer.- Public binary payloads are
StormByte::Safe::Binary, notstd::vector<std::byte>. Text still uses Base64b"..."; the binary writer emitsSerializable<Safe::Binary>. - Counts and container indices use
StormByte::Size.operator[]onList/GroupisSize, notsize_t. Item::BaseisClonable<Base, StormByte::Safe::Shared<Base>>.PointerTypeis no longerstd::shared_ptr. Construction goes throughMakePointer.Serializable::SerializeisSafe::Binary; the on-disk reader buffer stays a localstd::vector<std::byte>.- Configuration names, text values and comments use
StormByte::Safe::Stringfrom Base. Text binary serialization uses Base'sSerializable<Safe::String>codec. The scalar payload is aSafe::Variant. - Item collections use
StormByte::Safe::Vector; path traversal usesStormByte::Safe::Queue. Public STL convenience adapters run on the consumer side; text, binary data and expected results use Base-owned storage across DLL boundaries.
- Breaking: DLL-boundary lifetime and exception contracts:
- Item and Config destructors are out of line in this module so
catchandtypeidstay on one CRT across a DLL. StormByte::Config::Exceptionuses its own explicitPathwrapper for additional segments nested belowStormByte.Config; a custom segment can never replaceConfig.Componentis gone, andwhat()starts withStormByte.Config.- Item classes and
Configare registered with Base'sMaybeSafetrait only where construction, copy/move, assignment, destruction, storage ownership, and heap-affecting clone operations meet its documented provider contract. Plain Config exception messages acceptstd::string_viewand are copied inside the Config module.
- Item and Config destructors are out of line in this module so
- Breaking: Read and failure hook API: Hooks use copyable
StormByte::Safe::Functionvalues. Read callbacks receive a Base-ownedSafe::Shared<Item::Group>handle and commit mutations only when the callback succeeds; failure callbacks receive a Base-owned const group handle and return whether the parse error should propagate.MakeReadHook/MakeFailureHookkeep callable context cloning and release in the consumer module, including for capturing lambdas. Hook collections use Base-ownedSafe::Vectorstorage. Hook objects are built withSafe::MakeShared. - Names, paths,
Group,ListandValueacceptstd::string_view(a literal, astd::stringor aSafe::String).Item::Valuealso takesconst char*for a text literal, because a pointer would otherwise preferbool. A custom Config exception path is anException::Pathplus a plain message. - Requires StormByte Base ≥ 2.0.0.