diff --git a/doomsday/libdeng/include/de/str.h b/doomsday/libdeng/include/de/str.h index e0e206e18b..a5e13cdc77 100644 --- a/doomsday/libdeng/include/de/str.h +++ b/doomsday/libdeng/include/de/str.h @@ -212,10 +212,25 @@ DENG_PUBLIC Str* Str_Prepend(Str* ds, const char* prependText); DENG_PUBLIC Str* Str_PrependChar(Str* ds, char ch); /** - * This is safe for all strings. + * Determines the length of the string in characters. + * This is safe for all strings. @see Str_Size() + * + * @param ds String instance. + * + * @return Length of the string as an integer. */ DENG_PUBLIC int Str_Length(const Str* ds); +/** + * Determines the length of the string in characters. + * This is safe for all strings. @see Str_Length() + * + * @param ds String instance. + * + * @return Length of the string. + */ +DENG_PUBLIC size_t Str_Size(const Str* ds); + DENG_PUBLIC boolean Str_IsEmpty(const Str* ds); /** diff --git a/doomsday/libdeng/src/str.c b/doomsday/libdeng/src/str.c index beb7981a2f..74efd25aa3 100644 --- a/doomsday/libdeng/src/str.c +++ b/doomsday/libdeng/src/str.c @@ -390,6 +390,11 @@ char* Str_Text(const ddstring_t* str) } int Str_Length(const ddstring_t* str) +{ + return (int) Str_Size(str); +} + +size_t Str_Size(const Str* str) { DENG_ASSERT(str); @@ -398,7 +403,7 @@ int Str_Length(const ddstring_t* str) { return str->length; } - return (int)strlen(Str_Text(str)); + return strlen(Str_Text(str)); } boolean Str_IsEmpty(const ddstring_t* str)