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

Side by Side Diff: core/include/fxcrt/fx_string.h

Issue 809313008: Merge to XFA: Add ostream helpers for FX String classes. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | core/src/fxcrt/fx_basic_bstring_unittest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef _FX_STRING_H_ 7 #ifndef _FX_STRING_H_
8 #define _FX_STRING_H_ 8 #define _FX_STRING_H_
9 class CFX_ByteStringC; 9 class CFX_ByteStringC;
10 class CFX_ByteString; 10 class CFX_ByteString;
11 class CFX_WideStringC; 11 class CFX_WideStringC;
12 class CFX_WideString; 12 class CFX_WideString;
13 struct CFX_CharMap; 13 struct CFX_CharMap;
14 class CFX_BinaryBuf; 14 class CFX_BinaryBuf;
15 typedef int FX_STRSIZE; 15 typedef int FX_STRSIZE;
16 class CFX_ByteStringL; 16 class CFX_ByteStringL;
17 class CFX_WideStringL; 17 class CFX_WideStringL;
18 class CFX_ByteStringC : public CFX_Object 18 class CFX_ByteStringC : public CFX_Object
19 { 19 {
20 public: 20 public:
21 typedef FX_CHAR value_type;
21 22
22 CFX_ByteStringC() 23 CFX_ByteStringC()
23 { 24 {
24 m_Ptr = NULL; 25 m_Ptr = NULL;
25 m_Length = 0; 26 m_Length = 0;
26 } 27 }
27 28
28 CFX_ByteStringC(FX_LPCBYTE ptr, FX_STRSIZE size) 29 CFX_ByteStringC(FX_LPCBYTE ptr, FX_STRSIZE size)
29 { 30 {
30 m_Ptr = ptr; 31 m_Ptr = ptr;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 154
154 FX_STRSIZE m_nDataLength; 155 FX_STRSIZE m_nDataLength;
155 156
156 FX_STRSIZE m_nAllocLength; 157 FX_STRSIZE m_nAllocLength;
157 158
158 FX_CHAR m_String[1]; 159 FX_CHAR m_String[1];
159 }; 160 };
160 class CFX_ByteString : public CFX_Object 161 class CFX_ByteString : public CFX_Object
161 { 162 {
162 public: 163 public:
164 typedef FX_CHAR value_type;
163 165
164 CFX_ByteString() 166 CFX_ByteString()
165 { 167 {
166 m_pData = NULL; 168 m_pData = NULL;
167 } 169 }
168 170
169 CFX_ByteString(const CFX_ByteString& str); 171 CFX_ByteString(const CFX_ByteString& str);
170 172
171 CFX_ByteString(char ch); 173 CFX_ByteString(char ch);
172 174
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 public: 468 public:
467 469
468 CFX_StringBufTemplate() : CFX_StringBufBase(limit) {} 470 CFX_StringBufTemplate() : CFX_StringBufBase(limit) {}
469 471
470 FX_CHAR m_Buffer[limit]; 472 FX_CHAR m_Buffer[limit];
471 }; 473 };
472 typedef CFX_StringBufTemplate<256> CFX_StringBuf256; 474 typedef CFX_StringBufTemplate<256> CFX_StringBuf256;
473 class CFX_WideStringC : public CFX_Object 475 class CFX_WideStringC : public CFX_Object
474 { 476 {
475 public: 477 public:
478 typedef FX_WCHAR value_type;
476 479
477 CFX_WideStringC() 480 CFX_WideStringC()
478 { 481 {
479 m_Ptr = NULL; 482 m_Ptr = NULL;
480 m_Length = 0; 483 m_Length = 0;
481 } 484 }
482 485
483 CFX_WideStringC(FX_LPCWSTR ptr) 486 CFX_WideStringC(FX_LPCWSTR ptr)
484 { 487 {
485 m_Ptr = ptr; 488 m_Ptr = ptr;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 614
612 FX_STRSIZE m_nDataLength; 615 FX_STRSIZE m_nDataLength;
613 616
614 FX_STRSIZE m_nAllocLength; 617 FX_STRSIZE m_nAllocLength;
615 618
616 FX_WCHAR m_String[1]; 619 FX_WCHAR m_String[1];
617 }; 620 };
618 class CFX_WideString : public CFX_Object 621 class CFX_WideString : public CFX_Object
619 { 622 {
620 public: 623 public:
624 typedef FX_WCHAR value_type;
621 625
622 CFX_WideString() 626 CFX_WideString()
623 { 627 {
624 m_pData = NULL; 628 m_pData = NULL;
625 } 629 }
626 630
627 CFX_WideString(const CFX_WideString& str); 631 CFX_WideString(const CFX_WideString& str);
628 632
629 CFX_WideString(FX_LPCWSTR ptr, FX_STRSIZE len = -1) 633 CFX_WideString(FX_LPCWSTR ptr, FX_STRSIZE len = -1)
630 { 634 {
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len); 855 CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len);
852 inline CFX_ByteString FX_UTF8Encode(FX_WSTR wsStr) 856 inline CFX_ByteString FX_UTF8Encode(FX_WSTR wsStr)
853 { 857 {
854 return FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength()); 858 return FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength());
855 } 859 }
856 inline CFX_ByteString FX_UTF8Encode(const CFX_WideString &wsStr) 860 inline CFX_ByteString FX_UTF8Encode(const CFX_WideString &wsStr)
857 { 861 {
858 return FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()); 862 return FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength());
859 } 863 }
860 #endif 864 #endif
OLDNEW
« no previous file with comments | « no previous file | core/src/fxcrt/fx_basic_bstring_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698