Class Bytes#

Class Documentation#

class Bytes#

Managed reference of byte array.

Public Functions

inline Bytes()#

default constructor

inline Bytes(const char *data, size_t size)#

constructor from size

Parameters:
  • data – The data pointer.

  • size – The size of the char array.

inline Bytes(TVMFFIByteArray bytes)#

constructor from TVMFFIByteArray

Parameters:

bytes – a char array.

inline Bytes(const std::string &other)#

constructor from std::string

Parameters:

other – a char array.

inline Bytes(std::string &&other)#

constructor from std::string

Parameters:

other – a char array.

inline void swap(Bytes &other)#

Swap this String with another string.

Parameters:

other – The other string

inline size_t size() const#

Return the length of the string.

Returns:

size_t string length

inline const char *data() const#

Return the data pointer.

Returns:

const char* data pointer

Public Static Functions

static inline int memncmp(const char *lhs, const char *rhs, size_t lhs_count, size_t rhs_count)#

Compare two char sequence.

Parameters:
  • lhs – Pointers to the char array to compare

  • rhs – Pointers to the char array to compare

  • lhs_count – Length of the char array to compare

  • rhs_count – Length of the char array to compare

Returns:

int zero if both char sequences compare equal. negative if this appear before other, positive otherwise.

static inline bool memequal(const void *lhs, const void *rhs, size_t lhs_count, size_t rhs_count)#

Compare two char sequence for equality.

Parameters:
  • lhs – Pointers to the char array to compare

  • rhs – Pointers to the char array to compare

  • lhs_count – Length of the char array to compare

  • rhs_count – Length of the char array to compare

Returns:

true if the two char sequences are equal, false otherwise.