|
Functions having to do with string massaging/manipulation. More...
Files | |
file | demangle.h |
Demangle C++ typenames generated by the typeid() facility. | |
file | vsnprintf.h |
Architecture dependent memory-safe sprintf capability. | |
Functions | |
ARCH_API bool | ArchDemangle (std::string *typeName) |
Demangle RTTI-generated type name. | |
ARCH_API std::string | ArchGetDemangled (const std::string &typeName) |
Return demangled RTTI-generated type name. | |
ARCH_API std::string | ArchGetDemangled (const char *typeName) |
Return demangled RTTI-generated type name. | |
std::string | ArchGetDemangled (const std::type_info &typeInfo) |
Return demangled RTTI-generated type name. | |
std::string | ArchGetDemangled (const std::type_index &typeIndex) |
Return demangled RTTI-generated type name. | |
template<typename T > | |
std::string | ArchGetDemangled () |
Return demangled RTTI generated-type name. | |
ARCH_API int | ArchVsnprintf (char *str, size_t size, const char *format, va_list ap) |
Return the number of characters (not including the null character) necessary for a particular sprintf into a string. | |
ARCH_API std::string | ArchStringPrintf (const char *fmt,...) |
Returns a string formed by a printf()-like specification. | |
Functions having to do with string massaging/manipulation.
ARCH_API bool ArchDemangle | ( | std::string * | typeName | ) |
Demangle RTTI-generated type name.
Given a variable v
, the construct typeid(v)
.name() returns the type-name of v
; unfortunately, the returned type-name is sometimes extremely encoded (otherwise known as "mangled"). ArchDemangle
parses the passed in type-name typeName
into a readable form, and overwrites typeName
. If typeName
cannot be unmangled, the function returns false
without altering typeName
. Otherwise true
is returned.
|
inline |
Return demangled RTTI generated-type name.
Returns the demangled name of type T.
Definition at line 86 of file demangle.h.
ARCH_API std::string ArchGetDemangled | ( | const char * | typeName | ) |
Return demangled RTTI-generated type name.
ARCH_API std::string ArchGetDemangled | ( | const std::string & | typeName | ) |
Return demangled RTTI-generated type name.
If typeName
can be demangled, the function returns the demangled string; otherwise, the function returns the empty string.
|
inline |
Return demangled RTTI-generated type name.
Returns the demangled name associated with typeIndex (i.e. typeIndex.name()).
Definition at line 74 of file demangle.h.
|
inline |
Return demangled RTTI-generated type name.
Returns the demangled name associated with typeInfo (i.e. typeInfo.name()).
Definition at line 63 of file demangle.h.
ARCH_API std::string ArchStringPrintf | ( | const char * | fmt, |
... | |||
) |
Returns a string formed by a printf()-like specification.
ArchStringPrintf()
is a memory-safe architecture-independent way of forming a string using printf()-like formatting. For example,
The function is safe only to the extent that the arguments match the formatting string. In particular, be careful to pass strings themselve into ArchStringPrintf()
as in the above example (i.e. caller.c_str()
as opposed to just passing caller
).
ARCH_API int ArchVsnprintf | ( | char * | str, |
size_t | size, | ||
const char * | format, | ||
va_list | ap | ||
) |
Return the number of characters (not including the null character) necessary for a particular sprintf into a string.
ArchVsnprintf
guarantees the C99 behavior of vsnprintf on all systems: it returns the number of bytes (not including the terminating null character) needed to actually print the requested string. If size
indicates that str
has enough capacity to hold the result, then the function actually prints into str
.
You probably want to use the functionality of this call via TfStringPrintf()
.