Added C string writer.

This commit is contained in:
Branimir Karadžić
2017-07-16 09:48:49 -07:00
parent f06f377b1a
commit bbc9ded3df
2 changed files with 9 additions and 1 deletions

View File

@@ -297,6 +297,11 @@ namespace bx
return _writer->write(_data, _size, _err);
}
inline int32_t write(WriterI* _writer, const char* _str, Error* _err)
{
return write(_writer, _str, strLen(_str), _err);
}
inline int32_t write(WriterI* _writer, const StringView& _str, Error* _err)
{
return write(_writer, _str.getPtr(), _str.getLength(), _err);

View File

@@ -255,7 +255,10 @@ namespace bx
/// Write data.
int32_t write(WriterI* _writer, const void* _data, int32_t _size, Error* _err = NULL);
/// Writer string.
/// Write C string.
inline int32_t write(WriterI* _writer, const char* _str, Error* _err = NULL);
/// Write string view.
inline int32_t write(WriterI* _writer, const StringView& _str, Error* _err = NULL);
/// Write repeat the same value.