OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cctype> | 10 #include <cctype> |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 | 914 |
915 void CFX_ByteString::TrimLeft(FX_CHAR chTarget) { | 915 void CFX_ByteString::TrimLeft(FX_CHAR chTarget) { |
916 TrimLeft(CFX_ByteStringC(chTarget)); | 916 TrimLeft(CFX_ByteStringC(chTarget)); |
917 } | 917 } |
918 | 918 |
919 void CFX_ByteString::TrimLeft() { | 919 void CFX_ByteString::TrimLeft() { |
920 TrimLeft("\x09\x0a\x0b\x0c\x0d\x20"); | 920 TrimLeft("\x09\x0a\x0b\x0c\x0d\x20"); |
921 } | 921 } |
922 | 922 |
923 uint32_t CFX_ByteString::GetID(FX_STRSIZE start_pos) const { | 923 uint32_t CFX_ByteString::GetID(FX_STRSIZE start_pos) const { |
924 return CFX_ByteStringC(*this).GetID(start_pos); | 924 return AsStringC().GetID(start_pos); |
925 } | 925 } |
926 uint32_t CFX_ByteStringC::GetID(FX_STRSIZE start_pos) const { | 926 uint32_t CFX_ByteStringC::GetID(FX_STRSIZE start_pos) const { |
927 if (m_Length == 0) { | 927 if (m_Length == 0) { |
928 return 0; | 928 return 0; |
929 } | 929 } |
930 if (start_pos < 0 || start_pos >= m_Length) { | 930 if (start_pos < 0 || start_pos >= m_Length) { |
931 return 0; | 931 return 0; |
932 } | 932 } |
933 uint32_t strid = 0; | 933 uint32_t strid = 0; |
934 if (start_pos + 4 > m_Length) { | 934 if (start_pos + 4 > m_Length) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 fraction %= scale; | 987 fraction %= scale; |
988 scale /= 10; | 988 scale /= 10; |
989 } | 989 } |
990 return buf_size; | 990 return buf_size; |
991 } | 991 } |
992 CFX_ByteString CFX_ByteString::FormatFloat(FX_FLOAT d, int precision) { | 992 CFX_ByteString CFX_ByteString::FormatFloat(FX_FLOAT d, int precision) { |
993 FX_CHAR buf[32]; | 993 FX_CHAR buf[32]; |
994 FX_STRSIZE len = FX_ftoa(d, buf); | 994 FX_STRSIZE len = FX_ftoa(d, buf); |
995 return CFX_ByteString(buf, len); | 995 return CFX_ByteString(buf, len); |
996 } | 996 } |
OLD | NEW |