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.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/fxcrt/cfx_widestring.h b/core/fxcrt/cfx_widestring.h
index 9922e4277a..595615a0b2 100644
--- a/core/fxcrt/cfx_widestring.h
+++ b/core/fxcrt/cfx_widestring.h
@@ -8,6 +8,7 @@
#define CORE_FXCRT_CFX_WIDESTRING_H_
#include <functional>
+#include <iterator>
#include <utility>
#include "core/fxcrt/cfx_retain_ptr.h"
@@ -25,6 +26,7 @@ class CFX_WideString {
public:
using CharType = wchar_t;
using const_iterator = const CharType*;
+ using const_reverse_iterator = std::reverse_iterator<const_iterator>;
CFX_WideString();
CFX_WideString(const CFX_WideString& other);
@@ -73,6 +75,14 @@ class CFX_WideString {
return m_pData ? m_pData->m_String + m_pData->m_nDataLength : nullptr;
}
+ // Note: Any subsequent modification of |this| will invalidate iterators.
+ const_reverse_iterator rbegin() const {
+ return const_reverse_iterator(end());
+ }
+ const_reverse_iterator rend() const {
+ return const_reverse_iterator(begin());
+ }
+
void clear() { m_pData.Reset(); }
FX_STRSIZE GetLength() const { return m_pData ? m_pData->m_nDataLength : 0; }