diff --git a/Sources/Plasma/CoreLib/plString.cpp b/Sources/Plasma/CoreLib/plString.cpp index 9b179949..08bab171 100644 --- a/Sources/Plasma/CoreLib/plString.cpp +++ b/Sources/Plasma/CoreLib/plString.cpp @@ -924,14 +924,28 @@ plStringStream &plStringStream::operator<<(const char *text) plStringStream &plStringStream::operator<<(int num) { char buffer[12]; - snprintf(buffer, 12, "%d", num); + snprintf(buffer, arrsize(buffer), "%d", num); return operator<<(buffer); } plStringStream &plStringStream::operator<<(unsigned int num) { char buffer[12]; - snprintf(buffer, 12, "%u", num); + snprintf(buffer, arrsize(buffer), "%u", num); + return operator<<(buffer); +} + +plStringStream &plStringStream::operator<<(int64_t num) +{ + char buffer[24]; + snprintf(buffer, arrsize(buffer), "%lld", num); + return operator<<(buffer); +} + +plStringStream &plStringStream::operator<<(uint64_t num) +{ + char buffer[24]; + snprintf(buffer, arrsize(buffer), "%llu", num); return operator<<(buffer); } diff --git a/Sources/Plasma/CoreLib/plString.h b/Sources/Plasma/CoreLib/plString.h index 536031ea..3304ffac 100644 --- a/Sources/Plasma/CoreLib/plString.h +++ b/Sources/Plasma/CoreLib/plString.h @@ -753,6 +753,12 @@ public: /** Append a base-10 formatted unsigned integer to the stream. */ plStringStream &operator<<(unsigned int num); + /** Append a base-10 formatted signed 64-bit integer to the stream. */ + plStringStream &operator<<(int64_t num); + + /** Append a base-10 formatted unsigned 64-bit integer to the stream. */ + plStringStream &operator<<(uint64_t num); + /** Append a base-10 formatted float to the stream. */ plStringStream &operator<<(float num) { return operator<<(static_cast(num)); }