forked from argandas/ardubson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ardubsonDocument.h
39 lines (33 loc) · 889 Bytes
/
ardubsonDocument.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
ardubson.h - Library for the BSON (Binary-JSON) format.
Created by Hugo Arganda (argandas), April 6, 2016.
Released into the public domain.
*/
/*
Check BSON specification at:
http://bsonspec.org/spec.html
*/
#ifndef ardubson_base_h
#define ardubson_base_h
#include "Arduino.h"
#include "ardubsonTypes.h"
#include "ardubsonConfig.h"
#include "ardubsonElement.h"
class BSONDocument
{
protected:
char _doc[BSON_DOC_SIZE];
uint32_t _idx;
bool _done;
char* index(void);
uint8_t appendNum(char value);
uint8_t appendBSONElement(BSONElement element);
uint8_t appendNum(uint32_t value);
uint8_t appendNum(int32_t value);
uint8_t appendNum(int64_t value);
uint8_t appendStr(const char *data);
public:
/* Clear builder buffer */
void reset(void);
};
#endif /* ardubson_base_h */