Streamable 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Streamable --version 1.2.0
                    
NuGet\Install-Package Streamable -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Streamable" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Streamable" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Streamable" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Streamable --version 1.2.0
                    
#r "nuget: Streamable, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Streamable@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Streamable&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Streamable&version=1.2.0
                    
Install as a Cake Tool

Streamable

This library is all about speedy data parsing, churning out super small byte streams.

Table of Contents

Installation

To use this library, simply get and include the header file Streamable.hpp into your project.

Features

  • fast - the parsing represents just a simple iteration, knows where every object is and how big it is, for example it reserves the memory for ranges that allow it before adding elements etc...
  • easy-to-use - inherit a class and use a macro
  • single-header - just copy paste the file in your project
  • simple format - contains just the data itself and for the types that have a dynamic size a metadata representing just a uint32_t
  • has no dependencies - uses just the standard library
  • accepts multiple data types - beside itself (as a pointer or not) ofc, primitive types (ex.: bool, unsigned int, double etc...), strings (ex.: std::string. std::wstring etc...), any type with standard layout (ex.: POD structs and classes, enums, etc...), nested ranges (ex.: vector, list, vector<list> etc...)

Usage

  1. Inherit from the IStreamable class or any class that implements it.
  2. Use the macro STREAMABLE_DEFINE where you need to pass the base class and the objects you want to parse
  3. OPTIONAL If there are derived classes as base class pointers to parse you MUST implement FindDerivedStreamable

Examples

Documentation

There are 5 macros:

  • STREAMABLE_DEFINE - implements the necessary methods for parsing
  • STREAMABLE_DEFINE_INTRUSIVE - there are some streamable methods that are not public and needs to be accessed
  • STREAMABLE_DEFINE_TO_STREAM - implements the ToStream method
  • STREAMABLE_DEFINE_FROM_STREAM - implements the FromStream method
  • STREAMABLE_DEFINE_FIND_PARSE_SIZE - implements the FindParseSize method

And a method that MUST be implemented in order to deserialize BaseClass* which returns a default BaseClass*: FindDerivedStreamable

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.5.0 133 11/2/2024
1.4.0 173 4/11/2024
1.3.0 193 3/15/2024
1.2.1 220 3/10/2024
1.2.0 225 3/6/2024
1.1.2 324 10/31/2023
1.1.1 250 10/29/2023
1.1.0 276 10/29/2023
1.0.0 223 10/21/2023

added support for std::tuple, std::pair, std::variant, std::optional, std::map, std::unique_ptr, std::shared_ptr