whiztim / ubjsoncpp Goto Github PK
View Code? Open in Web Editor NEWA high performance C++14 library for effortlessly reading and writing UBJSON
A high performance C++14 library for effortlessly reading and writing UBJSON
If I readf the code correctly then support for High-Precision Numbers missing, or did I miss something?
Binary read+write support. How many days is this out? If I don't have it soon I may have to write it myself
//else if(v.isBinary()) // k = append_binary(v); //currently not supported
Given this code
using namespace ubjson;
Value m;
m = "Hello UBJSON"
static_cast<std::string>(std::move(m))
//or
//static_cast<std::string&&)(m)
ASSERT(m.type() == Type::String); //this assertion fires
Given, that no object recieved the rvalue
conversion, this object is still a string
The support for homogeneous arrays is missing. see StreamWriter<StreamType>::append_array
//! \todo TODO... detect homogeneous arrays and treat accordingly
//! WORK in progress
I think you made this difficult because you got the binary type wrong. I.E there is not one binary type, but all the strong typed arrays are different binary types. One should be able to write something like:
std::vector<int> ints = foo();
ubjson::Value value;
value["ints"] = ints;
and that should serialize into
[{][i][4][ints][[][$][I][#][i][5][1][2][3][4][5]
Note the [$][I]
. The type of the array should be kept as passed in so that it is received that way.
If I read the source code correctly then the No-Op value is not considered. This is especially important for the streams.
Many operating systems do not have an <endian.h>
file. This is used in stream_helpers.hpp
. Consider adding a portable <endian.h> file
I thought this was supposed to be a portable library.
Is it possible to use this library to convert between plain text json (stored as std::string
) and ubjson?
The test code
unsigned int ui = 42u;
unsigned long ul = 42u;
value["unsigned int"] = ui;
value["unsigned long"] = ul;
does not compile because of ambiguity. To remove the ambiguity, additional constructors must be added.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.