Skip to content
Snippets Groups Projects

small bagfixes and changes

Merged Evgeny Alexandrov requested to merge release-2.1.0_ev into release-2.1.0
4 files
+ 251
69
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 14
6
@@ -12,7 +12,7 @@ namespace Crest {
Bool, UChar, Int16, UInt16,
Int32, UInt32, UInt63, Int64,
Float, Double, String255, String4k,
String64k, String16M, Blob64k, Blob16M, TypeIdCount
String64k, String16M, String128M, Blob64k, Blob16M, Blob128M, TypeIdCount
};
static std::map<TypeId, std::string> s_typeToString = {
{ Bool, "Bool" },
@@ -29,8 +29,10 @@ namespace Crest {
{ String4k, "String4k" },
{ String64k, "String64k" },
{ String16M, "String16M" },
{ String128M,"String128M"},
{ Blob64k, "Blob64k" },
{ Blob16M, "Blob16M" }
{ Blob16M, "Blob16M" },
{ Blob128M, "Blob128M" }
};
enum ModeId{
@@ -43,10 +45,11 @@ namespace Crest {
nlohmann::json m_row={};
nlohmann::json m_iov_data={};
nlohmann::json m_vector_data=nlohmann::json::array();
nlohmann::json m_full_data={};
ModeId m_modeId;
bool m_isVectorPayload=false;
void validatePayloadSize() const;
void validatePayloadSize(const nlohmann::json &data) const;
nlohmann::json createRowArray(const nlohmann::json& data_row) const;
const nlohmann::json& getRow();
@@ -156,11 +159,11 @@ namespace Crest {
/**
* @brief It encodes the input string to base64.
*/
std::string base64_encode(const uint8_t* bytes_to_encode, unsigned int in_len);
static std::string base64_encode(const uint8_t* bytes_to_encode, unsigned int in_len);
/**
* @brief It decodes the input string from base64.
*/
std::vector<unsigned char> base64_decode(const std::string& encodedData);
static std::vector<unsigned char> base64_decode(const std::string& encodedData);
/**
* @brief It returns the index of the column with the given name.
* @param name The name of the column.
@@ -171,6 +174,9 @@ namespace Crest {
* @brief It reinitializes the containers.
*/
void flush();
void clear();
void selectIov(const uint64_t since);
std::vector<std::string> channelIds();
/**
* @brief It returns the json representation of the container.
*/
@@ -190,7 +196,9 @@ namespace Crest {
/**
* @brief It reads a json object to fill the containers.
*/
void from_json(const nlohmann::json& j);
void from_json(const uint64_t since, const nlohmann::json& j);
void parseOldFormat(std::string& colName, TypeId& typespec,const nlohmann::json & j);
};
}
#endif
Loading