summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_widestring.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/cfx_widestring.h')
-rw-r--r--core/fxcrt/cfx_widestring.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/fxcrt/cfx_widestring.h b/core/fxcrt/cfx_widestring.h
index 52cd65a2b7..fd3c92a15e 100644
--- a/core/fxcrt/cfx_widestring.h
+++ b/core/fxcrt/cfx_widestring.h
@@ -23,6 +23,7 @@ class CFX_ByteString;
class CFX_WideString {
public:
using CharType = wchar_t;
+ using const_iterator = const CharType*;
CFX_WideString();
CFX_WideString(const CFX_WideString& other);
@@ -61,6 +62,12 @@ class CFX_WideString {
return CFX_WideStringC(c_str(), GetLength());
}
+ // Note: Any subsequent modification of |this| will invalidate iterators.
+ const_iterator begin() const { return m_pData ? m_pData->m_String : nullptr; }
+ const_iterator end() const {
+ return m_pData ? m_pData->m_String + m_pData->m_nDataLength : nullptr;
+ }
+
void clear() { m_pData.Reset(); }
FX_STRSIZE GetLength() const { return m_pData ? m_pData->m_nDataLength : 0; }