summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_string.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-02-13 10:26:01 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-02-13 19:00:17 +0000
commitf0b65545313f065790de7f91c02e5dd160753abd (patch)
tree747c55722c6b45a979d5c2894a259396a3189ed7 /core/fxcrt/fx_string.h
parent5fb0ad8adac5fcbf8c8f1965164f41d11c0af669 (diff)
downloadpdfium-f0b65545313f065790de7f91c02e5dd160753abd.tar.xz
Simplify FX_UTF8Encode variants.chromium/3012
Doing so reveals places where there are needless copies and conversions. Change-Id: I24a868d40aa63836f4167eaf4541964049df7916 Reviewed-on: https://pdfium-review.googlesource.com/2555 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_string.h')
-rw-r--r--core/fxcrt/fx_string.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/core/fxcrt/fx_string.h b/core/fxcrt/fx_string.h
index 750216fd3e..cd93f27275 100644
--- a/core/fxcrt/fx_string.h
+++ b/core/fxcrt/fx_string.h
@@ -424,17 +424,10 @@ inline bool operator!=(const CFX_WideStringC& lhs, const CFX_WideString& rhs) {
return rhs != lhs;
}
-CFX_ByteString FX_UTF8Encode(const FX_WCHAR* pwsStr, FX_STRSIZE len);
-inline CFX_ByteString FX_UTF8Encode(const CFX_WideStringC& wsStr) {
- return FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength());
-}
-inline CFX_ByteString FX_UTF8Encode(const CFX_WideString& wsStr) {
- return FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength());
-}
-
+CFX_ByteString FX_UTF8Encode(const CFX_WideStringC& wsStr);
FX_FLOAT FX_atof(const CFX_ByteStringC& str);
inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) {
- return FX_atof(FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()).c_str());
+ return FX_atof(FX_UTF8Encode(wsStr).c_str());
}
bool FX_atonum(const CFX_ByteStringC& str, void* pData);
FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf);