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

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: 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
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..cb255b6ab697ad5e432b33f3d24f43cd8aaa9f7b 100644
--- a/core/include/fxcrt/fx_string.h
+++ b/core/include/fxcrt/fx_string.h
@@ -184,11 +184,19 @@ 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 : "";
}
+
Tom Sepez 2014/12/30 22:53:26 nit: extra blank line.
operator FX_LPCBYTE() const
{
return m_pData ? (FX_LPCBYTE)m_pData->m_String : NULL;
« no previous file with comments | « no previous file | core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp » ('j') | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698