summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_string_c_template.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/cfx_string_c_template.h')
-rw-r--r--core/fxcrt/cfx_string_c_template.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/fxcrt/cfx_string_c_template.h b/core/fxcrt/cfx_string_c_template.h
index 4aba2cd4b9..75c2be0efc 100644
--- a/core/fxcrt/cfx_string_c_template.h
+++ b/core/fxcrt/cfx_string_c_template.h
@@ -22,6 +22,7 @@ class CFX_StringCTemplate {
public:
using CharType = T;
using UnsignedType = typename std::make_unsigned<CharType>::type;
+ using const_iterator = const CharType*;
CFX_StringCTemplate() : m_Ptr(nullptr), m_Length(0) {}
@@ -73,6 +74,14 @@ class CFX_StringCTemplate {
return *this;
}
+ const_iterator begin() const {
+ return reinterpret_cast<const CharType*>(m_Ptr);
+ }
+ const_iterator end() const {
+ return m_Ptr ? reinterpret_cast<const CharType*>(m_Ptr) + m_Length
+ : nullptr;
+ }
+
bool operator==(const CharType* ptr) const {
return FXSYS_len(ptr) == m_Length &&
FXSYS_cmp(ptr, reinterpret_cast<const CharType*>(m_Ptr), m_Length) ==