7#ifndef BUFFERHELPER_HPP
8#define BUFFERHELPER_HPP
13#include <logicalaccess/lla_core_api.hpp>
24 static std::string toBase64(
const ByteVector &buf);
26 static ByteVector fromBase64(
const std::string &b64str);
28 static std::string getHex(
const ByteVector &buffer);
30 static std::string getHex(
const std::string &buffer);
32 static ByteVector fromHexString(std::string hexString);
34 static std::string getStdString(
const ByteVector &buffer);
36 static void setUShort(
ByteVector &buffer,
const unsigned short &value);
38 static unsigned short getUShort(
const ByteVector &buffer,
size_t &offset);
40 static void setInt32(
ByteVector &buffer,
const long &value);
42 static long getInt32(
const ByteVector &buffer,
size_t &offset);
44 static unsigned long getUInt32(
const ByteVector &buffer,
size_t &offset);
46 static void setUInt32(
ByteVector &buffer,
const unsigned long &value);
48 static void setUInt64(
ByteVector &buffer,
const unsigned long long &value);
50 static uint64_t getUInt64(
const ByteVector &buffer,
size_t &offset);
52 static void setUInt16(
ByteVector &buffer,
const unsigned long &value);
54 static unsigned long getUInt16(
const ByteVector &buffer,
size_t &offset);
56 static void setString(
ByteVector &buffer,
const std::string &value);
61 template <
typename Buffer>
64 for (
const auto &
byte : buf)
A buffer helper class.
Definition: bufferhelper.hpp:22
static bool allZeroes(const Buffer &buf)
Definition: bufferhelper.hpp:62
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80