Create static strings from compile-time constants.
More...
|
|
#define | _S |
| | Creates a static ASCII string from a string literal.
|
| |
|
#define | _SU |
| | Creates a static UTF-8 string from a string literal.
|
| |
|
#define | _SO |
| | Creates a static string with other/unknown encoding from a literal.
|
| |
Create static strings from compile-time constants.
These macros convert C string literals into CX string objects by prepending a minimal header. The strings are static and don't need to be destroyed. They cannot be modified (attempts to modify will cause a copy).
Choose the appropriate macro based on content:
- _S - Pure ASCII (most common, allows ASCII-specific optimizations)
- _SU - UTF-8 encoded (multi-byte characters)
- _SO - Other encoding or raw binary data
Example:
string s2 =
_SU"Hello 世界";
void strDup(strhandle o, strref s)
#define _SU
Creates a static UTF-8 string from a string literal.
#define _S
Creates a static ASCII string from a string literal.