Giter VIP home page Giter VIP logo

ardubson's People

Contributors

argandas avatar ericonetto avatar guyikcgg avatar jpmanson avatar paul-hemsworth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ardubson's Issues

Check ardubsonConfig.h for errors

In the current state of the library, it does not make sense to have elements with bigger size than object builders. This should be checked on ardubsonConfig.h, just in the case the user changes it. Some errors and warnings could be prompted if the configuration is bizarre.

Give support for embedded objects

For the sake of completeness, embedded objects should be supported by the library.

This is a essential feature in JSON and BSON, since it allows to create a tree structure.

Reduce redundant use of memory

Could BSONObjBuilder have a collection of pointers referencing the elements it depends on instead of having a copy of them? This would greatly reduce the amount of memory needed by library objects, and would allow for some dynamic behaviors.

I suggest having a copy of the elements when they are appended using BSONObjBuilder::append(key, value), but using a pointer if BSONObjBuilder::append(BSONElement element) is used.

Float type is always showing 0.0

When I try to put the float value into the BSON object, after printing JSON I always get 0.0. Is there an example of a working float field inside BSON?

Code:

        BSONObjBuilder bob;
        BSONElement be;
        bob.append("1", (double)3.55);
        // Generate BSON Object
        BSONObject bo = bob.obj();

        // Get string object
        char *json = bo.jsonString();
        // Print BSON in JSON format
        Serial.print("JSON: ");
        Serial.println(json);

Result:

        JSON: {
            "1":0.000
        }
        Total Size of BSON raw data: 16
        BSON Element data (raw):
        0x10 0x00 0x00 0x00 0x01 0x31 0x00 0x00
        0x00 0x00 0xA0 0x33 0x33 0xE3 0xA5 0x00

Compilation errors "int32_t cannot be overloaded"

Getting errors while trying to compile:

In file included from .piolibdeps/ardubson/ardubson.h:15:0,
from src/main.cpp:17:
.piolibdeps/ardubson/ardubsonElement.h:32:14: error: 'void BSONElement::Value(int32_t)' 
cannot be overloaded
void Value(int32_t value);
^
.piolibdeps/ardubson/ardubsonElement.h:31:14: error: with 'void BSONElement::Value(int)'
void Value(int value);
^
In file included from .piolibdeps/ardubson/ardubson.h:16:0,
from src/main.cpp:17:
.piolibdeps/ardubson/ardubsonObjBuilder.h:42:25: error: 'BSONObjBuilder& BSONObjBuilder::append(const char*, int32_t)'
cannot be overloaded
BSONObjBuilder& append(const char *key, int32_t value);
^
.piolibdeps/ardubson/ardubsonObjBuilder.h:41:25: error: with 'BSONObjBuilder& BSONObjBuilder::append(const char*, int)'
BSONObjBuilder& append(const char *key, int value);
^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.