Skip to content

tsung-wei-huang/cpp-ciri

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cpp-Ciri

Standard

A fast modern C++ header-only serialization library

Simple, Compact, and Extensible Serialization

#include "ciri.hpp"                       // ciri is header-only

int main() {
  
  int from{100}, to{0};                   // data to serialize and deserialize

  std::ostringstream os;                  // create an output device with a write method
  ciri::Ciri ciri(os);                    // create a serializer "ciri"

  auto obytes = os(from);                 // serialize an integer
  
  std::istringstream is(os.str());        // create an input device with a read method
  ciri::Iric iric(is);                    // create a deserializer "iric"

  auto ibytes = is(to);                   // deserialize an integer
   
  assert(from == to && obytes == ibytes);
}