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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 StringData::Create(m_pData->m_String + nCopyIndex, nCopyLen)); | 401 StringData::Create(m_pData->m_String + nCopyIndex, nCopyLen)); |
402 dest.m_pData.Swap(pNewData); | 402 dest.m_pData.Swap(pNewData); |
403 } | 403 } |
404 | 404 |
405 #define FORCE_ANSI 0x10000 | 405 #define FORCE_ANSI 0x10000 |
406 #define FORCE_UNICODE 0x20000 | 406 #define FORCE_UNICODE 0x20000 |
407 #define FORCE_INT64 0x40000 | 407 #define FORCE_INT64 0x40000 |
408 | 408 |
409 CFX_ByteString CFX_ByteString::FormatInteger(int i, uint32_t flags) { | 409 CFX_ByteString CFX_ByteString::FormatInteger(int i, uint32_t flags) { |
410 char buf[32]; | 410 char buf[32]; |
411 return CFX_ByteStringC(buf, Buffer_itoa(buf, i, flags)); | 411 return CFX_ByteString(buf, Buffer_itoa(buf, i, flags)); |
412 } | 412 } |
413 | 413 |
414 void CFX_ByteString::FormatV(const FX_CHAR* pFormat, va_list argList) { | 414 void CFX_ByteString::FormatV(const FX_CHAR* pFormat, va_list argList) { |
415 va_list argListSave; | 415 va_list argListSave; |
416 #if defined(__ARMCC_VERSION) || \ | 416 #if defined(__ARMCC_VERSION) || \ |
417 (!defined(_MSC_VER) && (_FX_CPU_ == _FX_X64_ || _FX_CPU_ == _FX_IA64_ || \ | 417 (!defined(_MSC_VER) && (_FX_CPU_ == _FX_X64_ || _FX_CPU_ == _FX_IA64_ || \ |
418 _FX_CPU_ == _FX_ARM64_)) || \ | 418 _FX_CPU_ == _FX_ARM64_)) || \ |
419 defined(__native_client__) | 419 defined(__native_client__) |
420 va_copy(argListSave, argList); | 420 va_copy(argListSave, argList); |
421 #else | 421 #else |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 fraction %= scale; | 976 fraction %= scale; |
977 scale /= 10; | 977 scale /= 10; |
978 } | 978 } |
979 return buf_size; | 979 return buf_size; |
980 } | 980 } |
981 CFX_ByteString CFX_ByteString::FormatFloat(FX_FLOAT d, int precision) { | 981 CFX_ByteString CFX_ByteString::FormatFloat(FX_FLOAT d, int precision) { |
982 FX_CHAR buf[32]; | 982 FX_CHAR buf[32]; |
983 FX_STRSIZE len = FX_ftoa(d, buf); | 983 FX_STRSIZE len = FX_ftoa(d, buf); |
984 return CFX_ByteString(buf, len); | 984 return CFX_ByteString(buf, len); |
985 } | 985 } |
OLD | NEW |