template class axl::sl::StringBase

#include <axl_sl_String.h>

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

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

    // construction

    StringBase();
    StringBase(const StringBase& src);
    StringBase(const StringRef& src);
    StringBase(const StringRef2& src);
    StringBase(const StringRef3& src);

    StringBase(
        const C* p,
        size_t length = -1
        );

    StringBase(
        const C* p,
        const void* end
        );

    StringBase(
        const C2* p,
        size_t length = -1
        );

    StringBase(
        const C2* p,
        const void* end
        );

    StringBase(
        const C3* p,
        size_t length = -1
        );

    StringBase(
        const C3* p,
        const void* end
        );

    StringBase(utf32_t x);

    StringBase(
        utf32_t x,
        size_t count
        );

    StringBase(
        rc::BufKind kind,
        void* p,
        size_t size
        );

    // methods

    operator const C *() const;

    StringBase&
    operator=(const StringBase& src);

    StringBase&
    operator=(const StringRef& src);

    StringBase&
    operator=(const StringRef2& src);

    StringBase&
    operator=(const StringRef3& src);

    StringBase&
    operator=(const C* p);

    StringBase&
    operator=(const C2* p);

    StringBase&
    operator=(const C3* p);

    StringBase&
    operator=(utf32_t x);

    StringBase&
    operator+=(const StringRef& string);

    StringBase&
    operator+=(const StringRef2& string);

    StringBase&
    operator+=(const StringRef3& string);

    StringBase&
    operator+=(const C* p);

    StringBase&
    operator+=(const C2* p);

    StringBase&
    operator+=(const C3* p);

    StringBase&
    operator+=(utf32_t x);

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

    C&
    operator[](intptr_t i);

    C*
    p();

    const C*
    sz() const;

    const C*
    szn() const;

    void
    clear();

    size_t
    forceCopy(const StringRef& src);

    size_t
    copy(const StringRef& src);

    size_t
    copy(const StringRef2& src);

    size_t
    copy(const StringRef3& src);

    size_t
    copy(
        const C* p,
        size_t length = -1
        );

    size_t
    copy(
        const C2* p,
        size_t length = -1
        );

    size_t
    copy(
        const C3* p,
        size_t length = -1
        );

    size_t
    copy(utf32_t x);

    size_t
    copy(
        utf32_t x,
        size_t count
        );

    size_t
    append(const StringRef& src);

    size_t
    append(const StringRef2& src);

    size_t
    append(const StringRef3& src);

    size_t
    append(
        const C* p,
        size_t length = -1
        );

    size_t
    append(
        const C2* p,
        size_t length = -1
        );

    size_t
    append(
        const C3* p,
        size_t length = -1
        );

    size_t
    append(utf32_t x);

    size_t
    append(
        utf32_t x,
        size_t count
        );

    size_t
    appendNewLine();

    size_t
    insert(
        size_t index,
        const StringRef& src
        );

    size_t
    insert(
        size_t index,
        const StringRef2& src
        );

    size_t
    insert(
        size_t index,
        const StringRef3& src
        );

    size_t
    insert(
        size_t index,
        const C* p,
        size_t length = -1
        );

    size_t
    insert(
        size_t index,
        const C2* p,
        size_t length = -1
        );

    size_t
    insert(
        size_t index,
        const C3* p,
        size_t length = -1
        );

    size_t
    insert(
        size_t index,
        utf32_t x
        );

    size_t
    insert(
        size_t index,
        utf32_t x,
        size_t count
        );

    size_t
    insertNewLine(size_t index);

    size_t
    remove(
        size_t index,
        size_t count = 1
        );

    size_t
    trimLeft();

    size_t
    trimRight();

    size_t
    trim();

    size_t
    replace(
        const StringRef& from,
        const StringRef& to
        );

    size_t
    replace(
        const C* from,
        const C* to
        );

    size_t
    replace(
        const C* from,
        size_t fromLength,
        const C* to,
        size_t toLength
        );

    size_t
    replace(
        C from,
        C to
        );

    size_t
    makeLowerCase(CaseConvertMethod method = CaseConvertMethod_Default);

    size_t
    makeUpperCase(CaseConvertMethod method = CaseConvertMethod_Default);

    size_t
    makeCaseFolded(CaseConvertMethod method = CaseConvertMethod_Default);

    size_t
    format_va(
        const C* formatString,
        axl_va_list va
        );

    size_t
    format(
        const C* formatString,
        ...
        );

    size_t
    appendFormat_va(
        const C* formatString,
        axl_va_list va
        );

    size_t
    appendFormat(
        const C* formatString,
        ...
        );

    size_t
    chop(size_t delta);

    bool
    setReducedLength(size_t length);

    bool
    isExclusive();

    bool
    ensureExclusive();

    C*
    getBuffer(size_t* length = NULL);

    C*
    createBuffer(
        size_t length,
        bool saveContents = false
        );

    size_t
    setBuffer(
        rc::BufKind kind,
        void* p,
        size_t size
        );

    C*
    reserve(
        size_t length,
        bool saveContents = false
        );

    size_t
    updateLength();
};

Inherited Members

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;

    // 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;