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

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

Issue 809993004: Get rid of FX_LPCSTR cast. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Indent 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/fpdfapi/fpdf_edit/fpdf_edit_create.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;
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 CFX_ByteString(FX_BSTR bstrc); 177 CFX_ByteString(FX_BSTR bstrc);
178 178
179 CFX_ByteString(FX_BSTR bstrc1, FX_BSTR bstrc2); 179 CFX_ByteString(FX_BSTR bstrc1, FX_BSTR bstrc2);
180 180
181 ~CFX_ByteString(); 181 ~CFX_ByteString();
182 182
183 static CFX_ByteString FromUnicode(FX_LPCWSTR ptr, FX_STRSIZE len = -1) ; 183 static CFX_ByteString FromUnicode(FX_LPCWSTR ptr, FX_STRSIZE len = -1) ;
184 184
185 static CFX_ByteString FromUnicode(const CFX_WideString& str); 185 static CFX_ByteString FromUnicode(const CFX_WideString& str);
186 186
187 // Explicit conversion to raw string
188 FX_LPCSTR c_str() const
189 {
190 return m_pData ? m_pData->m_String : "";
191 }
192
193 // Implicit conversion to C-style string -- deprecated
187 operator FX_LPCSTR() const 194 operator FX_LPCSTR() const
188 { 195 {
189 return m_pData ? m_pData->m_String : ""; 196 return m_pData ? m_pData->m_String : "";
190 } 197 }
191 198
192 operator FX_LPCBYTE() const 199 operator FX_LPCBYTE() const
193 { 200 {
194 return m_pData ? (FX_LPCBYTE)m_pData->m_String : NULL; 201 return m_pData ? (FX_LPCBYTE)m_pData->m_String : NULL;
195 } 202 }
196 203
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len); 851 CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len);
845 inline CFX_ByteString FX_UTF8Encode(FX_WSTR wsStr) 852 inline CFX_ByteString FX_UTF8Encode(FX_WSTR wsStr)
846 { 853 {
847 return FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength()); 854 return FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength());
848 } 855 }
849 inline CFX_ByteString FX_UTF8Encode(const CFX_WideString &wsStr) 856 inline CFX_ByteString FX_UTF8Encode(const CFX_WideString &wsStr)
850 { 857 {
851 return FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()); 858 return FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength());
852 } 859 }
853 #endif 860 #endif
OLDNEW
« no previous file with comments | « no previous file | core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698