summaryrefslogtreecommitdiff
path: root/core/fxcrt/include/fx_basic.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-04 16:41:35 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-04 16:41:35 -0700
commit28f97ff783c16f3391384ce97b765ce4eb310ac7 (patch)
tree69c4c8bc9dd39d5336c96f28b633d197dd207c81 /core/fxcrt/include/fx_basic.h
parented9c4386713084f37548b46ab36f618021f716f5 (diff)
downloadpdfium-28f97ff783c16f3391384ce97b765ce4eb310ac7.tar.xz
Make down-conversion explicit from CFX_ByteString to CFX_ByteStringC.
Having this happen implicitly can be dangerous because the lifetime has to be considered; we should have caught the "red bots" in https://codereview.chromium.org/1847333004/#ps60001 at compile time. Review URL: https://codereview.chromium.org/1853233002
Diffstat (limited to 'core/fxcrt/include/fx_basic.h')
-rw-r--r--core/fxcrt/include/fx_basic.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/fxcrt/include/fx_basic.h b/core/fxcrt/include/fx_basic.h
index feeb6e756d..2ef11beb27 100644
--- a/core/fxcrt/include/fx_basic.h
+++ b/core/fxcrt/include/fx_basic.h
@@ -27,8 +27,8 @@ class CFX_BinaryBuf {
void Clear();
void EstimateSize(FX_STRSIZE size, FX_STRSIZE alloc_step = 0);
void AppendBlock(const void* pBuf, FX_STRSIZE size);
- void AppendString(const CFX_ByteStringC& str) {
- AppendBlock(str.GetPtr(), str.GetLength());
+ void AppendString(const CFX_ByteString& str) {
+ AppendBlock(str.c_str(), str.GetLength());
}
void AppendByte(uint8_t byte) {
@@ -63,6 +63,12 @@ class CFX_ByteTextBuf : public CFX_BinaryBuf {
CFX_ByteTextBuf& operator<<(int i);
CFX_ByteTextBuf& operator<<(uint32_t i);
CFX_ByteTextBuf& operator<<(double f);
+ CFX_ByteTextBuf& operator<<(const FX_CHAR* pStr) {
+ return *this << CFX_ByteStringC(pStr);
+ }
+ CFX_ByteTextBuf& operator<<(const CFX_ByteString& str) {
+ return *this << str.AsByteStringC();
+ }
CFX_ByteTextBuf& operator<<(const CFX_ByteStringC& lpsz);
CFX_ByteTextBuf& operator<<(const CFX_ByteTextBuf& buf);
};