From ded52d40aa0ab64cc89fce67f64f8b1b2bbcff6f Mon Sep 17 00:00:00 2001 From: Noel Berry Date: Tue, 12 Jan 2021 20:57:14 -0800 Subject: [PATCH] removed Stream::write_cstr and added conditions to Stream::write numeric --- include/blah/streams/stream.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/include/blah/streams/stream.h b/include/blah/streams/stream.h index 2b19a1f..c49af69 100644 --- a/include/blah/streams/stream.h +++ b/include/blah/streams/stream.h @@ -97,27 +97,21 @@ namespace Blah return write_from(buffer, length); } - // writes a null-terminated string, and returns the amount written - int64_t write_cstr(const Str& string) + // writes the contents of a string to the stream + int64_t write(const String& string) { - return write(string.cstr(), string.length() + 1); - } - - // writes a null-terminated string, and returns the amount written - int64_t write_cstr(const char* cstr) - { - return write(cstr, strlen(cstr) + 1); + return write_from(string.begin(), string.length()); } // writes a number - template + template::value, T>::type> int64_t write(const T& value) { return write(value, Endian::Little); } // writes a number - template + template::value, T>::type> int64_t write(const T& value, Endian endian) { T writing = value;