10Duke Enterprise C++ SDK
Toggle main menu visibility
Loading...
Searching...
No Matches
FixedSizeBinaryData.h
1
#ifndef TENDUKE_UTL_FIXEDSIZEBINARYDATA_H
2
#define TENDUKE_UTL_FIXEDSIZEBINARYDATA_H
3
4
#include "./BinaryData.h"
5
6
#include <memory>
7
8
namespace
tenduke
{
namespace
utl
{
9
10
16
class
FixedSizeBinaryData
:
public
tenduke::utl::BinaryData
17
{
18
public
:
23
explicit
FixedSizeBinaryData
(std::size_t length);
24
30
FixedSizeBinaryData
(std::unique_ptr<
unsigned
char
[]>
data
, std::size_t length);
31
37
FixedSizeBinaryData
(
const
unsigned
char
*
data
, std::size_t length);
38
43
FixedSizeBinaryData
(
const
FixedSizeBinaryData
©);
44
49
explicit
FixedSizeBinaryData
(
const
BinaryData
©);
50
55
explicit
FixedSizeBinaryData
(const ::tenduke::utl::DataSpan ©);
56
57
60
~FixedSizeBinaryData
()
override
;
61
67
static
std::unique_ptr<unsigned char[]>
allocateData
(
size_t
length);
68
69
// BinaryData interface
70
public
:
75
unsigned
char
*
getData
()
const override
;
76
81
std::size_t
getLength
()
const override
;
82
83
private
:
84
const
std::unique_ptr<unsigned char[]> data_;
85
const
std::size_t length_;
86
};
87
88
89
}}
90
91
#endif
// TENDUKE_UTL_FIXEDSIZEBINARYDATA_H
FixedSizeBinaryData::FixedSizeBinaryData
FixedSizeBinaryData(std::size_t length)
Constructs new instance by allocating memory of length bytes.
tenduke::utl::BinaryData
A holder of binary data.
Definition
BinaryData.h:14
tenduke::utl::BinaryData::data
unsigned char * data() override
Returns a mutable view of the underlying data.
Definition
BinaryData.h:28
tenduke::utl::FixedSizeBinaryData::FixedSizeBinaryData
FixedSizeBinaryData(std::unique_ptr< unsigned char[]> data, std::size_t length)
Constructs new instance by taking ownership of given data.
tenduke::utl::FixedSizeBinaryData::~FixedSizeBinaryData
~FixedSizeBinaryData() override
Destructs the instance, frees contained data.
Definition
FixedSizeBinaryData.cpp:47
tenduke::utl::FixedSizeBinaryData::getLength
std::size_t getLength() const override
Returns length of the data.
Definition
FixedSizeBinaryData.cpp:58
tenduke::utl::FixedSizeBinaryData::FixedSizeBinaryData
FixedSizeBinaryData(std::size_t length)
Constructs new instance by allocating memory of length bytes.
tenduke::utl::FixedSizeBinaryData::getData
unsigned char * getData() const override
Returns pointer to the data.
Definition
FixedSizeBinaryData.cpp:53
tenduke::utl::FixedSizeBinaryData::FixedSizeBinaryData
FixedSizeBinaryData(const unsigned char *data, std::size_t length)
Constructs new instance by copying the provided data.
tenduke::utl::FixedSizeBinaryData::allocateData
static std::unique_ptr< unsigned char[]> allocateData(size_t length)
Allocates memory for length bytes.
Definition
FixedSizeBinaryData.cpp:71
tenduke::utl
Utilities.
Definition
Base64Decoder.h:10
tenduke
Root for classes, functions and globals of 10Duke C++ Client.
Definition
APIRequest.h:4
core
core
src
utl
FixedSizeBinaryData.h
Generated by
1.17.0