Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2445)

Unified Diff: core/fxcrt/fx_basic_bstring.cpp

Issue 1874773002: Templatize CFX_{Byte,Wide}StringC (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Remove one <type_traits> include. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fxcrt/cfx_string_c_template.h ('k') | core/fxcrt/fx_basic_wstring.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcrt/fx_basic_bstring.cpp
diff --git a/core/fxcrt/fx_basic_bstring.cpp b/core/fxcrt/fx_basic_bstring.cpp
index e035dd53d1cf0a86bc40c681201dc19d75ef9253..3a81e41920de75518ae1cdb24a2674717d89cf25 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';
« no previous file with comments | « core/fxcrt/cfx_string_c_template.h ('k') | core/fxcrt/fx_basic_wstring.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698