Streamable 1.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Streamable --version 1.1.1
NuGet\Install-Package Streamable -Version 1.1.1
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.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Streamable --version 1.1.1
#r "nuget: Streamable, 1.1.1"
#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.
// Install Streamable as a Cake Addin
#addin nuget:?package=Streamable&version=1.1.1

// Install Streamable as a Cake Tool
#tool nuget:?package=Streamable&version=1.1.1

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.4.0 98 4/11/2024
1.3.0 138 3/15/2024
1.2.1 163 3/10/2024
1.2.0 166 3/6/2024
1.1.2 282 10/31/2023
1.1.1 195 10/29/2023
1.1.0 226 10/29/2023
1.0.0 173 10/21/2023

now variadic templates ReadlAll, WriteAll, FindParseSize are working with no args
added a release method for the underlying container of the Stream
exposed the Peek method from Stream and added an offset parameter
changed the base type from char to uint8_t for the Stream