string_t

From Valve Developer Community
Revision as of 11:43, 26 April 2013 by Sacaldur (talk | contribs) (linked the german translation)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Deutsch

string_t is a Valve-specific replacement for the C String. It doesn't do anything special; it's just an indirection to "allow more flexibility in future ports or optimization".

Bizarrely, string_t can be one of three things depending on preprocessor set-up:

Usage

Whichever of the above is in effect, there are four macros to use:

NULL_STRING
A constant empty string.
STRING(string_t)
Get a C string. Don't use ToCStr() directly!
MAKE_STRING(const char *)
Make a string_t.
IDENT_STRINGS( s1, s2 )
Are these strings (of either type) pointing to the same memory?

See also