Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thedome/qt-json-rs
A QT JSON Parser for Rust
https://github.com/thedome/qt-json-rs
json qt5 rust
Last synced: 3 days ago
JSON representation
A QT JSON Parser for Rust
- Host: GitHub
- URL: https://github.com/thedome/qt-json-rs
- Owner: TheDome
- License: bsd-3-clause
- Created: 2021-11-21T11:42:48.000Z (about 3 years ago)
- Default Branch: develop
- Last Pushed: 2024-01-18T01:42:50.000Z (about 1 year ago)
- Last Synced: 2024-04-26T03:43:57.696Z (9 months ago)
- Topics: json, qt5, rust
- Language: Rust
- Homepage:
- Size: 90.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# qt-json
[![codecov](https://codecov.io/gh/TheDome/qt-json-rs/branch/develop/graph/badge.svg?token=7MIOMJ88B1)](https://codecov.io/gh/TheDome/qt-json-rs)
[![crates.io](https://img.shields.io/crates/v/qt-json.svg)](https://crates.io/crates/qt-json)A simple parser for the Internal Qt Binary JSON data format.
This parser will transform the popular
[QTBinary JSON](https://doc.qt.io/qt-6.2/qbinaryjson.html#toBinaryData)
format into usable format for rust applications.## Use
Simply provide a binary encoded JSON Array to the function and it will parse it into an
internal JSON structure:```rust
use qt_json::QJSONDocument;fn main(){
let json_data = b"qbjs\
\x01\x00\x00\x00\
\x10\x00\x00\x00\
\x02\x00\x00\x00\
\x0C\x00\x00\x00\
\x4A\x01\x00\x00";let document = QJSONDocument::from_binary(json_data.to_vec()).unwrap();
println!("{:?}", document);
}
```## Disclaimer
This library has been created by looking at the Qt source code and performing reverse
engineering.
There is a possibility that the code will not work with other Version of Qt JSON documents.
Any help with this library is welcome.License: BSD-3-Clause