template class axl::sl::StringRefBase

#include <axl_sl_String.h>

template <
    typename T,
    typename Details0 = StringDetailsBase<T>
    >
class StringRefBase
{
public:
    // typedefs

    typedef Details0 Details;
    typedef Details::Details2 Details2;
    typedef Details::Details3 Details3;
    typedef Details::C C;
    typedef Details::C2 C2;
    typedef Details::C3 C3;
    typedef Details::Encoding Encoding;
    typedef Details2::Encoding Encoding2;
    typedef Details3::Encoding Encoding3;
    typedef StringRefBase<C, Details> StringRef;
    typedef StringRefBase<C2, Details2> StringRef2;
    typedef StringRefBase<C3, Details3> StringRef3;
    typedef StringBase<C, Details> String;
    typedef StringBase<C2, Details2> String2;
    typedef StringBase<C3, Details3> String3;

    // construction

    StringRefBase();
    StringRefBase(const StringRef& src);
    StringRefBase(const C* p);

    StringRefBase(
        const C* p,
        size_t length,
        bool isNullTerminated = false
        );

    StringRefBase(
        const C* p,
        const void* end,
        bool isNullTerminated = false
        );

    StringRefBase(
        rc::BufHdr* hdr,
        const C* p
        );

    StringRefBase(
        rc::BufHdr* hdr,
        const C* p,
        size_t length,
        bool isNullTerminated = false
        );

    StringRefBase(
        rc::BufHdr* hdr,
        const C* p,
        const void* end,
        bool isNullTerminated = false
        );
    ~StringRefBase();

    // methods

    StringRefBase&
    operator=(const StringRef& src);

    bool
    operator==(const StringRef& string) const;

    bool
    operator!=(const StringRef& string) const;

    bool
    operator<(const StringRef& string) const;

    bool
    operator<=(const StringRef& string) const;

    bool
    operator>(const StringRef& string) const;

    bool
    operator>=(const StringRef& string) const;

    bool
    operator==(const C* p) const;

    bool
    operator!=(const C* p) const;

    bool
    operator<(const C* p) const;

    bool
    operator<=(const C* p) const;

    bool
    operator>(const C* p) const;

    bool
    operator>=(const C* p) const;

    String
    operator+(const StringRef& string) const;

    String
    operator+(const StringRef2& string) const;

    String
    operator+(const StringRef3& string) const;

    String
    operator+(const C* p) const;

    String
    operator+(const C2* p) const;

    String
    operator+(const C3* p) const;

    String
    operator+(utf32_t c) const;

    const C&
    operator[](intptr_t i) const;

    const C*
    cp() const;

    const C*
    sz() const;

    const C*
    szn() const;

    String2
    s2() const;

    String3
    s3() const;

    size_t
    getLength() const;

    rc::BufHdr*
    getHdr() const;

    const C*
    getEnd() const;

    bool
    isEmpty() const;

    bool
    isNullTerminated() const;

    void
    clear();

    void
    release();

    size_t
    offset(size_t length);

    int
    cmp(const StringRef& string) const;

    int
    cmpIgnoreCase(
        const StringRef& string,
        CaseConvertMethod method = CaseConvertMethod_Default
        ) const;

    size_t
    hash() const;

    size_t
    hashIgnoreCase(CaseConvertMethod method = CaseConvertMethod_Default) const;

    bool
    isEqual(const StringRef& string) const;

    bool
    isEqualIgnoreCase(
        const StringRef& string,
        CaseConvertMethod method = CaseConvertMethod_Default
        ) const;

    bool
    isPrefix(C c) const;

    bool
    isPrefix(const StringRef& string) const;

    bool
    isPrefixIgnoreCase(
        const StringRef& string,
        CaseConvertMethod method = CaseConvertMethod_Default
        ) const;

    bool
    isSuffix(C c) const;

    bool
    isSuffix(const StringRef& string) const;

    bool
    isSuffixIgnoreCase(
        const StringRef& string,
        CaseConvertMethod method = CaseConvertMethod_Default
        ) const;

    size_t
    find(
        C c,
        size_t index = 0
        ) const;

    size_t
    find(
        const StringRef& subString,
        size_t index = 0
        ) const;

    size_t
    findOneOf(
        const StringRef& charSet,
        size_t index = 0
        ) const;

    size_t
    findNotOneOf(
        const StringRef& charSet,
        size_t index = 0
        ) const;

    size_t
    reverseFind(
        C c,
        size_t index = -1
        ) const;

    size_t
    reverseFind(
        const StringRef& subString,
        size_t index = -1
        ) const;

    size_t
    reverseFindOneOf(
        const StringRef& charSet,
        size_t index = -1
        ) const;

    size_t
    reverseFindNotOneOf(
        const StringRef& charSet,
        size_t index = -1
        ) const;

    StringRef
    getSubString(
        size_t first,
        size_t length = -1
        ) const;

    size_t
    setSubString(
        size_t first,
        size_t length = -1
        );

    StringRef
    getLeftSubString(size_t length) const;

    size_t
    setLeftSubString(size_t length);

    StringRef
    getRightSubString(size_t length) const;

    size_t
    setRightSubString(size_t length);

    StringRef
    getLeftTrimmedString() const;

    StringRef
    getRightTimmedString() const;

    StringRef
    getTrimmedString() const;

    String
    getLowerCaseString(CaseConvertMethod method = CaseConvertMethod_Default) const;

    String
    getUpperCaseString(CaseConvertMethod method = CaseConvertMethod_Default) const;

    String
    getCaseFoldedString(CaseConvertMethod method = CaseConvertMethod_Default) const;
};