Path Tracer
Public Attributes | List of all members
aiString Struct Reference

#include <types.h>

Public Attributes

ai_uint32 length
 
char data [MAXLEN]
 

Detailed Description

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).

Member Data Documentation

◆ data

char aiString::data[MAXLEN]

String buffer. Size limit is MAXLEN

◆ length

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.


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