Added FilePath.

This commit is contained in:
Branimir Karadžić
2017-07-14 00:09:52 -07:00
parent a517e191d4
commit 6e252cf889
8 changed files with 451 additions and 19 deletions
+18 -3
View File
@@ -37,9 +37,15 @@ namespace bx
///
StringView(const char* _ptr, int32_t _len = INT32_MAX);
///
StringView(const char* _ptr, const char* _term);
///
void set(const char* _ptr, int32_t _len = INT32_MAX);
///
void set(const char* _ptr, const char* _term);
///
void clear();
@@ -138,9 +144,15 @@ namespace bx
/// 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);
/// 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);
/// Get string length.
int32_t strLen(const char* _str, int32_t _max = INT32_MAX);
@@ -148,9 +160,15 @@ namespace bx
/// 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);
/// 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);
/// Find character in string. Limit search to _max characters.
const char* strFind(const char* _str, char _ch, int32_t _max = INT32_MAX);
@@ -218,9 +236,6 @@ namespace bx
template <typename Ty>
Ty replaceAll(const Ty& _str, const char* _from, const char* _to);
/// Extract base file name from file path.
const char* baseName(const char* _filePath);
/// 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);