Skip to content

Commit cf8210b

Browse files
committed
upd
1 parent 884bca5 commit cf8210b

File tree

2 files changed

+14
-28
lines changed

2 files changed

+14
-28
lines changed

BSON.h

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22
#include <Arduino.h>
3-
#include <GTL.h>
43
#include <StringUtils.h>
54
#include <limits.h>
5+
#include <GTL.h>
66

77
// ============== const ==============
88
#define BS_MAX_LEN ((size_t)0b0001111111111111)
@@ -27,33 +27,19 @@
2727
#define BS_LSB(x) ((x) & 0xff)
2828

2929
// ============== class ==============
30-
class BSON : private gtl::stack_uniq<uint8_t> {
30+
class BSON : private gtl::stack<uint8_t> {
31+
typedef gtl::stack<uint8_t> ST;
32+
3133
public:
32-
using gtl::stack_uniq<uint8_t>::write;
33-
using gtl::stack_uniq<uint8_t>::concat;
34-
using gtl::stack_uniq<uint8_t>::reserve;
35-
using gtl::stack_uniq<uint8_t>::addCapacity;
36-
using gtl::stack_uniq<uint8_t>::setOversize;
37-
using gtl::stack_uniq<uint8_t>::length;
38-
using gtl::stack_uniq<uint8_t>::buf;
39-
using gtl::stack_uniq<uint8_t>::clear;
40-
using gtl::stack_uniq<uint8_t>::move;
41-
42-
BSON() {}
43-
BSON(BSON& b) {
44-
move(b);
45-
}
46-
BSON(BSON&& b) {
47-
move(b);
48-
}
49-
BSON& operator=(BSON& b) {
50-
move(b);
51-
return *this;
52-
}
53-
BSON& operator=(BSON&& b) {
54-
move(b);
55-
return *this;
56-
}
34+
using ST::addCapacity;
35+
using ST::buf;
36+
using ST::clear;
37+
using ST::concat;
38+
using ST::length;
39+
using ST::move;
40+
using ST::reserve;
41+
using ST::setOversize;
42+
using ST::write;
5743

5844
// максимальная длина строк и бинарных данных
5945
static size_t maxDataLength() {

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=BSON
2-
version=2.0.5
2+
version=2.1.0
33
author=AlexGyver <alex@alexgyver.ru>
44
maintainer=AlexGyver <alex@alexgyver.ru>
55
sentence=Binary JSON packet builder for Arduino

0 commit comments

Comments
 (0)