IoDeSer 0.4.11

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

Nuget

Introduction

Repository stores code for C# library that allows to read from and write to .io file format. Written in .NET Standard 2.0

About

.io file is a text format that contains serialized object. Each object is stored between two vertical bars |X| in one line for primitive object or more, for iterables and structures. It is build to be cross-platform, language-independent and human-readable.

You can read more about .io de/serialization file format goal and mission here.

Functions and plans

  • Primitive types (int, char)
  • Strings
  • Classes and structures
  • Arrays (and jagged arrays)
  • Any IEnumerable collection (List)
  • Dictionaries
  • Dates and time
  • Null
  • Multidimensional arrays are planned

Capabilities

  • Serialization of supported types to string or stream using static methods WriteToString / WriteToFile,
  • Deserialization of supported types from or stream using static methods ReadFromString / ReadFromFile,
  • Renaming class properties in serialized string using IoItemName attribute,
  • Changing order of properties in class in serialized string using IoItemOrder (for specific property) / IoItemsOrder (for the whole class),
  • Ignoring public properties in serialization with IoItemIgnore attribute.

Refer to example below to see, how you can utilize those capabilities and how they affect the serialized string.

Example usage

using IoDeSer;
using IoDeSer.Attributes;
using IoDeSer.Attributes.Ordering;
using System.Diagnostics;

namespace ProgramNamespace
{
    class Person<T>
    {
        [IoItemName("FirstName")]
        public string Name { get; set; }
        [IoItemOrder(ItemOrder.LAST)]
        public string SecondName { get; set; }
        [IoItemName("Surname")]
        public string LastName { get; set; }
        [IoItemOrder(2)]
        public byte Age { get; set; }
        [IoItemOrder(ItemOrder.FIRST)]
        public List<Address<T>> Addresses { get; set; }
    }

    [IoItemsOrder(ItemsOrder.SHORTEST_FIRST)]
    class Address<T>
    {
        public string City { get; set; }
        public string StreetName { get; set; }
        public T Number { get; set; }
    }

    internal class Program
    {
        static void Main(string[] args)
        {
            Person<int> person = new Person<int>()
            {
                Name="John", SecondName=null, LastName="Smith", Age=36,
                Addresses = new List<Address<int>>
                {
                    new Address<int> {City="Hamburg", StreetName="Strasse", Number=55},
                    new Address<int> {City="Las Vegas", StreetName="Black", Number=1549}
                }
            };

            string io_string = IoFile.WriteToString(person);
            Console.Write(io_string);
            Person<int> read_person = IoFile.ReadFromString<Person<int>>(io_string);
            Debug.Assert(read_person.Name == person.Name);
            Debug.Assert(read_person.Age == person.Age);
            Debug.Assert(read_person.Addresses[1].City == person.Addresses[1].City);
        }
    }
}

/*
Output:
|
        Addresses->|
                |
                        City->|Hamburg|
                        Number->|55|
                        StreetName->|Strasse|
                |
                +
                |
                        City->|Las Vegas|
                        Number->|1549|
                        StreetName->|Black|
                |
        |
        Surname->|Smith|
        Firstname->|John|
        SecondName->|||
|
 */
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • 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
0.5.0 105 2/28/2025
0.4.11 112 2/20/2025
0.4.10 102 2/16/2025
0.4.9 153 3/18/2024
0.4.8 139 3/15/2024
0.4.7 121 2/24/2024
0.4.6 121 2/23/2024
0.4.5 127 2/23/2024
0.4.4 167 2/22/2024
0.4.3 224 12/14/2023
0.4.2 186 10/30/2023
0.4.0 181 7/25/2023
0.3.4 174 7/14/2023

Fixed serialization with correct type using reflection and not System.Object.