String: Added STL compatible append. Added getCPtr().

This commit is contained in:
Бранимир Караџић
2019-12-04 22:10:47 -08:00
parent e27066ad1a
commit 4ecfa36057
2 changed files with 19 additions and 0 deletions

View File

@@ -225,6 +225,12 @@ namespace bx
}
}
template<bx::AllocatorI** AllocatorT>
inline void StringT<AllocatorT>::append(const char* _ptr, const char* _term)
{
append(StringView(_ptr, _term) );
}
template<bx::AllocatorI** AllocatorT>
inline void StringT<AllocatorT>::clear()
{
@@ -236,6 +242,12 @@ namespace bx
}
}
template<bx::AllocatorI** AllocatorT>
inline const char* StringT<AllocatorT>::getCPtr() const
{
return getPtr();
}
inline StringView strSubstr(const StringView& _str, int32_t _start, int32_t _len)
{
return StringView(_str, _start, _len);

View File

@@ -128,8 +128,15 @@ namespace bx
///
void append(const StringView& _str);
///
void append(const char* _ptr, const char* _term);
///
void clear();
/// Returns zero-terminated C string pointer.
///
const char* getCPtr() const;
};
/// Retruns true if character is part of space set.