Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
fxcrt::StringTemplate< T > Class Template Reference

#include <string_template.h>

Collaboration diagram for fxcrt::StringTemplate< T >:

Public Types

using CharType = T
using UnsignedType = typename std::make_unsigned<CharType>::type
using StringView = StringViewTemplate<T>
using const_iterator = T*
using const_reverse_iterator = std::reverse_iterator<const_iterator>

Public Member Functions

bool IsEmpty () const
size_t GetLength () const
size_t GetStringLength () const
const UnsignedTypeunsigned_str () const
StringView AsStringView () const
const CharTypec_str () const
pdfium::span< const CharTypespan () const
pdfium::span< const UnsignedTypeunsigned_span () const
pdfium::span< const CharTypespan_with_terminator () const
pdfium::span< const UnsignedTypeunsigned_span_with_terminator () const
const_iterator begin () const
const_iterator end () const
const_reverse_iterator rbegin () const
const_reverse_iterator rend () const
bool IsValidIndex (size_t index) const
bool IsValidLength (size_t length) const
CharType operator[] (const size_t index) const
CharType Front () const
CharType Back () const
void clear ()
pdfium::span< T > GetBuffer (size_t nMinBufLength)
void ReleaseBuffer (size_t nNewLength)
size_t Insert (size_t index, T ch)
size_t InsertAtFront (T ch)
size_t InsertAtBack (T ch)
size_t Remove (T ch)
size_t Delete (size_t index, size_t count=1)
std::optional< size_t > Find (StringView str, size_t start=0) const
std::optional< size_t > Find (T ch, size_t start=0) const
std::optional< size_t > ReverseFind (T ch) const
bool Contains (StringView str, size_t start=0) const
bool Contains (T ch, size_t start=0) const
size_t Replace (StringView oldstr, StringView newstr)
void SetAt (size_t index, T ch)
void Reserve (size_t len)
void Trim (T ch)
void TrimFront (T ch)
void TrimBack (T ch)
void Trim (StringView targets)
void TrimFront (StringView targets)
void TrimBack (StringView targets)

Protected Types

using StringData = StringDataTemplate<T>

Protected Member Functions

 StringTemplate ()=default
 StringTemplate (const StringTemplate &other)=default
 StringTemplate (StringTemplate &&other) noexcept=default
 ~StringTemplate ()=default
void ReallocBeforeWrite (size_t nNewLen)
void AllocBeforeWrite (size_t nNewLen)
void AssignCopy (const T *pSrcData, size_t nSrcLen)
void Concat (const T *pSrcData, size_t nSrcLen)

Protected Attributes

RetainPtr< StringDatam_pData

Detailed Description

template<typename T>
class fxcrt::StringTemplate< T >

Definition at line 32 of file string_template.h.

Member Typedef Documentation

◆ CharType

template<typename T>
using fxcrt::StringTemplate< T >::CharType = T

Definition at line 34 of file string_template.h.

◆ const_iterator

template<typename T>
using fxcrt::StringTemplate< T >::const_iterator = T*

Definition at line 37 of file string_template.h.

◆ const_reverse_iterator

template<typename T>
using fxcrt::StringTemplate< T >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 38 of file string_template.h.

◆ StringData

template<typename T>
using fxcrt::StringTemplate< T >::StringData = StringDataTemplate<T>
protected

Definition at line 189 of file string_template.h.

◆ StringView

template<typename T>
using fxcrt::StringTemplate< T >::StringView = StringViewTemplate<T>

Definition at line 36 of file string_template.h.

◆ UnsignedType

template<typename T>
using fxcrt::StringTemplate< T >::UnsignedType = typename std::make_unsigned<CharType>::type

Definition at line 35 of file string_template.h.

Constructor & Destructor Documentation

◆ StringTemplate() [1/3]

template<typename T>
fxcrt::StringTemplate< T >::StringTemplate ( )
protecteddefault

◆ StringTemplate() [2/3]

template<typename T>
fxcrt::StringTemplate< T >::StringTemplate ( const StringTemplate< T > & other)
protecteddefault

◆ StringTemplate() [3/3]

template<typename T>
fxcrt::StringTemplate< T >::StringTemplate ( StringTemplate< T > && other)
protecteddefaultnoexcept

◆ ~StringTemplate()

template<typename T>
fxcrt::StringTemplate< T >::~StringTemplate ( )
protecteddefault

Member Function Documentation

◆ AllocBeforeWrite()

template<typename T>
void fxcrt::StringTemplate< T >::AllocBeforeWrite ( size_t nNewLen)
protected

Definition at line 324 of file string_template.cpp.

References clear(), and m_pData.

Here is the call graph for this function:

◆ AssignCopy()

template<typename T>
void fxcrt::StringTemplate< T >::AssignCopy ( const T * pSrcData,
size_t nSrcLen )
protected

Definition at line 336 of file string_template.cpp.

References m_pData.

◆ AsStringView()

template<typename T>
StringView fxcrt::StringTemplate< T >::AsStringView ( ) const
inline

Definition at line 57 of file string_template.h.

◆ Back()

template<typename T>
CharType fxcrt::StringTemplate< T >::Back ( ) const
inline

Definition at line 130 of file string_template.h.

References m_pData.

◆ begin()

template<typename T>
const_iterator fxcrt::StringTemplate< T >::begin ( ) const
inline

Definition at line 100 of file string_template.h.

References m_pData.

Referenced by rend().

Here is the caller graph for this function:

◆ c_str()

template<typename T>
const CharType * fxcrt::StringTemplate< T >::c_str ( ) const
inline

Definition at line 62 of file string_template.h.

References m_pData.

◆ clear()

template<typename T>
void fxcrt::StringTemplate< T >::clear ( )

Definition at line 371 of file string_template.cpp.

References m_pData.

Referenced by AllocBeforeWrite(), ReallocBeforeWrite(), and ReleaseBuffer().

Here is the caller graph for this function:

◆ Concat()

template<typename T>
void fxcrt::StringTemplate< T >::Concat ( const T * pSrcData,
size_t nSrcLen )
protected

Definition at line 344 of file string_template.cpp.

References m_pData.

◆ Contains() [1/2]

template<typename T>
bool fxcrt::StringTemplate< T >::Contains ( StringView str,
size_t start = 0 ) const
inline

Definition at line 163 of file string_template.h.

◆ Contains() [2/2]

template<typename T>
bool fxcrt::StringTemplate< T >::Contains ( T ch,
size_t start = 0 ) const
inline

Definition at line 166 of file string_template.h.

◆ Delete()

template<typename T>
size_t fxcrt::StringTemplate< T >::Delete ( size_t index,
size_t count = 1 )

Definition at line 104 of file string_template.cpp.

References m_pData.

◆ end()

template<typename T>
const_iterator fxcrt::StringTemplate< T >::end ( ) const
inline

Definition at line 103 of file string_template.h.

References m_pData.

Referenced by rbegin().

Here is the caller graph for this function:

◆ Find() [1/2]

template<typename T>
std::optional< size_t > fxcrt::StringTemplate< T >::Find ( StringView str,
size_t start = 0 ) const

Definition at line 139 of file string_template.cpp.

◆ Find() [2/2]

template<typename T>
std::optional< size_t > fxcrt::StringTemplate< T >::Find ( T ch,
size_t start = 0 ) const

Definition at line 134 of file string_template.cpp.

◆ Front()

template<typename T>
CharType fxcrt::StringTemplate< T >::Front ( ) const
inline

Definition at line 126 of file string_template.h.

References m_pData.

◆ GetBuffer()

template<typename T>
pdfium::span< T > fxcrt::StringTemplate< T >::GetBuffer ( size_t nMinBufLength)

Definition at line 21 of file string_template.cpp.

References m_pData.

◆ GetLength()

template<typename T>
size_t fxcrt::StringTemplate< T >::GetLength ( ) const
inline

Definition at line 41 of file string_template.h.

References m_pData.

◆ GetStringLength()

template<typename T>
size_t fxcrt::StringTemplate< T >::GetStringLength ( ) const
inline

Definition at line 44 of file string_template.h.

References m_pData.

◆ Insert()

template<typename T>
size_t fxcrt::StringTemplate< T >::Insert ( size_t index,
T ch )

Definition at line 89 of file string_template.cpp.

References m_pData.

◆ InsertAtBack()

template<typename T>
size_t fxcrt::StringTemplate< T >::InsertAtBack ( T ch)
inline

Definition at line 150 of file string_template.h.

◆ InsertAtFront()

template<typename T>
size_t fxcrt::StringTemplate< T >::InsertAtFront ( T ch)
inline

Definition at line 149 of file string_template.h.

◆ IsEmpty()

template<typename T>
bool fxcrt::StringTemplate< T >::IsEmpty ( ) const
inline

Definition at line 40 of file string_template.h.

◆ IsValidIndex()

template<typename T>
bool fxcrt::StringTemplate< T >::IsValidIndex ( size_t index) const
inline

Definition at line 115 of file string_template.h.

◆ IsValidLength()

template<typename T>
bool fxcrt::StringTemplate< T >::IsValidLength ( size_t length) const
inline

Definition at line 116 of file string_template.h.

◆ operator[]()

template<typename T>
CharType fxcrt::StringTemplate< T >::operator[] ( const size_t index) const
inline

Definition at line 119 of file string_template.h.

References m_pData.

◆ rbegin()

template<typename T>
const_reverse_iterator fxcrt::StringTemplate< T >::rbegin ( ) const
inline

Definition at line 108 of file string_template.h.

References end().

Here is the call graph for this function:

◆ ReallocBeforeWrite()

template<typename T>
void fxcrt::StringTemplate< T >::ReallocBeforeWrite ( size_t nNewLen)
protected

Definition at line 301 of file string_template.cpp.

References clear(), and m_pData.

Here is the call graph for this function:

◆ ReleaseBuffer()

template<typename T>
void fxcrt::StringTemplate< T >::ReleaseBuffer ( size_t nNewLength)

Definition at line 46 of file string_template.cpp.

References clear(), and m_pData.

Here is the call graph for this function:

◆ Remove()

template<typename T>
size_t fxcrt::StringTemplate< T >::Remove ( T ch)

Definition at line 67 of file string_template.cpp.

References m_pData.

◆ rend()

template<typename T>
const_reverse_iterator fxcrt::StringTemplate< T >::rend ( ) const
inline

Definition at line 111 of file string_template.h.

References begin().

Here is the call graph for this function:

◆ Replace()

template<typename T>
size_t fxcrt::StringTemplate< T >::Replace ( StringView oldstr,
StringView newstr )

Definition at line 170 of file string_template.cpp.

◆ Reserve()

template<typename T>
void fxcrt::StringTemplate< T >::Reserve ( size_t len)
inline

Definition at line 176 of file string_template.h.

◆ ReverseFind()

template<typename T>
std::optional< size_t > fxcrt::StringTemplate< T >::ReverseFind ( T ch) const

Definition at line 156 of file string_template.cpp.

◆ SetAt()

template<typename T>
void fxcrt::StringTemplate< T >::SetAt ( size_t index,
T ch )

Definition at line 127 of file string_template.cpp.

References m_pData.

◆ span()

template<typename T>
pdfium::span< const CharType > fxcrt::StringTemplate< T >::span ( ) const
inline

Definition at line 69 of file string_template.h.

◆ span_with_terminator()

template<typename T>
pdfium::span< const CharType > fxcrt::StringTemplate< T >::span_with_terminator ( ) const
inline

Definition at line 83 of file string_template.h.

References m_pData.

◆ Trim() [1/2]

template<typename T>
void fxcrt::StringTemplate< T >::Trim ( StringView targets)

Definition at line 231 of file string_template.cpp.

◆ Trim() [2/2]

template<typename T>
void fxcrt::StringTemplate< T >::Trim ( T ch)

Definition at line 215 of file string_template.cpp.

◆ TrimBack() [1/2]

template<typename T>
void fxcrt::StringTemplate< T >::TrimBack ( StringView targets)

Definition at line 272 of file string_template.cpp.

References m_pData.

◆ TrimBack() [2/2]

template<typename T>
void fxcrt::StringTemplate< T >::TrimBack ( T ch)

Definition at line 226 of file string_template.cpp.

◆ TrimFront() [1/2]

template<typename T>
void fxcrt::StringTemplate< T >::TrimFront ( StringView targets)

Definition at line 237 of file string_template.cpp.

References m_pData.

◆ TrimFront() [2/2]

template<typename T>
void fxcrt::StringTemplate< T >::TrimFront ( T ch)

Definition at line 221 of file string_template.cpp.

◆ unsigned_span()

template<typename T>
pdfium::span< const UnsignedType > fxcrt::StringTemplate< T >::unsigned_span ( ) const
inline

Definition at line 75 of file string_template.h.

◆ unsigned_span_with_terminator()

template<typename T>
pdfium::span< const UnsignedType > fxcrt::StringTemplate< T >::unsigned_span_with_terminator ( ) const
inline

Definition at line 95 of file string_template.h.

◆ unsigned_str()

template<typename T>
const UnsignedType * fxcrt::StringTemplate< T >::unsigned_str ( ) const
inline

Definition at line 50 of file string_template.h.

References m_pData.

Member Data Documentation

◆ m_pData


The documentation for this class was generated from the following files: