Skip to content

Latest commit

 

History

History
56 lines (42 loc) · 1.3 KB

README.md

File metadata and controls

56 lines (42 loc) · 1.3 KB

A lite serialization solution

there are several lib out there support serialization,like protobuffer,flatbuffers,capnproto. Need schema file for generating source files, which is cool between peers of different language. but that is too heavy for only local serialization. so I wrote this lite version.only support c++. If your just want to serialize & deserialize data on the same machine. I think it is a good choice. simple as it is , hack whatever u want.

Only Head file needed

src/core/serialization.h 

that`s it!You are set to go!

support

  • vector
  • list
  • map
  • set
  • string
  • primitives(int,double,long,...)
  • nesting container support
Obj : implements serialize:I interface
vector<map<int, Obj*> >  
vector<vector<string> >  
vector<list<string> >  
vector<customer_struct>
vector<Obj> 
vector<string>  
  • endian auto conversion
    no need to worry about endian problem.all data is writed in little endian.

use char instead bool in STL why

build

you can build this project by CMake. or just import serialization.h into your project.

cmake build process:

	mkdir prj
	cd prj
	cmake ..

if it doesn`t work. set compile flags to c++11

demo

check testSerialization.cpp