Function append_convert

Summary

#include <include/EASTL/string.h>

(1) template <typename OtherCharType>
    this_type & append_convert(const OtherCharType *p)

(2) template <typename OtherCharType>
    this_type & append_convert(const OtherCharType *p, size_type n)

(3) template <typename OtherStringType>
    this_type & append_convert(const OtherStringType &x)

(4) template <typename OtherCharType>
    basic_string< T, Allocator > & append_convert(const OtherCharType *pOther)

(5) template <typename OtherStringType>
    basic_string< T, Allocator > & append_convert(const OtherStringType &x)

(6) template <typename OtherCharType>
    basic_string< T, Allocator > & append_convert(const OtherCharType *pOther, size_type n)

Function overload

Synopsis

#include <include/EASTL/string.h>

template <typename OtherCharType>
this_type & append_convert(const OtherCharType *p)

Description

No description yet.

Source

Line 635 in include/EASTL/string.h.

Synopsis

#include <include/EASTL/string.h>

template <typename OtherCharType>
this_type & append_convert(const OtherCharType *p, size_type n)

Description

No description yet.

Source

Line 638 in include/EASTL/string.h.

Synopsis

#include <include/EASTL/string.h>

template <typename OtherStringType>
this_type & append_convert(const OtherStringType &x)

Description

No description yet.

Source

Line 641 in include/EASTL/string.h.

Synopsis

#include <include/EASTL/string.h>

template <typename OtherCharType>
basic_string< T, Allocator > & append_convert(const OtherCharType *pOther)

Description

No description yet.

Source

Lines 1644-1649 in include/EASTL/string.h.

template <typename T, typename Allocator>
template <typename OtherCharType>
basic_string<T, Allocator>& basic_string<T, Allocator>::append_convert(const OtherCharType* pOther)
{
    return append_convert(pOther, (size_type)CharStrlen(pOther));
}

Synopsis

#include <include/EASTL/string.h>

template <typename OtherStringType>
basic_string< T, Allocator > & append_convert(const OtherStringType &x)

Description

No description yet.

Source

Lines 1652-1657 in include/EASTL/string.h.

template <typename T, typename Allocator>
template <typename OtherStringType>
basic_string<T, Allocator>& basic_string<T, Allocator>::append_convert(const OtherStringType& x)
{
    return append_convert(x.c_str(), x.length());
}

Synopsis

#include <include/EASTL/string.h>

template <typename OtherCharType>
basic_string< T, Allocator > & append_convert(const OtherCharType *pOther, size_type n)

Description

No description yet.

Source

Lines 1660-1684 in include/EASTL/string.h.

template <typename T, typename Allocator>
template <typename OtherCharType>
basic_string<T, Allocator>& basic_string<T, Allocator>::append_convert(const OtherCharType* pOther, size_type n)
{
    // Question: What do we do in the case that we have an illegally encoded source string?
    // This can happen with UTF8 strings. Do we throw an exception or do we ignore the input?
    // One argument is that it's not a string class' job to handle the security aspects of a
    // program and the higher level application code should be verifying UTF8 string validity,
    // and thus we should do the friendly thing and ignore the invalid characters as opposed
    // to making the user of this function handle exceptions that are easily forgotten.
    const size_t         kBufferSize = 512;
    value_type           selfBuffer[kBufferSize];   // This assumes that value_type is one of char8_t, char16_t, char32_t, or wchar_t. Or more importantly, a type with a trivial constructor and destructor.
    value_type* const    selfBufferEnd = selfBuffer + kBufferSize;
    const OtherCharType* pOtherEnd = pOther + n;
    while(pOther != pOtherEnd)
    {
        value_type* pSelfBufferCurrent = selfBuffer;
        DecodePart(pOther, pOtherEnd, pSelfBufferCurrent, selfBufferEnd);   // Write pOther to pSelfBuffer, converting encoding as we go. We currently ignore the return value, as we don't yet have a plan for handling encoding errors.
        append(selfBuffer, pSelfBufferCurrent);
    }
    return *this;
}





Add Discussion as Guest

Log in