Switching code to use StringView.

This commit is contained in:
Branimir Karadžić
2017-10-01 18:03:25 -07:00
parent 82185277e4
commit c338725229
4 changed files with 87 additions and 65 deletions
+9 -21
View File
@@ -169,38 +169,26 @@ namespace bx
bool toBool(const char* _str);
/// String compare.
int32_t strCmp(const char* _lhs, const char* _rhs, int32_t _max = INT32_MAX);
/// String compare.
int32_t strCmp(const char* _lhs, const StringView& _rhs);
int32_t strCmp(const StringView& _lhs, const StringView& _rhs, int32_t _max = INT32_MAX);
/// Case insensitive string compare.
int32_t strCmpI(const char* _lhs, const char* _rhs, int32_t _max = INT32_MAX);
/// Case insensitive string compare.
int32_t strCmpI(const char* _lhs, const StringView& _rhs);
int32_t strCmpI(const StringView& _lhs, const StringView& _rhs, int32_t _max = INT32_MAX);
// Compare as strings holding indices/version numbers.
int32_t strCmpV(const char* _lhs, const char* _rhs, int32_t _max = INT32_MAX);
// Compare as strings holding indices/version numbers.
int32_t strCmpV(const char* _lhs, const StringView& _rhs);
int32_t strCmpV(const StringView& _lhs, const StringView& _rhs, int32_t _max = INT32_MAX);
/// Get string length.
int32_t strLen(const char* _str, int32_t _max = INT32_MAX);
/// Get string length.
int32_t strLen(const StringView& _str, int32_t _max = INT32_MAX);
/// Copy _num characters from string _src to _dst buffer of maximum _dstSize capacity
/// including zero terminator. Copy will be terminated with '\0'.
int32_t strCopy(char* _dst, int32_t _dstSize, const char* _src, int32_t _num = INT32_MAX);
///
int32_t strCopy(char* _dst, int32_t _dstSize, const StringView& _str);
int32_t strCopy(char* _dst, int32_t _dstSize, const StringView& _str, int32_t _num = INT32_MAX);
/// Concatinate string.
int32_t strCat(char* _dst, int32_t _dstSize, const char* _src, int32_t _num = INT32_MAX);
///
int32_t strCat(char* _dst, int32_t _dstSize, const StringView& _str);
int32_t strCat(char* _dst, int32_t _dstSize, const StringView& _str, int32_t _num = INT32_MAX);
/// Find character in string. Limit search to _max characters.
const char* strFind(const char* _str, int32_t _max, char _ch);
@@ -282,7 +270,7 @@ namespace bx
Ty replaceAll(const Ty& _str, const char* _from, const char* _to);
/// Convert size in bytes to human readable string kibi units.
int32_t prettify(char* _out, int32_t _count, uint64_t _size, Units::Enum _units = Units::Kibi);
int32_t prettify(char* _out, int32_t _count, uint64_t _value, Units::Enum _units = Units::Kibi);
///
int32_t toString(char* _out, int32_t _max, double _value);