Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
HexToBytes.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
6#include "Containers/StringFwd.h"
7
8namespace UE::String
9{
10
11/**
12 * Convert an array of hex digits into an array of bytes.
13 *
14 * @param Hex Array of hex digits to convert.
15 * @param OutBytes [out] Array of at least (Hex.Len()+1)/2 output bytes.
16 *
17 * @return Number of bytes written to the output.
18 */
19int32 HexToBytes(FAnsiStringView Hex, uint8* OutBytes);
20int32 HexToBytes(FWideStringView Hex, uint8* OutBytes);
21int32 HexToBytes(FUtf8StringView Hex, uint8* OutBytes);
22
23} // UE::String
#define ARK_API
Definition Ark.h:16
#define checkSlow(expr)
#define check(expr)
@ INDEX_NONE
#define UE_PTRDIFF_TO_INT32(argument)
#define UE_DISABLE_OPTIMIZATION_SHIP
#define UE_ENABLE_OPTIMIZATION_SHIP
#define MAX_int32
#define MIN_int32
FPlatformTypes::CHAR16 UCS2CHAR
A 16-bit character containing a UCS2 (Unicode, 16-bit, fixed-width) code unit, used for compatibility...
Definition Platform.h:975
#define PLATFORM_LITTLE_ENDIAN
Definition Platform.h:144
#define TEXT(x)
Definition Platform.h:1108
#define FORCEINLINE
Definition Platform.h:644
#define UE_NODISCARD
Definition Platform.h:660
FPlatformTypes::CHAR16 UTF16CHAR
A 16-bit character containing a UTF16 (Unicode, 16-bit, variable-width) code unit.
Definition Platform.h:977
int32 HexToBytes(const FString &HexString, uint8 *OutBytes)
Definition String.cpp:1493
static const uint32 MaxSupportedEscapeChars
Definition String.cpp:1274
static const TCHAR * CharToEscapeSeqMap[][2]
Definition String.cpp:1263
UE_DISABLE_OPTIMIZATION_SHIP void StripNegativeZero(double &InFloat)
Definition String.cpp:955
#define STARTING_BUFFER_SIZE
Definition String.cpp:1325
FString SlugStringForValidName(const FString &DisplayString, const TCHAR *ReplaceWith)
Definition String.cpp:1555
void AppendCharacters(TArray< TCHAR > &Out, const CharType *Str, int32 Count)
Definition String.cpp:132
TStringPointer< TCHAR, UTF16CHAR > FTCHARToUTF16
Definition StringConv.h:994
int32 FindMatchingClosingParenthesis(const FString &TargetString, const int32 StartSearch=0)
Definition String.cpp:1512
#define UE_ARRAY_COUNT(array)
#define GET_VARARGS_RESULT(msg, msgsize, len, lastarg, fmt, result)
Definition VarArgs.h:39
virtual void Serialize(void *V, int64 Length)
Definition Archive.h:1569
ARK_API void AppendChars(const UCS2CHAR *Str, int32 Count)
Definition String.cpp:357
ARK_API FString(const UTF8CHAR *Str)
Definition String.cpp:251
FORCEINLINE const TCHAR & operator[](int32 Index) const UE_LIFETIMEBOUND
FORCEINLINE void MidInline(int32 Start, int32 Count=MAX_int32, bool bAllowShrinking=true)
UE_NODISCARD FString Reverse() const &
Definition String.cpp:804
UE_NODISCARD FString TrimStart() const &
Definition String.cpp:702
UE_NODISCARD FORCEINLINE FString Mid(int32 Start) const &
ARK_API void AppendChars(const ANSICHAR *Str, int32 Count)
Definition String.cpp:345
UE_NODISCARD static ARK_API FString ConcatFF(const FString &Lhs, const FString &Rhs)
Definition String.cpp:611
static UE_NODISCARD FString FromHexBlob(const uint8 *SrcBuffer, const uint32 SrcSize)
Definition String.cpp:919
FORCEINLINE TCHAR & operator[](int32 Index) UE_LIFETIMEBOUND
UE_NODISCARD FString TrimEnd() const &
Definition String.cpp:725
void TrimStartInline()
Definition String.cpp:692
UE_NODISCARD static ARK_API FString ConcatFF(FString &&Lhs, FString &&Rhs)
Definition String.cpp:614
ARK_API FString(int32 Len, const WIDECHAR *Str)
Definition String.cpp:254
ARK_API void AppendChars(const UTF8CHAR *Str, int32 Count)
Definition String.cpp:363
UE_NODISCARD FString TrimStart() &&
Definition String.cpp:709
UE_NODISCARD static ARK_API FString ConcatFF(FString &&Lhs, const FString &Rhs)
Definition String.cpp:612
UE_NODISCARD FString TrimStartAndEnd() &&
Definition String.cpp:686
UE_NODISCARD FString TrimQuotes(bool *bQuotesRemoved=nullptr) const &
Definition String.cpp:770
static UE_NODISCARD FORCEINLINE FString FromInt(int32 Num)
FString & operator=(FString &&)=default
ARK_API void RemoveAt(int32 Index, int32 Count=1, bool bAllowShrinking=true)
Definition String.cpp:484
UE_NODISCARD FString Mid(int32 Start, int32 Count) const &
static bool ToHexBlob(const FString &Source, uint8 *DestBuffer, const uint32 DestSize)
Definition String.cpp:931
void ConvertTabsToSpacesInline(const int32 InSpacesPerTab)
Definition String.cpp:1296
ARK_API int32 ParseIntoArrayLines(TArray< FString > &OutArray, bool InCullEmpty=true) const
Definition String.cpp:1147
UE_NODISCARD FString RightPad(int32 ChCount) const
Definition String.cpp:1055
UE_NODISCARD FORCEINLINE int32 Len() const
void TrimQuotesInline(bool *bQuotesRemoved=nullptr)
Definition String.cpp:765
void TrimEndInline()
Definition String.cpp:715
UE_NODISCARD FORCEINLINE friend FString operator+(const FString &Lhs, FString &&Rhs)
UE_NODISCARD FString TrimEnd() &&
Definition String.cpp:732
bool Split(const FString &InS, FString *LeftS, FString *RightS, ESearchCase::Type SearchCase, ESearchDir::Type SearchDir=ESearchDir::FromStart) const
Definition String.cpp:384
static UE_NODISCARD FString FromBlob(const uint8 *SrcBuffer, const uint32 SrcSize)
Definition String.cpp:884
ARK_API void AppendChars(const WIDECHAR *Str, int32 Count)
Definition String.cpp:351
ARK_API FString(const ANSICHAR *Str, int32 ExtraSlack)
Definition String.cpp:257
UE_NODISCARD bool IsNumeric() const
ARK_API FString(const UCS2CHAR *Str, int32 ExtraSlack)
Definition String.cpp:260
FString(const FString &)=default
static UE_NODISCARD FString FormatAsNumber(int32 InNumber)
Definition String.cpp:837
UE_NODISCARD FORCEINLINE const TCHAR * operator*() const UE_LIFETIMEBOUND
UE_NODISCARD FString TrimQuotes(bool *bQuotesRemoved=nullptr) &&
Definition String.cpp:777
ARK_API FString(const WIDECHAR *Str)
Definition String.cpp:250
void TrimStartAndEndInline()
Definition String.cpp:680
ARK_API FString(const UCS2CHAR *Str)
Definition String.cpp:252
void SerializeAsANSICharArray(FArchive &Ar, int32 MinCharacters=0) const
Definition String.cpp:864
UE_NODISCARD static ARK_API FString ConcatFF(const FString &Lhs, FString &&Rhs)
Definition String.cpp:613
UE_NODISCARD int32 Find(const FString &SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart, int32 StartPosition=INDEX_NONE) const
static bool ToBlob(const FString &Source, uint8 *DestBuffer, const uint32 DestSize)
Definition String.cpp:896
void RemoveSpacesInline()
Definition String.cpp:425
void Shrink()
Definition String.cpp:327
ARK_API void Empty()
Definition String.cpp:321
void InsertAt(int32 Index, const FString &Characters)
Definition String.cpp:469
ARK_API FString(const WIDECHAR *Str, int32 ExtraSlack)
Definition String.cpp:258
UE_NODISCARD FORCEINLINE bool Contains(const FString &SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart) const
void ReverseString()
Definition String.cpp:817
bool Split(const FString &InS, FString *LeftS, FString *RightS) const
Definition String.cpp:414
ARK_API FString(int32 Len, const UCS2CHAR *Str)
Definition String.cpp:256
ARK_API FString(const ANSICHAR *Str)
Definition String.cpp:249
ARK_API FString(const UTF8CHAR *Str, int32 ExtraSlack)
Definition String.cpp:259
ARK_API FString(int32 Len, const ANSICHAR *Str)
Definition String.cpp:253
void Reserve(int32 CharacterCount)
Definition String.cpp:307
static UE_NODISCARD FString SanitizeFloat(double InFloat, const int32 InMinFractionalDigits=1)
Definition String.cpp:964
UE_NODISCARD FString ReplaceQuotesWithEscapedQuotes() &&
Definition String.cpp:1232
ARK_API void Empty(int32 Slack)
Definition String.cpp:316
UE_NODISCARD FString LeftPad(int32 ChCount) const
Definition String.cpp:1042
UE_NODISCARD FORCEINLINE friend FString operator+(FString &&Lhs, const FString &Rhs)
UE_NODISCARD FString Reverse() &&
Definition String.cpp:811
UE_NODISCARD FORCEINLINE DataType & GetCharArray() UE_LIFETIMEBOUND
ARK_API FString(int32 Len, const UTF8CHAR *Str)
Definition String.cpp:255
void TrimToNullTerminator()
Definition String.cpp:369
UE_NODISCARD FORCEINLINE FString Left(int32 Count) const &
FORCEINLINE void CheckInvariants() const
FORCEINLINE void LeftInline(int32 Count, bool bAllowShrinking=true)
FString & operator=(const FString &)=default
void ReplaceEscapedCharWithCharInline(const TArray< TCHAR > *Chars=nullptr)
Definition String.cpp:1276
@ CaseSensitive
Definition CString.h:25
void InlineCombineSurrogates(FString &Str)
Definition String.cpp:1603
bool MatchesWildcardRecursive(const TCHAR *Target, int32 TargetLength, const TCHAR *Wildcard, int32 WildcardLength)
Definition String.cpp:49
FORCEINLINE void ConstructWithSlack(TArray< TCHAR > &Data, const CharType *Src, int32 ExtraSlack)
Definition String.cpp:217
UE_NODISCARD FORCEINLINE FString ConcatFStringRange(LhsType &&Lhs, const TCHAR *Rhs, int32 RhsLen)
Definition String.cpp:571
UE_NODISCARD FORCEINLINE FString ConcatFStrings(LhsType &&Lhs, RhsType &&Rhs)
Definition String.cpp:525
UE_NODISCARD FORCEINLINE FString ConcatRangeFString(const TCHAR *Lhs, int32 LhsLen, RhsType &&Rhs)
Definition String.cpp:544
UE_NODISCARD FORCEINLINE FString ConcatCStringFString(const TCHAR *Lhs, RhsType &&Rhs)
Definition String.cpp:587
UE_NODISCARD FORCEINLINE FString ConcatFStringCString(LhsType &&Lhs, const TCHAR *Rhs)
Definition String.cpp:599
FORCEINLINE void ConstructFromCString(TArray< TCHAR > &Data, const CharType *Src)
Definition String.cpp:186
FORCEINLINE void ConstructWithLength(TArray< TCHAR > &Data, int32 InCount, const CharType *InSrc)
Definition String.cpp:200
int32 HexToBytes(FUtf8StringView Hex, uint8 *OutBytes)
int32 HexToBytes(FAnsiStringView Hex, uint8 *OutBytes)
int32 HexToBytes(FWideStringView Hex, uint8 *OutBytes)
Definition Vector.h:40
void SetCriticalError()
Definition Archive.h:113
FORCEINLINE bool IsByteSwapping()
Definition Archive.h:165
FORCEINLINE int64 GetMaxSerializeSize() const
Definition Archive.h:481
FORCEINLINE bool IsLoading() const
Definition Archive.h:249
static void Free(void *Original)
static FORCEINLINE void * Memmove(void *Dest, const void *Src, SIZE_T Count)
static void * Realloc(void *Original, SIZE_T Size, uint32 Alignment=DEFAULT_ALIGNMENT)
static FORCEINLINE void * Memcpy(void *Dest, const void *Src, SIZE_T Count)
static FORCEINLINE bool Compare(TCHAR Lhs, TCHAR Rhs)
Definition String.cpp:42
static FORCEINLINE bool Compare(TCHAR Lhs, TCHAR Rhs)
Definition String.cpp:34