summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_basic_bstring.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-05-13 15:02:43 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-13 15:02:44 -0700
commitf7036ba5884b9829fcb17aea4f3a16831abb7516 (patch)
treee142bb59eea5d48d354a6f4841d1ef57306e985f /core/fxcrt/fx_basic_bstring.cpp
parent19ea309f3d46bbd76d4201b4e791b11d736f7834 (diff)
downloadpdfium-f7036ba5884b9829fcb17aea4f3a16831abb7516.tar.xz
Templatize CFX_{Byte,Wide}StringC
Review-Url: https://codereview.chromium.org/1874773002
Diffstat (limited to 'core/fxcrt/fx_basic_bstring.cpp')
-rw-r--r--core/fxcrt/fx_basic_bstring.cpp21
1 files changed, 1 insertions, 20 deletions
diff --git a/core/fxcrt/fx_basic_bstring.cpp b/core/fxcrt/fx_basic_bstring.cpp
index e035dd53d1..3a81e41920 100644
--- a/core/fxcrt/fx_basic_bstring.cpp
+++ b/core/fxcrt/fx_basic_bstring.cpp
@@ -13,6 +13,7 @@
#include "third_party/base/numerics/safe_math.h"
template class CFX_StringDataTemplate<FX_CHAR>;
+template class CFX_StringCTemplate<FX_CHAR>;
namespace {
@@ -931,26 +932,6 @@ void CFX_ByteString::TrimLeft() {
uint32_t CFX_ByteString::GetID(FX_STRSIZE start_pos) const {
return AsStringC().GetID(start_pos);
}
-uint32_t CFX_ByteStringC::GetID(FX_STRSIZE start_pos) const {
- if (m_Length == 0) {
- return 0;
- }
- if (start_pos < 0 || start_pos >= m_Length) {
- return 0;
- }
- uint32_t strid = 0;
- if (start_pos + 4 > m_Length) {
- for (FX_STRSIZE i = 0; i < m_Length - start_pos; i++) {
- strid = strid * 256 + m_Ptr[start_pos + i];
- }
- strid = strid << ((4 - m_Length + start_pos) * 8);
- } else {
- for (int i = 0; i < 4; i++) {
- strid = strid * 256 + m_Ptr[start_pos + i];
- }
- }
- return strid;
-}
FX_STRSIZE FX_ftoa(FX_FLOAT d, FX_CHAR* buf) {
buf[0] = '0';
buf[1] = '\0';