Comments (9)
Bitsets do map to BEVE. From the spec:
Boolean arrays are stored using single bits for booleans and packed to the nearest byte.
from glaze.
Specifically, how would you want that serialized and how would you want that deserialized?
A string of 1's & 0's or an array of 1's & 0's would both make sense for humans. As for compactness, an array of the largest possible integers or a string of bytes, not characters, would be the smallest.
from glaze.
I feel like a string of 1s and 0s would be a good balance of human readable and more compact than an array.
from glaze.
Seems reasonable. If MSB is on the left, it would be enacting the same behaviour as to_string().
from glaze.
I think a string is a good approach, as you could also add a decorator (suffix/prefix) if you wanted to as well. The choice of a decorator, and which one to use, is up to you guys. For binary representations, I would think '0b' would be a good option.
from glaze.
Yeah, matching to_string() behavior like "10101100"
would be great. We could allow "0b10101100"
, but I'm a bit cautious about this, because any time you allow multiple formats, it becomes more confusing to document and is slower if this is a runtime option. A user could easily add their own custom serializer/de-serializer to include 0b
. But, I would just have Glaze read/write as "10101100"
for now.
from glaze.
Yeah on second thought, thats a good call
from glaze.
@stephenberry Supporting bitset for binary formats seems like a no-brainer. Do bitsets map to BEVE?
from glaze.
Support has been added for JSON and BEVE read/write of std::bitset as of #526
from glaze.
Related Issues (20)
- Need more examples and improved documentation HOT 5
- Add support for unions (like variants) HOT 9
- Document current support and add more support for JSON Merge Patch
- `validate_json` returns `syntax_error` if buffer contains non-ASCII chars HOT 3
- Support 0 and 1 as boolean values HOT 1
- Bazel support HOT 2
- ASIO REPE example bad file descriptor error HOT 2
- minify_json compiler errors when including header directly HOT 5
- Function signatures inconsistency between write_file_json and read_file_json HOT 2
- Stack overflow when returning intermediate object to serialize in_addr HOT 6
- Bug: Malformed JSON string produced HOT 10
- Build and test for 32-bit in Actions
- std::pair arrays roundtrip
- `float` member issue with `clang++-15` and `g++-12` HOT 3
- `json_test.cpp(7840): warning C4267: '=': conversion from 'size_t' to 'uint16_t', possible loss of data` HOT 1
- glz::reader/glz::writer for incremental reading/writing HOT 5
- Partial read for BEVE
- glz::raw without quotes question HOT 1
- Binary serialization of hidden members HOT 2
- error: constructor priorities are not supported 3316 | const char* argv[]) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glaze.