From 153f8032eebd9a61d525b0532b54b68e91625492 Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 24 Mar 2022 22:17:29 +0100 Subject: Added ostream output for Text --- FoundationEx/Text.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'FoundationEx') diff --git a/FoundationEx/Text.h b/FoundationEx/Text.h index 73e1242..df5edae 100644 --- a/FoundationEx/Text.h +++ b/FoundationEx/Text.h @@ -14,6 +14,8 @@ #ifndef Text_h #define Text_h +#include + #include #include #include "ThreadSync.h" @@ -64,6 +66,8 @@ public: Text(const Text& s); ~Text(); + friend std::ostream& operator<<(std::ostream& out, const Text& text); + // case sensitivity bool isSensitive() const; void setSensitive(bool s); @@ -148,6 +152,8 @@ inline int Text::compare(const Text& s) const // +-------------------------------------------------------------------+ +inline std::ostream& operator<<(std::ostream& out, const Text& text) { + out << text.data(); return out; } inline int operator==(const Text& l, const Text& r) { return (l.length() == r.length()) && (l.compare(r) == 0); } inline int operator!=(const Text& l, const Text& r) { return l.compare(r) != 0; } -- cgit v1.1