OpenVDB  12.0.0
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
String Struct Reference

An extremely basic but native representation of a string class with SSO support. This exists to provide an interface between the AX C++ API and backend IR string logic. It is not designed to fulfill any other use and should very rarely be used directly. More...

#include <openvdb_ax/codegen/String.h>

Public Member Functions

 String ()
 
 String (const char *str)
 Construct from null terminated character string. More...
 
 String (const std::string &str)
 
 String (const char *str, const int64_t size)
 
 ~String ()
 
 String (const String &other)
 
const std::string str () const
 
const char * c_str () const
 
int64_t size () const
 
bool isLocal () const
 
void clear ()
 
 operator const char * () const
 
const Stringoperator= (const std::string &str)
 
const Stringoperator= (const String &other)
 
bool operator== (const String &other) const
 
bool operator!= (const String &other) const
 
String operator+ (const String &other) const
 
void reset (const char *str, const int64_t size)
 
void alloc (const size_t size)
 

Public Attributes

char * ptr = nullptr
 
char SSO [SSO_LENGTH]
 
int64_t len = 0
 

Static Public Attributes

static constexpr int64_t SSO_LENGTH = 16
 

Detailed Description

An extremely basic but native representation of a string class with SSO support. This exists to provide an interface between the AX C++ API and backend IR string logic. It is not designed to fulfill any other use and should very rarely be used directly.

Constructor & Destructor Documentation

String ( )
inline
String ( const char *  str)
inline

Construct from null terminated character string.

String ( const std::string &  str)
inline
String ( const char *  str,
const int64_t  size 
)
inline
~String ( )
inline
String ( const String other)
inline

Member Function Documentation

void alloc ( const size_t  size)
inline
const char* c_str ( ) const
inline
void clear ( )
inline
bool isLocal ( ) const
inline
operator const char * ( ) const
inline
bool operator!= ( const String other) const
inline
String operator+ ( const String other) const
inline
const String& operator= ( const std::string &  str)
inline
const String& operator= ( const String other)
inline
bool operator== ( const String other) const
inline
void reset ( const char *  str,
const int64_t  size 
)
inline
int64_t size ( ) const
inline
const std::string str ( ) const
inline

Member Data Documentation

int64_t len = 0
char* ptr = nullptr
char SSO[SSO_LENGTH]
constexpr int64_t SSO_LENGTH = 16
static