summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2017-06-09 18:13:34 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-06-09 18:13:46 +0000
commit7e2d1f4cb2af916e0d5eb01bb6b9cb3ffa0736c3 (patch)
tree3bc1e693695e073581ec36e76e9cf71898ddc3d3
parent748793bd30ef25919c069f1856cc7e6ee0aee181 (diff)
downloadpdfium-7e2d1f4cb2af916e0d5eb01bb6b9cb3ffa0736c3.tar.xz
Revert "Revert "Adding constructor of CFX_ByteString that takes a std::ostringstream.""
This reverts commit 53827cbbfebae66dd31f7aa30d3ee5c88716897a. Reason for revert: Rollforward of original CL - test failures were flakes. Original change's description: > Revert "Adding constructor of CFX_ByteString that takes a std::ostringstream." > > This reverts commit 4633d52736c4b926eceb1e18c4b379ff57fd31fa. > > Reason for revert: windows_xfa_clang broke? > > Original change's description: > > Adding constructor of CFX_ByteString that takes a std::ostringstream. > > > > Bug: pdfium:731 > > Change-Id: Ia0734deb3f309732dccae5c0cf6131d32713e87a > > Reviewed-on: https://pdfium-review.googlesource.com/6394 > > Reviewed-by: dsinclair <dsinclair@chromium.org> > > Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> > > TBR=dsinclair@chromium.org,hnakashima@chromium.org > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: pdfium:731 > > Change-Id: I674aa1be12d6777c4d565d3131910ac5a11d8dc0 > Reviewed-on: https://pdfium-review.googlesource.com/6395 > Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> > Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> TBR=dsinclair@chromium.org,pdfium-reviews@googlegroups.com,hnakashima@chromium.org No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: pdfium:731 Change-Id: I4a31a1a6bdb128016183c1059f0bfe1fa559a89e Reviewed-on: https://pdfium-review.googlesource.com/6434 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
-rw-r--r--core/fxcrt/cfx_bytestring.cpp4
-rw-r--r--core/fxcrt/cfx_bytestring.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/core/fxcrt/cfx_bytestring.cpp b/core/fxcrt/cfx_bytestring.cpp
index f0dc370cc9..b83c59ffeb 100644
--- a/core/fxcrt/cfx_bytestring.cpp
+++ b/core/fxcrt/cfx_bytestring.cpp
@@ -189,6 +189,10 @@ CFX_ByteString::CFX_ByteString(
}
}
+CFX_ByteString::CFX_ByteString(std::ostringstream& outStream)
+ : CFX_ByteString(outStream.str().c_str(),
+ static_cast<int>(outStream.tellp())) {}
+
CFX_ByteString::~CFX_ByteString() {}
const CFX_ByteString& CFX_ByteString::operator=(const char* pStr) {
diff --git a/core/fxcrt/cfx_bytestring.h b/core/fxcrt/cfx_bytestring.h
index c4d48954ba..23e02491c5 100644
--- a/core/fxcrt/cfx_bytestring.h
+++ b/core/fxcrt/cfx_bytestring.h
@@ -8,6 +8,7 @@
#define CORE_FXCRT_CFX_BYTESTRING_H_
#include <functional>
+#include <sstream>
#include <utility>
#include "core/fxcrt/cfx_retain_ptr.h"
@@ -45,6 +46,7 @@ class CFX_ByteString {
explicit CFX_ByteString(const CFX_ByteStringC& bstrc);
CFX_ByteString(const CFX_ByteStringC& bstrc1, const CFX_ByteStringC& bstrc2);
CFX_ByteString(const std::initializer_list<CFX_ByteStringC>& list);
+ explicit CFX_ByteString(std::ostringstream& outStream);
~CFX_ByteString();