LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
BitsetStream.hpp
Go to the documentation of this file.
1
2#ifndef LOGICALACCESS_BITSETSTREAM_HPP
3#define LOGICALACCESS_BITSETSTREAM_HPP
4
5#include <vector>
6#include <stdint.h>
7#include <iostream>
8
9#include <logicalaccess/lla_core_api.hpp>
11
12namespace logicalaccess
13{
14class LLA_CORE_API BitsetStream
15{
16 public:
18
19 BitsetStream(unsigned char data, unsigned int byteSize);
20
21 BitsetStream(unsigned long long bitsSize);
22
24
25 void append(unsigned char data);
26
27 void append(unsigned char data, unsigned int readPosStart);
28
35 void append(unsigned char data, unsigned int readPosStart, unsigned int readLength);
36
37 void concat(const BitsetStream &data);
38
39 void concat(const ByteVector &data);
40
41 void concat(const ByteVector &data, unsigned int readPosStart);
42
43 void concat(const ByteVector &data, unsigned int readPosStart,
44 unsigned int readLength);
45
46 void writeAt(unsigned int pos, unsigned char data, unsigned int readPosStart = 0,
47 unsigned int readLength = 8);
48
49 void writeAt(unsigned int pos, ByteVector const &data, unsigned int readPosStart,
50 unsigned int readLength);
51
52 void insert(unsigned int pos, unsigned char data, unsigned int readPosStart = 0,
53 unsigned int readLength = 8);
54
55 void insert(unsigned int pos, ByteVector const &data, unsigned int readPosStart,
56 unsigned int readLength);
57
58 ByteVector getData() const;
59
60 unsigned int getByteSize() const;
61
62 unsigned int getBitSize() const;
63
64 std::string toString(size_t begin, size_t end) const;
65
66 std::string toString() const;
67
68 unsigned long toULong() const;
69
70 unsigned long long toULLong() const;
71
72 bool test(size_t index) const;
73
74 bool none() const;
75
76 bool any() const;
77
78 bool all() const;
79
80 void clear();
81
82 private:
84
85 unsigned int _pos;
86};
87}
88
89#endif // LOGICALACCESS_BITSETSTREAM_HPP
Definition: BitsetStream.hpp:15
ByteVector stream
Definition: BitsetStream.hpp:83
unsigned int _pos
Definition: BitsetStream.hpp:85
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
Definition: asn1.hpp:9