Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
TStringConversion< Converter, DefaultConversionSize > Class Template Reference

#include <StringConv.h>

+ Inheritance diagram for TStringConversion< Converter, DefaultConversionSize >:
+ Collaboration diagram for TStringConversion< Converter, DefaultConversionSize >:

Public Member Functions

 TStringConversion (TStringConversion &&)=delete
 
 TStringConversion (const TStringConversion &)=delete
 
TStringConversionoperator= (TStringConversion &&)=delete
 
TStringConversionoperator= (const TStringConversion &)=delete
 
template<typename SrcBufferType , std::enable_if_t< TIsCharEncodingCompatibleWith_V< SrcBufferType, FromType > > * = nullptr>
 TStringConversion (const SrcBufferType *Source)
 
 TStringConversion (const LegacyFromType *Source)
 
template<typename SrcBufferType , std::enable_if_t< TIsCharEncodingCompatibleWith_V< SrcBufferType, FromType > > * = nullptr>
 TStringConversion (const SrcBufferType *Source, int32 SourceLen)
 
 TStringConversion (const LegacyFromType *Source, int32 SourceLen)
 
template<typename FromRangeType , typename FromRangeCharType = std::remove_cv_t<std::remove_pointer_t<decltype(GetData(DeclVal<FromRangeType>()))>, std::enable_if_t< TAnd< TIsContiguousContainer< FromRangeType >, TNot< TIsArray< typename TRemoveReference< FromRangeType >::Type > >, TIsCharEncodingCompatibleWith< FromRangeCharType, FromType > >::Value > * = nullptr>
 TStringConversion (FromRangeType &&Source)
 
FORCEINLINE const ToTypeGet () const UE_LIFETIMEBOUND
 
FORCEINLINE int32 Length () const
 

Private Types

typedef TInlineAllocator< DefaultConversionSize >::template ForElementType< typename Converter::ToType > AllocatorType
 
typedef Converter::FromType FromType
 
typedef Converter::ToType ToType
 
using LegacyFromType = decltype(StringConv::GetLegacyFromType<Converter>(nullptr))
 

Private Member Functions

void Init (const FromType *Source, int32 SourceLen, ENullTerminatedString::Type NullTerminated)
 

Private Attributes

ToTypePtr
 
int32 StringLength
 

Detailed Description

template<typename Converter, int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
class TStringConversion< Converter, DefaultConversionSize >

Class takes one type of string and converts it to another. The class includes a chunk of presized memory of the destination type. If the presized array is too small, it mallocs the memory needed and frees on the class going out of scope.

Definition at line 651 of file StringConv.h.

Member Typedef Documentation

◆ AllocatorType

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
typedef TInlineAllocator<DefaultConversionSize>::template ForElementType<typename Converter::ToType> TStringConversion< Converter, DefaultConversionSize >::AllocatorType
private

Definition at line 653 of file StringConv.h.

◆ FromType

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
typedef Converter::FromType TStringConversion< Converter, DefaultConversionSize >::FromType
private

Definition at line 655 of file StringConv.h.

◆ LegacyFromType

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
using TStringConversion< Converter, DefaultConversionSize >::LegacyFromType = decltype(StringConv::GetLegacyFromType<Converter>(nullptr))
private

Definition at line 658 of file StringConv.h.

◆ ToType

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
typedef Converter::ToType TStringConversion< Converter, DefaultConversionSize >::ToType
private

Definition at line 656 of file StringConv.h.

Constructor & Destructor Documentation

◆ TStringConversion() [1/7]

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
TStringConversion< Converter, DefaultConversionSize >::TStringConversion ( TStringConversion< Converter, DefaultConversionSize > && )
delete

◆ TStringConversion() [2/7]

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
TStringConversion< Converter, DefaultConversionSize >::TStringConversion ( const TStringConversion< Converter, DefaultConversionSize > & )
delete

◆ TStringConversion() [3/7]

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
template<typename SrcBufferType , std::enable_if_t< TIsCharEncodingCompatibleWith_V< SrcBufferType, FromType > > * = nullptr>
TStringConversion< Converter, DefaultConversionSize >::TStringConversion ( const SrcBufferType * Source)
inlineexplicit

Definition at line 686 of file StringConv.h.

◆ TStringConversion() [4/7]

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
TStringConversion< Converter, DefaultConversionSize >::TStringConversion ( const LegacyFromType * Source)
inlineexplicit

Definition at line 698 of file StringConv.h.

◆ TStringConversion() [5/7]

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
template<typename SrcBufferType , std::enable_if_t< TIsCharEncodingCompatibleWith_V< SrcBufferType, FromType > > * = nullptr>
TStringConversion< Converter, DefaultConversionSize >::TStringConversion ( const SrcBufferType * Source,
int32 SourceLen )
inline

Definition at line 707 of file StringConv.h.

◆ TStringConversion() [6/7]

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
TStringConversion< Converter, DefaultConversionSize >::TStringConversion ( const LegacyFromType * Source,
int32 SourceLen )
inline

Definition at line 727 of file StringConv.h.

◆ TStringConversion() [7/7]

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
template<typename FromRangeType , typename FromRangeCharType = std::remove_cv_t<std::remove_pointer_t<decltype(GetData(DeclVal<FromRangeType>()))>, std::enable_if_t< TAnd< TIsContiguousContainer< FromRangeType >, TNot< TIsArray< typename TRemoveReference< FromRangeType >::Type > >, TIsCharEncodingCompatibleWith< FromRangeCharType, FromType > >::Value > * = nullptr>
TStringConversion< Converter, DefaultConversionSize >::TStringConversion ( FromRangeType && Source)
inline

Construct from a compatible character range such as TStringView or TStringBuilder.

Definition at line 746 of file StringConv.h.

Member Function Documentation

◆ Get()

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
FORCEINLINE const ToType * TStringConversion< Converter, DefaultConversionSize >::Get ( ) const
inline

Accessor for the converted string.

Note
The string may not be null-terminated if constructed from an explicitly sized buffer that didn't include the null-terminator.
Returns
A const pointer to the converted string.

Definition at line 757 of file StringConv.h.

◆ Init()

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
void TStringConversion< Converter, DefaultConversionSize >::Init ( const FromType * Source,
int32 SourceLen,
ENullTerminatedString::Type NullTerminated )
inlineprivate

Converts the data by using the Convert() method on the base class

Definition at line 663 of file StringConv.h.

◆ Length()

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
FORCEINLINE int32 TStringConversion< Converter, DefaultConversionSize >::Length ( ) const
inline

Length of the converted string.

Returns
The number of characters in the converted string, excluding any null terminator.

Definition at line 767 of file StringConv.h.

◆ operator=() [1/2]

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
TStringConversion & TStringConversion< Converter, DefaultConversionSize >::operator= ( const TStringConversion< Converter, DefaultConversionSize > & )
delete

◆ operator=() [2/2]

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
TStringConversion & TStringConversion< Converter, DefaultConversionSize >::operator= ( TStringConversion< Converter, DefaultConversionSize > && )
delete

Member Data Documentation

◆ Ptr

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
ToType* TStringConversion< Converter, DefaultConversionSize >::Ptr
private

Definition at line 773 of file StringConv.h.

◆ StringLength

template<typename Converter , int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE>
int32 TStringConversion< Converter, DefaultConversionSize >::StringLength
private

Definition at line 774 of file StringConv.h.


The documentation for this class was generated from the following file: