summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_widestring.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-06-28 11:25:37 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-06-28 15:42:06 +0000
commit475f43338d78ff889851967a09b7398574d95a44 (patch)
tree2a27d6f83ae1f1bd83d85ea9783554255b821fce /core/fxcrt/cfx_widestring.cpp
parentd8df8d4cd419258b50413c4eb730d144824844f0 (diff)
downloadpdfium-475f43338d78ff889851967a09b7398574d95a44.tar.xz
Add << overload for CFX_WideString
BUG=pdfium:788 Change-Id: I9f211d42e60c0d8b7b3c508d340036a3b26542dd Reviewed-on: https://pdfium-review.googlesource.com/7041 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxcrt/cfx_widestring.cpp')
-rw-r--r--core/fxcrt/cfx_widestring.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/fxcrt/cfx_widestring.cpp b/core/fxcrt/cfx_widestring.cpp
index ef6aaad931..46192de4ab 100644
--- a/core/fxcrt/cfx_widestring.cpp
+++ b/core/fxcrt/cfx_widestring.cpp
@@ -1049,3 +1049,12 @@ int CFX_WideString::GetInteger() const {
float CFX_WideString::GetFloat() const {
return m_pData ? FX_wtof(m_pData->m_String, m_pData->m_nDataLength) : 0.0f;
}
+
+std::wostream& operator<<(std::wostream& os, const CFX_WideString& str) {
+ return os.write(str.c_str(), str.GetLength());
+}
+
+std::ostream& operator<<(std::ostream& os, const CFX_WideString& str) {
+ os << str.UTF8Encode();
+ return os;
+}