Skip to content

Releases: StormBytePP/StormByte

Version 1.1.1

Choose a tag to compare

@StormBytePP StormBytePP released this 15 Sep 07:05

[Summary]

StormByte Base is the C++26 foundation of the StormByte suite.

Every other module links this library.
This repository is not Buffer, Config, Crypto, Database, Logger, Multimedia, Network or System — those live in their own repos and depend on Base.

Public headers under StormByte/ cover exceptions, Expected, little-endian Serializable, strings, paths, UUID v4, bitmasks, clonable types, ThreadLock, and StormByte::Type concepts.

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

Added

  • Type category concepts — LvalueReference and RvalueReference (std::is_lvalue_reference / std::is_rvalue_reference), next to the existing Reference.
  • SystemErrorException specialization for StormByte::System helpers.

Changed

  • System::ExecutablePath — throws SystemError instead of returning "NOPATH". Paths longer than 256 bytes are resolved.

Fixed

  • Type::CopyConstructible / CopyAssignable — no longer wrap std::is_copy_* alone. They require a real T{src} / dest = src and recurse into value_type only when T is a Type::Container and not a Type::View. std::span<std::unique_ptr<T>> stays copyable; std::vector<std::unique_ptr<T>> does not.
  • Type::HasPushBack / HasPushFront / HasInsert — accept value_type&& as well as const value_type&. std::vector<std::unique_ptr<T>> is now HasPushBack, so Iterable::add takes the push_back path.
  • Iterable::add — one forwarding add(T&&) plus a by-value sink for braced-init (add({"k", v})). The sink writes to the container; it does not call add again (that recursed until a stack overflow). clang-cl / MSVC no longer instantiate push_back(const unique_ptr&).
  • Iterable container constructor — single Iterable(C&&) constrained to Container. An lvalue copy requires Type::CopyConstructible on value_type; a move requires Type::MoveConstructible.
  • Iterable copy / move — defaulted copy and copy-assign require Type::CopyConstructible / Type::CopyAssignable on Container; move and move-assign require Type::MoveConstructible / Type::MoveAssignable. Iterable<std::vector<std::unique_ptr<T>>> is move-only.
  • Iterable::Iterator / ConstIterator — arithmetic (+=, -=, +, difference) uses std::advance / std::distance instead of m_it += n, so it compiles on bidirectional containers (list, map, set). reference / pointer come from std::iterator_traits of the wrapped iterator, not Container::reference (*it on std::set is const T&).
  • System::TempFileName — throws SystemError instead of std::runtime_error. The file is created and left on disk; the caller unlinks it. Windows still only uses the first three characters of prefix.
  • System::ExecutablePath — grows the platform buffer instead of truncating at 256 bytes (GetModuleFileNameW / readlink). Failure is SystemError, not a fake path.
  • System::CurrentPath — wraps std::filesystem::filesystem_error in SystemError instead of leaking a standard exception.
  • Iterable copy / copy-assign — user-provided members with if constexpr on Type::CopyConstructible / CopyAssignable. clang-cl / MSVC dllexport of a derived class no longer instantiates vector<unique_ptr<T>> copy via requires = default.

Version 1.1.0

Choose a tag to compare

@StormBytePP StormBytePP released this 13 Sep 19:20

[Summary]

StormByte Base is the C++26 foundation of the StormByte suite.

Every other module links this library.
This repository is not Buffer, Config, Crypto, Database, Logger, Multimedia, Network or System — those live in their own repos and depend on Base.

Public headers under StormByte/ cover exceptions, Expected, little-endian Serializable, strings, paths, UUID v4, bitmasks, clonable types, ThreadLock, and StormByte::Type concepts.

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

Added

  • Component — wrapper for the module name on the component-prefixed Exception constructor. Call sites must now write Exception(Component("Base64"), "…", args...).
  • Type concepts — Sized, SmartPointer, Swappable, DerivedFrom, EqualityComparable, ThreeWayComparable, Hashable.
  • Type range and pointer concepts — range/iterator category wrappers, range value/reference/difference aliases, ExplicitlyConvertibleTo, NullablePointer, ByteInputRange, and ByteInputIterator for public generic APIs.
  • Type object-semantics concepts — TriviallyDefaultConstructible, TriviallyCopyConstructible, CopyAssignable, TriviallyCopyAssignable, TriviallyMoveConstructible, MoveAssignable, TriviallyMoveAssignable, Copyable, Movable, rounding out the existing CopyConstructible/MoveConstructible/TriviallyCopyable/TriviallyDestructible/Swappable group.
  • Test handlers — assertions evaluate operands once and report non-streamable values safely. New macros: ASSERT_THROWS, ASSERT_NO_THROW, ASSERT_NEAR, ASSERT_CONTAINS, ASSERT_NOT_NULL, covered by TestHandlersTests.
  • UTF8Error — custom exception for invalid UTF-8 and wide-string Unicode input.

Changed

  • Exception(component, fmt, args...) — first argument is Component, not std::string. Source-breaking for every call that used the old two-string form.
  • Type concepts — reorganized type_traits.hxx into focused container, wrapper, conversion, category, range, relation, and comparison groups without changing public contracts.
  • Template implementation splitBitmask, Clonable, Iterable (including its nested Iterator/ConstIterator), and Serializable now declare their members in the .hxx header and define them in a matching .txx file included at the bottom of the header. Public API and behavior are unchanged; .txx files are installed alongside the headers.
  • Serializable explicit instantiationbool, all standard character/integer/floating-point types, and the four Codec-backed string types (std::string, std::wstring, std::u16string, std::u32string) are now explicitly instantiated inside the shared/dynamic library and declared extern template in the header, so consumers link against the library's code instead of re-instantiating it locally.

Removed

  • StormByte::swap_endian — the transitional alias of Type::Detail::swap_endian in the root StormByte namespace. Call StormByte::Type::Detail::swap_endian directly instead.

Fixed

  • Exception(component, fmt, args...)Exception(fmt, args...) was chosen for every call with 2+ arguments, so the component string became the whole message and the format/args were discarded. Component makes the prefixed overload the only viable candidate.
  • Exception(format_string, Args...) — the zero-argument path called copy_str(fmt), which did not compile when that branch was selected (e.g. construction from std::string_view). It now copies fmt.get(), matching the documented “message as-is” behaviour.
  • Iterable::addadd(const value_type&) requires Type::CopyConstructible; add(value_type&&) requires Type::MoveConstructible. clang-cl / MSVC no longer instantiate push_back(const unique_ptr&).
  • Iterable::Iterator / ConstIteratoriterator_category is taken from the underlying container iterator instead of being hardcoded as random_access_iterator_tag. std::distance / std::advance compile on Iterable<std::list<…>>, map, set, etc.
  • System::TempFileName — builds the mkstemp template in a std::string sized to the prefix instead of a 256-byte buffer, so a long prefix no longer truncates the trailing XXXXXX.
  • Serializablestd::array — deserializes elements by index and rejects a serialized count that does not match the array extent.
  • Serializable constrained helpers — container/pair/optional/trivial private helpers are member templates (template<typename U = T> requires Type::* <U>) so template class Serializable<bool> / char no longer instantiate bodies that call .size() on a scalar (clang-cl / clang++).
  • Unexpected(Derived) — no longer conflicts with Unexpected<E>(error) when Base and Derived are the same type.
  • StringToLower / ToUpper no longer pass negative signed values to the C character functions; negative byte sizes keep their sign instead of wrapping.
  • String UTF-8 conversion — wide-string conversion is now locale-independent and rejects malformed Unicode input with UTF8Error.

Version 1.0.0

Choose a tag to compare

@StormBytePP StormBytePP released this 04 Sep 23:00

[Summary]

StormByte Base is the C++26 foundation of the StormByte suite.

Every other module links this library.
This repository is not Buffer, Config, Crypto, Database, Logger, Multimedia, Network or System — those live in their own repos and depend on Base.

Public headers under StormByte/ cover exceptions, Expected, little-endian Serializable, strings, paths, UUID v4, bitmasks, clonable types, ThreadLock, and StormByte::Type concepts.

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

Initial public release of StormByte Base.

Added

  • Exception hierarchy with DLL-safe const char* storage and std::format support
  • Expected<T, E> on std::expected with reference support and shared error ownership (Unexpected helpers)
  • Serializable template
    • Trivially copyable types, STL containers, std::pair and std::optional
    • Detail::Codec for std::string, std::wstring, std::u16string and std::u32string
    • Zero-copy input via std::span<const std::byte>
    • Little-endian on the wire
  • Base64 encode / decode (standard alphabet, whitespace-tolerant decoder)
  • Bitmask CRTP for unsigned flag enums (|, &, ^, ~, Add, Remove, Has, HasAny, HasNone)
  • Clonable for smart-pointer clone / move (std::shared_ptr / std::unique_ptr)
  • ThreadLock — owner-tracked lock; the owner may reenter; Unlock from a non-owner is a no-op
  • String utilities
    • Case conversion (ToLower / ToUpper)
    • Splitting (Explode, Split)
    • Human-readable number and byte-size formatting
    • UTF-8 ↔ wide string conversion
    • Byte vector ↔ string conversion
    • Whitespace removal, newline sanitization, integer detection
  • System utilities
    • TempFileName()
    • CurrentPath() (process cwd)
    • ExecutablePath() (directory of the running executable)
    • Sleep() for any std::chrono::duration
  • UUID generation (GenerateUUIDv4() — RFC 4122 version 4)
  • Type concepts under StormByte::Type (String, Container, Optional, Pair, enums, …)
  • Platform macros (WINDOWS, LINUX, MACOS, UNIX, BIT32 / BIT64)
  • Compiler macros: CLANG (including clang-cl), GCC, MSVC (MSVC only; not clang-cl)
  • Visibility macros for shared builds
  • Unit tests, including serialization robustness

Changed

  • Serialization size fields on the wire are std::uint64_t (8 bytes). 32-bit and 64-bit hosts interchange.
  • System::CurrentPath() is the process cwd. The old meaning is ExecutablePath().

Fixed

  • Base64Decode documentation matches the lenient decoder (whitespace ignored, stops at first =, padding accepted but not strictly checked).
  • CurrentPath() documentation matches the implementation.

Notes

  • First stable release of StormByte Base.
  • The binary serialization layout is stable.
  • Needs a C++26 compiler and CMake ≥ 3.28.
  • Foundation for Buffer, Config, Crypto, Database, Logger, Multimedia, Network and System.