ONE - On-device Neural Engine
Loading...
Searching...
No Matches
flexbuffers::String Class Reference

#include <flexbuffers.h>

Collaboration diagram for flexbuffers::String:

Public Member Functions

 String (const uint8_t *data, uint8_t byte_width)
 
 String (const uint8_t *data, uint8_t byte_width, size_t sz)
 
size_t length () const
 
const char * c_str () const
 
std::string str () const
 
bool IsTheEmptyString () const
 
- Public Member Functions inherited from flexbuffers::Sized
 Sized (const uint8_t *data, uint8_t byte_width)
 
 Sized (const uint8_t *data, uint8_t byte_width, size_t sz)
 
size_t size () const
 
size_t read_size () const
 
- Public Member Functions inherited from flexbuffers::Object
 Object (const uint8_t *data, uint8_t byte_width)
 

Static Public Member Functions

static String EmptyString ()
 

Additional Inherited Members

- Protected Attributes inherited from flexbuffers::Sized
size_t size_
 
- Protected Attributes inherited from flexbuffers::Object
const uint8_t * data_
 
uint8_t byte_width_
 

Detailed Description

Definition at line 243 of file flexbuffers.h.

Constructor & Destructor Documentation

◆ String() [1/2]

flexbuffers::String::String ( const uint8_t *  data,
uint8_t  byte_width 
)
inline

Definition at line 247 of file flexbuffers.h.

247: Sized(data, byte_width) {}
Sized(const uint8_t *data, uint8_t byte_width)

◆ String() [2/2]

flexbuffers::String::String ( const uint8_t *  data,
uint8_t  byte_width,
size_t  sz 
)
inline

Definition at line 249 of file flexbuffers.h.

249: Sized(data, byte_width, sz) {}

Member Function Documentation

◆ c_str()

const char * flexbuffers::String::c_str ( ) const
inline

Definition at line 252 of file flexbuffers.h.

252{ return reinterpret_cast<const char *>(data_); }
const uint8_t * data_

References flexbuffers::Object::data_.

Referenced by str().

◆ EmptyString()

static String flexbuffers::String::EmptyString ( )
inlinestatic

Definition at line 255 of file flexbuffers.h.

256 {
257 static const char *empty_string = "";
258 return String(reinterpret_cast<const uint8_t *>(empty_string), 1, 0);
259 }
String(const uint8_t *data, uint8_t byte_width)

Referenced by flexbuffers::Reference::AsString(), and IsTheEmptyString().

◆ IsTheEmptyString()

bool flexbuffers::String::IsTheEmptyString ( ) const
inline

Definition at line 260 of file flexbuffers.h.

260{ return data_ == EmptyString().data_; }
static String EmptyString()

References flexbuffers::Object::data_, and EmptyString().

◆ length()

size_t flexbuffers::String::length ( ) const
inline

Definition at line 251 of file flexbuffers.h.

251{ return size(); }
size_t size() const

References flexbuffers::Sized::size().

◆ str()

std::string flexbuffers::String::str ( ) const
inline

Definition at line 253 of file flexbuffers.h.

253{ return std::string(c_str(), size()); }
const char * c_str() const

References c_str(), and flexbuffers::Sized::size().


The documentation for this class was generated from the following file: