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

Unified 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 6 years 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 | « no previous file | core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fxcrt/fx_string.h
diff --git a/core/include/fxcrt/fx_string.h b/core/include/fxcrt/fx_string.h
index 44c6fc53ff6de008ff3be9f824e8985e19d59f64..91032f9d9773b4e955d6dc6218454739f1aab69d 100644
--- a/core/include/fxcrt/fx_string.h
+++ b/core/include/fxcrt/fx_string.h
@@ -184,6 +184,13 @@ public:
static CFX_ByteString FromUnicode(const CFX_WideString& str);
+ // Explicit conversion to raw string
+ FX_LPCSTR c_str() const
+ {
+ return m_pData ? m_pData->m_String : "";
+ }
+
+ // Implicit conversion to C-style string -- deprecated
operator FX_LPCSTR() const
{
return m_pData ? m_pData->m_String : "";
« 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