summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_basic.h
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2017-08-09 17:02:51 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-09 22:19:34 +0000
commit821e59c5d2034066843dd6040a06fe637a6369df (patch)
tree6d82681cb5988c482dbb657c6593b2010b344fad /core/fxcrt/fx_basic.h
parent6470a6a5a5c0f447b71e1ac2451b6672a84186af (diff)
downloadpdfium-821e59c5d2034066843dd6040a06fe637a6369df.tar.xz
Remove CFX_ByteTextBuf from CFX_UTF8Encoder
Also making CFX_ByteString(ostringstream) const. Bug: pdfium:731 Change-Id: Iaee610248a5634e8731eaf05944c32d52c4e8015 Reviewed-on: https://pdfium-review.googlesource.com/10151 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_basic.h')
-rw-r--r--core/fxcrt/fx_basic.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/core/fxcrt/fx_basic.h b/core/fxcrt/fx_basic.h
index e856a3e0ba..c6ffc0d535 100644
--- a/core/fxcrt/fx_basic.h
+++ b/core/fxcrt/fx_basic.h
@@ -9,6 +9,7 @@
#include <algorithm>
#include <memory>
+#include <vector>
#include "core/fxcrt/cfx_retain_ptr.h"
#include "core/fxcrt/fx_memory.h"
@@ -128,14 +129,18 @@ class CFX_UTF8Decoder {
class CFX_UTF8Encoder {
public:
- CFX_UTF8Encoder() {}
+ CFX_UTF8Encoder();
+ ~CFX_UTF8Encoder();
void Input(wchar_t unicode);
- void AppendStr(const CFX_ByteStringC& str) { m_Buffer << str; }
- CFX_ByteStringC GetResult() const { return m_Buffer.AsStringC(); }
+ void AppendStr(const CFX_ByteStringC& str);
+
+ // The data returned by GetResult() is invalidated when this is modified by
+ // appending any data.
+ CFX_ByteStringC GetResult() const;
private:
- CFX_ByteTextBuf m_Buffer;
+ std::vector<uint8_t> m_Buffer;
};
template <class DataType, int FixedSize>