Assimp v5.2.2 (January 2022)
The Asset-Importer-Lib API documentation.
|
Represents an UTF-8 string, zero byte terminated. More...
#include <types.h>
Public Member Functions | |
aiString () AI_NO_EXCEPT | |
Default constructor, the string is set to have zero length. More... | |
aiString (const aiString &rOther) | |
Copy constructor. More... | |
aiString (const std::string &pString) | |
Constructor from std::string. More... | |
void | Append (const char *app) |
Append a string to the string. More... | |
const char * | C_Str () const |
Returns a pointer to the underlying zero-terminated array of characters. More... | |
void | Clear () |
Clear the string - reset its length to zero. More... | |
bool | operator!= (const aiString &other) const |
Inverse comparison operator. More... | |
aiString & | operator= (const aiString &rOther) |
Assignment operator. More... | |
aiString & | operator= (const char *sz) |
Assign a const char* to the string. More... | |
aiString & | operator= (const std::string &pString) |
Assign a cstd::string to the string. More... | |
bool | operator== (const aiString &other) const |
Comparison operator. More... | |
void | Set (const char *sz) |
Copy a const char* to the aiString. More... | |
void | Set (const std::string &pString) |
Copy a std::string to the aiString. More... | |
Public Attributes | |
char | data [MAXLEN] |
String buffer. More... | |
ai_uint32 | length |
Binary length of the string excluding the terminal 0. More... | |
Represents an UTF-8 string, zero byte terminated.
The character set of an aiString is explicitly defined to be UTF-8. This Unicode transformation was chosen in the belief that most strings in 3d files are limited to ASCII, thus the character set needed to be strictly ASCII compatible.
Most text file loaders provide proper Unicode input file handling, special unicode characters are correctly transcoded to UTF8 and are kept throughout the libraries' import pipeline.
For most applications, it will be absolutely sufficient to interpret the aiString as ASCII data and work with it as one would work with a plain char*. Windows users in need of proper support for i.e asian characters can use the MultiByteToWideChar(), WideCharToMultiByte() WinAPI functionality to convert the UTF-8 strings to their working character set (i.e. MBCS, WideChar).
We use this representation instead of std::string to be C-compatible. The (binary) length of such a string is limited to MAXLEN characters (including the the terminating zero).
|
inline |
Default constructor, the string is set to have zero length.
|
inline |
Copy constructor.
|
inlineexplicit |
Constructor from std::string.
|
inline |
Append a string to the string.
|
inline |
Returns a pointer to the underlying zero-terminated array of characters.
|
inline |
Clear the string - reset its length to zero.
|
inline |
Inverse comparison operator.
|
inline |
Assign a const char* to the string.
|
inline |
Assign a cstd::string to the string.
|
inline |
Comparison operator.
|
inline |
Copy a const char* to the aiString.
|
inline |
Copy a std::string to the aiString.
char aiString::data[MAXLEN] |
String buffer.
Size limit is MAXLEN
ai_uint32 aiString::length |
Binary length of the string excluding the terminal 0.
This is NOT the logical length of strings containing UTF-8 multi-byte sequences! It's the number of bytes from the beginning of the string to its end.