Function basic_string

Summary

#include <include/EASTL/string.h>

(1) basic_string() EA_NOEXCEPT_IF(EA_NOEXCEPT_EXPR(EASTL_BASIC_STRING_DEFAULT_ALLOCATOR))

(2) explicit basic_string(const allocator_type &allocator) EA_NOEXCEPT

(3) basic_string(const this_type &x, size_type position, size_type n=npos)

(4) basic_string(const value_type *p, size_type n, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

(5) EASTL_STRING_EXPLICIT basic_string(const value_type *p, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

(6) basic_string(size_type n, value_type c, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

(7) basic_string(const this_type &x)

(8) basic_string(const this_type &x, const allocator_type &allocator)

(9) basic_string(const value_type *pBegin, const value_type *pEnd, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

(10) basic_string(CtorDoNotInitialize, size_type n, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

(11) basic_string(CtorSprintf, const value_type *pFormat,...)

(12) basic_string(std::initializer_list< value_type > init, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

(13) basic_string(this_type &&x) EA_NOEXCEPT

(14) basic_string(this_type &&x, const allocator_type &allocator)

(15) explicit basic_string(const view_type &sv, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

(16) basic_string(const view_type &sv, size_type position, size_type n, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

(17) template <typename OtherCharType>
     basic_string(CtorConvert, const OtherCharType *p, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

(18) template <typename OtherCharType>
     basic_string(CtorConvert, const OtherCharType *p, size_type n, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

(19) template <typename OtherStringType>
     basic_string(CtorConvert, const OtherStringType &x)

Function overload

Synopsis

#include <include/EASTL/string.h>

basic_string() EA_NOEXCEPT_IF(EA_NOEXCEPT_EXPR(EASTL_BASIC_STRING_DEFAULT_ALLOCATOR))

Description

Constructor, destructor.

basic_string

Source

Lines 800-805 in include/EASTL/string.h. Line 496 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline basic_string<T, Allocator>::basic_string() EA_NOEXCEPT_IF(EA_NOEXCEPT_EXPR(EASTL_BASIC_STRING_DEFAULT_ALLOCATOR))
    : mPair(allocator_type(EASTL_BASIC_STRING_DEFAULT_NAME))
{
    AllocateSelf();
}

Synopsis

#include <include/EASTL/string.h>

explicit basic_string(const allocator_type &allocator) EA_NOEXCEPT

Description

No description yet.

Source

Lines 808-813 in include/EASTL/string.h. Line 497 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline basic_string<T, Allocator>::basic_string(const allocator_type& allocator) EA_NOEXCEPT
    : mPair(allocator)
{
    AllocateSelf();
}

Synopsis

#include <include/EASTL/string.h>

basic_string(const this_type &x, size_type position, size_type n=npos)

Description

No description yet.

Source

Lines 842-861 in include/EASTL/string.h. Line 498 in include/EASTL/string.h.

template <typename T, typename Allocator>
basic_string<T, Allocator>::basic_string(const this_type& x, size_type position, size_type n)
    : mPair(x.get_allocator())
{
    #if EASTL_STRING_OPT_RANGE_ERRORS
        if (EASTL_UNLIKELY(position > x.internalLayout().GetSize())) // 21.4.2 p4
        {
            ThrowRangeException();
            AllocateSelf();
        }
        else
            RangeInitialize(
                x.internalLayout().BeginPtr() + position,
                x.internalLayout().BeginPtr() + position + eastl::min_alt(n, x.internalLayout().GetSize() - position));
       #else
        RangeInitialize(
            x.internalLayout().BeginPtr() + position,
            x.internalLayout().BeginPtr() + position + eastl::min_alt(n, x.internalLayout().GetSize() - position));
       #endif
}

Synopsis

#include <include/EASTL/string.h>

basic_string(const value_type *p, size_type n, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

Description

No description yet.

Source

Lines 864-869 in include/EASTL/string.h. Line 499 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline basic_string<T, Allocator>::basic_string(const value_type* p, size_type n, const allocator_type& allocator)
    : mPair(allocator)
{
    RangeInitialize(p, p + n);
}

Synopsis

#include <include/EASTL/string.h>

EASTL_STRING_EXPLICIT basic_string(const value_type *p, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

Description

No description yet.

Source

Lines 906-911 in include/EASTL/string.h. Line 500 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline basic_string<T, Allocator>::basic_string(const value_type* p, const allocator_type& allocator)
    : mPair(allocator)
{
    RangeInitialize(p);
}

Synopsis

#include <include/EASTL/string.h>

basic_string(size_type n, value_type c, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

Description

No description yet.

Source

Lines 914-919 in include/EASTL/string.h. Line 501 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline basic_string<T, Allocator>::basic_string(size_type n, value_type c, const allocator_type& allocator)
    : mPair(allocator)
{
    SizeInitialize(n, c);
}

Synopsis

#include <include/EASTL/string.h>

basic_string(const this_type &x)

Description

No description yet.

Source

Lines 816-821 in include/EASTL/string.h. Line 502 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline basic_string<T, Allocator>::basic_string(const this_type& x)
    : mPair(x.get_allocator())
{
    RangeInitialize(x.internalLayout().BeginPtr(), x.internalLayout().EndPtr());
}

Synopsis

#include <include/EASTL/string.h>

basic_string(const this_type &x, const allocator_type &allocator)

Description

No description yet.

Source

Lines 824-829 in include/EASTL/string.h. Line 503 in include/EASTL/string.h.

template <typename T, typename Allocator>
basic_string<T, Allocator>::basic_string(const this_type& x, const allocator_type& allocator)
    : mPair(allocator)
{
    RangeInitialize(x.internalLayout().BeginPtr(), x.internalLayout().EndPtr());
}

Synopsis

#include <include/EASTL/string.h>

basic_string(const value_type *pBegin, const value_type *pEnd, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

Description

No description yet.

Source

Lines 922-927 in include/EASTL/string.h. Line 504 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline basic_string<T, Allocator>::basic_string(const value_type* pBegin, const value_type* pEnd, const allocator_type& allocator)
    : mPair(allocator)
{
    RangeInitialize(pBegin, pEnd);
}

Synopsis

#include <include/EASTL/string.h>

basic_string(CtorDoNotInitialize, size_type n, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

Description

CtorDoNotInitialize exists so that we can create a version that allocates but doesn't initialize but also doesn't collide with any other constructor declaration.

Source

Lines 932-940 in include/EASTL/string.h. Line 505 in include/EASTL/string.h.

template <typename T, typename Allocator>
basic_string<T, Allocator>::basic_string(CtorDoNotInitialize /*unused*/, size_type n, const allocator_type& allocator)
    : mPair(allocator)
{
    // Note that we do not call SizeInitialize here.
    AllocateSelf(n);
    internalLayout().SetSize(0);
    *internalLayout().EndPtr() = 0;
}

Synopsis

#include <include/EASTL/string.h>

basic_string(CtorSprintf, const value_type *pFormat,...)

Description

CtorSprintf exists so that we can create a version that does a variable argument sprintf but also doesn't collide with any other constructor declaration.

Source

Lines 945-957 in include/EASTL/string.h. Line 506 in include/EASTL/string.h.

template <typename T, typename Allocator>
basic_string<T, Allocator>::basic_string(CtorSprintf /*unused*/, const value_type* pFormat, ...)
    : mPair()
{
    const size_type n = (size_type)CharStrlen(pFormat);
    AllocateSelf(n);
    internalLayout().SetSize(0);
    va_list arguments;
    va_start(arguments, pFormat);
    append_sprintf_va_list(pFormat, arguments);
    va_end(arguments);
}

Synopsis

#include <include/EASTL/string.h>

basic_string(std::initializer_list< value_type > init, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

Description

No description yet.

Source

Lines 960-965 in include/EASTL/string.h. Line 507 in include/EASTL/string.h.

template <typename T, typename Allocator>
basic_string<T, Allocator>::basic_string(std::initializer_list<value_type> init, const allocator_type& allocator)
    : mPair(allocator)
{
    RangeInitialize(init.begin(), init.end());
}

Synopsis

#include <include/EASTL/string.h>

basic_string(this_type &&x) EA_NOEXCEPT

Description

No description yet.

Source

Lines 968-974 in include/EASTL/string.h. Line 509 in include/EASTL/string.h.

template <typename T, typename Allocator>
basic_string<T, Allocator>::basic_string(this_type&& x) EA_NOEXCEPT
    : mPair(x.get_allocator())
{
    internalLayout() = eastl::move(x.internalLayout());
    x.AllocateSelf();
}

Synopsis

#include <include/EASTL/string.h>

basic_string(this_type &&x, const allocator_type &allocator)

Description

No description yet.

Source

Lines 977-991 in include/EASTL/string.h. Line 510 in include/EASTL/string.h.

template <typename T, typename Allocator>
basic_string<T, Allocator>::basic_string(this_type&& x, const allocator_type& allocator)
: mPair(allocator)
{
    if(get_allocator() == x.get_allocator()) // If we can borrow from x...
    {
        internalLayout() = eastl::move(x.internalLayout());
        x.AllocateSelf();
    }
    else if(x.internalLayout().BeginPtr())
    {
        RangeInitialize(x.internalLayout().BeginPtr(), x.internalLayout().EndPtr());
        // Let x destruct its own items.
    }
}

Synopsis

#include <include/EASTL/string.h>

explicit basic_string(const view_type &sv, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

Description

No description yet.

Source

Lines 872-876 in include/EASTL/string.h. Line 512 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline basic_string<T, Allocator>::basic_string(const view_type& sv, const allocator_type& allocator)
    : basic_string(sv.data(), sv.size(), allocator)
{
}

Synopsis

#include <include/EASTL/string.h>

basic_string(const view_type &sv, size_type position, size_type n, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

Description

No description yet.

Source

Lines 879-883 in include/EASTL/string.h. Line 513 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline basic_string<T, Allocator>::basic_string(const view_type& sv, size_type position, size_type n, const allocator_type& allocator)
    : basic_string(sv.substr(position, n), allocator)
{
}

Synopsis

#include <include/EASTL/string.h>

template <typename OtherCharType>
basic_string(CtorConvert, const OtherCharType *p, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

Description

No description yet.

Source

Lines 886-893 in include/EASTL/string.h. Line 516 in include/EASTL/string.h.

template <typename T, typename Allocator>
template <typename OtherCharType>
inline basic_string<T, Allocator>::basic_string(CtorConvert, const OtherCharType* p, const allocator_type& allocator)
    : mPair(allocator)
{
    AllocateSelf();    // In this case we are converting from one string encoding to another, and we
    append_convert(p); // implement this in the simplest way, by simply default-constructing and calling assign.
}

Synopsis

#include <include/EASTL/string.h>

template <typename OtherCharType>
basic_string(CtorConvert, const OtherCharType *p, size_type n, const allocator_type &allocator=EASTL_BASIC_STRING_DEFAULT_ALLOCATOR)

Description

No description yet.

Source

Lines 896-903 in include/EASTL/string.h. Line 519 in include/EASTL/string.h.

template <typename T, typename Allocator>
template <typename OtherCharType>
inline basic_string<T, Allocator>::basic_string(CtorConvert, const OtherCharType* p, size_type n, const allocator_type& allocator)
    : mPair(allocator)
{
    AllocateSelf();         // In this case we are converting from one string encoding to another, and we
    append_convert(p, n);   // implement this in the simplest way, by simply default-constructing and calling assign.
}

Synopsis

#include <include/EASTL/string.h>

template <typename OtherStringType>
basic_string(CtorConvert, const OtherStringType &x)

Description

No description yet.

Source

Lines 832-839 in include/EASTL/string.h. Line 522 in include/EASTL/string.h.

template <typename T, typename Allocator>
template <typename OtherStringType>
inline basic_string<T, Allocator>::basic_string(CtorConvert, const OtherStringType& x)
    : mPair(x.get_allocator())
{
    AllocateSelf();
    append_convert(x.c_str(), x.length());
}





Add Discussion as Guest

Log in