diff options
| -rw-r--r-- | source/core/slang-string.cpp | 5 | ||||
| -rw-r--r-- | source/core/slang-string.h | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/source/core/slang-string.cpp b/source/core/slang-string.cpp index 1a6221cc8..5f2ba13ba 100644 --- a/source/core/slang-string.cpp +++ b/source/core/slang-string.cpp @@ -690,5 +690,10 @@ namespace Slang return true; } +} +std::ostream& operator<< (std::ostream& stream, const Slang::String& s) +{ + stream << s.getBuffer(); + return stream; } diff --git a/source/core/slang-string.h b/source/core/slang-string.h index 5119dac8f..e8ee76397 100644 --- a/source/core/slang-string.h +++ b/source/core/slang-string.h @@ -4,6 +4,7 @@ #include <string.h> #include <cstdlib> #include <stdio.h> +#include <iostream> #include "slang-smart-pointer.h" #include "slang-common.h" @@ -1038,6 +1039,7 @@ namespace Slang length -= actualDelLength; } #endif + friend std::ostream& operator<< (std::ostream& stream, const String& s); void Clear() { @@ -1051,4 +1053,6 @@ namespace Slang float StringToFloat(const String & str); } +std::ostream& operator<< (std::ostream& stream, const Slang::String& s); + #endif |
