Function copy
Synopsis
#include <include/EASTL/string.h>
size_type copy(value_type *p, size_type n, size_type position=0) const
Description
No description yet.
Source
Lines 2592-2606 in include/EASTL/string.h. Line 679 in include/EASTL/string.h.
template <typename T, typename Allocator>
typename basic_string<T, Allocator>::size_type
basic_string<T, Allocator>::copy(value_type* p, size_type n, size_type position) const
{
#if EASTL_STRING_OPT_RANGE_ERRORS
if(EASTL_UNLIKELY(position > internalLayout().GetSize()))
ThrowRangeException();
#endif
// C++ std says the effects of this function are as if calling char_traits::copy()
// thus the 'p' must not overlap *this string, so we can use memcpy
const size_type nLength = eastl::min_alt(n, internalLayout().GetSize() - position);
CharStringUninitializedCopy(internalLayout().BeginPtr() + position, internalLayout().BeginPtr() + position + nLength, p);
return nLength;
}