7#include <Logger/Logger.h>
10#include "../Windows/MicrosoftPlatformString.h"
11#include "../Templates/MemoryOps.h"
12#include "../Templates/UnrealTemplate.h"
13#include "../Math/UnrealMathUtility.h"
14#include "../Misc/CString.h"
18#pragma warning(disable : 4244
)
20struct FStringFormatArg;
49
50
51
62 using ElementType = TCHAR;
71
72
73
74
75
82
83
84
85
86
93
94
95
96
97 template <
typename CharType>
98 FORCEINLINE
FString(
const CharType* Src,
typename TEnableIf<
TIsCharType<CharType>::Value>::Type* Dummy =
nullptr)
102 int32 SrcLen =
TCString<CharType>::Strlen(Src) + 1;
104 Data.AddUninitialized(DestLen);
106 FPlatformString::Convert(Data.GetData(), DestLen, Src, SrcLen);
111
112
113
114
115
116 FORCEINLINE
explicit FString(int32 InCount,
const TCHAR* InSrc)
118 Data.AddUninitialized(InCount ? InCount + 1 : 0);
122 FCString::Strncpy(Data.GetData(), InSrc, InCount + 1);
127
128
129 FORCEINLINE
explicit FString(
const std::string& str)
135
136
137 FORCEINLINE
explicit FString(
const std::wstring& str)
143
144
145
146
149 if (Data.GetData() != Other)
153 Data.AddUninitialized(Len);
157 FMemory::Memcpy(Data.GetData(), Other, Len *
sizeof(TCHAR));
164
165
166
167
168
171 return Data.GetData()[Index];
175
176
177
178
179
180 FORCEINLINE
const TCHAR&
operator[](int32 Index)
const
182 return Data.GetData()[Index];
186
187
188 typedef TArray<TCHAR>::TIterator TIterator;
189 typedef TArray<TCHAR>::TConstIterator TConstIterator;
194 return Data.CreateIterator();
200 return Data.CreateConstIterator();
205
206
207
208 FORCEINLINE
friend DataType::RangedForIteratorType
begin(
FString& Str) {
auto Result = begin(Str.Data);
return Result; }
209 FORCEINLINE
friend DataType::RangedForConstIteratorType
begin(
const FString& Str) {
auto Result = begin(Str.Data);
return Result; }
210 FORCEINLINE
friend DataType::RangedForIteratorType
end(
FString& Str) {
auto Result = end(Str.Data);
if (Str.Data.Num()) { --Result; }
return Result; }
211 FORCEINLINE
friend DataType::RangedForConstIteratorType
end(
const FString& Str) {
auto Result = end(Str.Data);
if (Str.Data.Num()) { --Result; }
return Result; }
216 return Data.GetAllocatedSize();
220
221
227
228
229
230
231 FORCEINLINE
void Empty(int32 Slack = 0)
237
238
239
240
243 return Data.Num() <= 1;
247
248
249
250
251 FORCEINLINE
void Reset(int32 NewReservedSize = 0)
253 const int32 NewSizeIncludingTerminator = (NewReservedSize > 0) ? (NewReservedSize + 1) : 0;
254 Data.Reset(NewSizeIncludingTerminator);
258
259
266
267
268
269
270
271
274 return Index >= 0 && Index <
Len();
278
279
280
281
284 return Data.Num() ? Data.GetData() : TEXT(
"");
288
289
290
291
292
308#if PLATFORM_TCHAR_IS_4_BYTES
317
318
319
320
321
327 int32 Index = Data.Num();
330 Data.AddUninitialized(Count + (Index ? 0 : 1));
332 TCHAR* EndPtr = Data.GetData() + Index - (Index ? 1 : 0);
338 *(EndPtr + Count) = 0;
342
343
344
345
346
357
358
359
360
361
362 template <
typename CharType>
371 int32 InsertIndex = (Data.Num() > 0) ? Data.Num() - 1 : 0;
375 int32 InsertCount = (Data.Num() > 0) ? 1 : 2;
377 Data.AddUninitialized(InsertCount);
378 Data[InsertIndex] = InChar;
379 Data[InsertIndex + 1] = 0;
385
386
387
388
389
410 int32 InsertIndex = (Data.Num() > 0) ? Data.Num() - 1 : 0;
414 int32 FinalCount = (Data.Num() > 0) ? Count : Count + 1;
416 Data.AddUninitialized(FinalCount);
418 for (int32 Index = 0; Index < Count; Index++)
420 Data[InsertIndex + Index] = Text[Index];
423 Data[Data.Num() - 1] = 0;
429
430
431
432
433
434
435 FORCEINLINE
void RemoveAt(int32 Index, int32 Count = 1,
bool bAllowShrinking =
true)
437 Data.RemoveAt(Index, Count, bAllowShrinking);
440 FORCEINLINE
void InsertAt(int32 Index, TCHAR Character)
450 Data.Insert(Character, Index);
465 Data.Insert(Characters.Data.GetData(), Characters.Len(), Index);
471
472
473
474
475
479
480
481
482
483
487
488
489
490
491
492 void PathAppend(
const TCHAR* Str, int32 StrLength);
495
496
497
498
499
511
512
513
514
515
516
517
518 template <
typename CharType>
530
531
532
533
534
535
536
537 template <
typename CharType>
549 template <
typename LhsType,
typename RhsType>
552 Lhs.CheckInvariants();
553 Rhs.CheckInvariants();
557 return MoveTempIfPossible(Rhs);
560 int32 RhsLen = Rhs.Len();
562 FString Result(MoveTempIfPossible(Lhs), RhsLen);
568 template <
typename RhsType>
571 Rhs.CheckInvariants();
575 return MoveTempIfPossible(Rhs);
579 int32 RhsLen = Rhs.Len();
585 Result.Data.AddUninitialized(LhsLen + RhsLen + 1);
587 TCHAR* ResultData = Result.Data.GetData();
589 CopyAssignItems(ResultData + LhsLen, Rhs.Data.GetData(), RhsLen);
590 *(ResultData + LhsLen + RhsLen) = 0;
595 template <
typename LhsType>
598 Lhs.CheckInvariants();
602 return MoveTempIfPossible(Lhs);
607 FString Result(MoveTempIfPossible(Lhs), RhsLen);
615
616
617
618
619
620
621
628
629
630
631
632
633
634
641
642
643
644
645
646
647
654
655
656
657
658
659
660
667
668
669
670
671
672
673
680
681
682
683
684
685
686
693
694
695
696
697
698
699
706
707
708
709
710
711
712
719
720
721
722
723
731
732
733
734
735
743
744
745
746
747
748
759
760
761
762
763
764
775
776
777
778
779
780
783 int32 StrLength = Rhs
.Len();
791
792
793
794
795
796
799 int32 StrLength = Rhs
.Len();
807
808
809
810
811
812
815 int32 StrLength = Rhs
.Len();
823
824
825
826
827
828
829
836
837
838
839
840
841
842
843 template <
typename CharType>
850
851
852
853
854
855
856
857 template <
typename CharType>
864
865
866
867
868
869
870
877
878
879
880
881
882
883
884 template <
typename CharType>
891
892
893
894
895
896
897
898 template <
typename CharType>
905
906
907
908
909
910
911
918
919
920
921
922
923
924
925 template <
typename CharType>
932
933
934
935
936
937
938
939 template <
typename CharType>
946
947
948
949
950
951
952
959
960
961
962
963
964
965
966 template <
typename CharType>
973
974
975
976
977
978
979
980 template <
typename CharType>
987
988
989
990
991
992
993
1000
1001
1002
1003
1004
1005
1006
1007 template <
typename CharType>
1014
1015
1016
1017
1018
1019
1020
1021 template <
typename CharType>
1028
1029
1030
1031
1032
1033
1034
1041
1042
1043
1044
1045
1046
1047
1048 template <
typename CharType>
1055
1056
1057
1058
1059
1060
1061
1062 template <
typename CharType>
1071 return Data.Num() ? Data.Num() - 1 : 0;
1099 FORCEINLINE
FString Mid(int32 Start, int32 Count = INT_MAX)
const
1101 uint32 End = Start + Count;
1108
1109
1110
1111
1112
1113
1114
1115
1120
1121
1122
1123
1124
1125
1126
1127
1131 return Find(*SubStr
, SearchCase
, SearchDir
, StartPosition
);
1135
1136
1137
1138
1139
1140
1141
1149
1150
1151
1152
1153
1154
1155
1163
1164
1165
1166
1167
1168
1169 FORCEINLINE
bool FindChar(TCHAR InChar, int32& Index)
const
1171 return Data.Find(InChar, Index);
1175
1176
1177
1178
1179
1180
1183 return Data.FindLast(InChar, Index);
1187
1188
1189
1190
1191
1192
1193
1194 template <
typename Predicate>
1201
1202
1203
1204
1205
1206
1207
1208 template <
typename Predicate>
1215
1216
1217
1218
1219
1220
1234
1235
1236
1237
1238
1239
1253
1254
1255
1256
1257
1258
1259
1260
1261
1265 int32 InPos =
Find(InS
, SearchCase
, SearchDir
);
1267 if (InPos < 0) {
return false; }
1269 if (LeftS) { *LeftS
= Left(InPos
); }
1279
1280
1281
1291
1292
1293
1312
1313
1314
1315
1316
1317
1318
1319 static FString ChrN(int32 NumCharacters, TCHAR Char);
1322
1323
1324
1325
1326
1330
1331
1332
1333
1334
1338
1339
1340
1341
1342
1346
1347
1348
1349
1350
1354
1355
1356
1357
1358
1359
1360
1364
1365
1369
1370
1371
1375
1376
1377
1381
1382
1386
1387
1388
1392
1393
1394
1398
1399
1403
1404
1405
1409
1410
1411
1415
1416
1420
1421
1425
1426
1427
1428
1429
1430
1431
1432
1436
1437
1438
1439
1440
1441
1442
1443
1444
1448
1449
1450
1451
1452
1453
1454
1458
1459
1460
1461
1462
1463
1464
1465
1466
1470
1471
1472
1473
1474
1475
1479
1480
1484
1485
1489
1490
1491
1492
1493
1494
1495
1499
1500
1501
1502
1503
1504
1505
1506
1510
1511
1515
1516
1517
1518
1519
1520
1521
1525
1526
1527
1528
1532
1533
1534
1535
1542 FORCEINLINE
void Reserve(
const uint32 CharacterCount)
1544 Data.Reserve(CharacterCount + 1);
1559
1560
1561
1562
1563
1564
1565
1566 static bool ToBlob(
const FString& Source, uint8* DestBuffer,
const uint32 DestSize);
1569
1570
1571
1572
1573
1574
1575
1576 static bool ToHexBlob(
const FString& Source, uint8* DestBuffer,
const uint32 DestSize);
1579
1580
1581
1582
1583
1584
1585
1586 template <
typename T,
typename Allocator>
1609
1610
1613 TCHAR* data = Data.GetData();
1618 int size_needed = WideCharToMultiByte(CP_UTF8, 0, &data[0], (
int)
Len(), NULL, 0, NULL, NULL);
1619 std::string str(size_needed, 0);
1620 WideCharToMultiByte(CP_UTF8, 0, &data[0], (
int)Len(), &str[0], size_needed, NULL, NULL);
1625
1626
1627
1628
1629
1630
1631
1632 template <
typename T,
typename... Args>
1664 enum { Value =
true };
1683
1684
1685
1686
1687
1699 Result
+= TCHAR(Value);
1708
1709
1710
1711
1712
1713
1717 const TCHAR* CharPos =
*String;
1719 while (*CharPos && NumBytes < MaxBufferSize)
1721 OutBytes[NumBytes] = (int8)(*CharPos - 1);
1725 return NumBytes - 1;
1733 return TEXT(
'A') + TCHAR(Num - 10);
1735 return TEXT(
'0') + TCHAR(Num);
1739
1740
1741
1742
1750
1751
1752
1753
1754
1769
1770
1771
1772
1775 return (Char >= TEXT(
'0') && Char <= TEXT(
'9')) || (Char >= TEXT(
'A') && Char <= TEXT(
'F')) || (Char >= TEXT(
'a') && Char <= TEXT(
'f'));
1779
1780
1781
1782
1785 check(CheckTCharIsHex(Char));
1786 if (Char >= TEXT(
'0') && Char <= TEXT(
'9'))
1788 return Char - TEXT(
'0');
1790 else if (Char >= TEXT(
'A') && Char <= TEXT(
'F'))
1792 return (Char - TEXT(
'A')) + 10;
1794 return (Char - TEXT(
'a')) + 10;
1798
1799
1800
1801
1802
1806 const bool bPadNibble = (HexString
.Len() % 2) == 1;
1807 const TCHAR* CharPos =
*HexString;
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1849 template<
typename CharType>
1858 return Value ? TEXT(
"true") : TEXT(
"false");
1872 template<
typename T>
1880 template<
typename T>
1895namespace LexicalConversion =
Lex;
1912
1918 static FORCEINLINE
bool Compare(TCHAR Lhs, TCHAR Rhs)
1926 static FORCEINLINE
bool Compare(TCHAR Lhs, TCHAR Rhs)
1932 template <
typename CompareType>
1939 if (
WCh == TEXT(
'*') ||
WCh == TEXT(
'?'))
1949 if (
WCh == TEXT(
'\0'))
1969 if (
WCh == TEXT(
'*') ||
WCh == TEXT(
'?'))
2019 int32 DataLen = FCString::Strlen(Data.GetData());
2020 int32 Len = DataLen > 0 ? DataLen + 1 : 0;
2022 Data.RemoveAt(Len, Data.Num() - Len);
2029 if (SubStr ==
nullptr)
2035 const TCHAR* Start =
**
this;
2060 StartPosition =
Len();
2063 for (int32 i = StartPosition - SearchStringLength; i >= 0; i--)
2066 for (j = 0; SubStr[j]; j++)
2068 if ((*
this)
[i + j
] != SubStr[j])
2099 const int32 StringLength =
Len();
2100 TCHAR* RawData = Data.GetData();
2101 for (int32 i = 0; i < StringLength; ++i)
2123 const int32 StringLength =
Len();
2124 TCHAR* RawData = Data.GetData();
2125 for (int32 i = 0; i < StringLength; ++i)
2157 if (!InSuffix || *InSuffix == TEXT(
'\0'))
2164 if (SuffixLen > ThisLen)
2169 const TCHAR* StrPtr = Data.GetData() + ThisLen - SuffixLen;
2184 return InSuffix
.Len() > 0 &&
2190 return InSuffix
.Len() > 0 &&
2229
2230
2231
2232
2233
2236 int32 DataNum = Data.Num();
2239 if (DataNum > 1 && Data[DataNum - 2] != TEXT(
'/') && Data[DataNum - 2] != TEXT(
'\\'))
2241 Data[DataNum - 1] = TEXT(
'/');
2242 Data.Add(TEXT(
'\0'));
2249 if (DataNum > 1 && Data[DataNum - 2] != TEXT(
'/') && Data[DataNum - 2] != TEXT(
'\\') && *Str != TEXT(
'/'))
2251 Data[DataNum - 1] = TEXT(
'/');
2260 Data.Reserve(DataNum + StrLength + 1);
2261 Data.Append(Str, StrLength);
2262 Data.Add(TEXT(
'\0'));
2336 bool bQuotesWereRemoved =
false;
2337 int32 Start = 0, Count =
Len();
2340 if ((*
this)
[0
] == TCHAR(
'"'))
2344 bQuotesWereRemoved =
true;
2350 bQuotesWereRemoved =
true;
2354 if (bQuotesRemoved !=
nullptr)
2356 *bQuotesRemoved = bQuotesWereRemoved;
2358 return Mid(Start
, Count
);
2364 InArray->Remove(Empty);
2379 TCHAR* StartChar = &(*
this)
[0
];
2380 TCHAR* EndChar = &(*
this)
[Len() - 1
];
2384 TempChar = *StartChar;
2385 *StartChar = *EndChar;
2386 *EndChar = TempChar;
2391 }
while (StartChar < EndChar);
2400 for (int32 x = Number
.Len() - 1; x > -1; --x)
2405 if (dec == 3 && x > 0)
2407 Result
+= TEXT(
",");
2418 const TCHAR* NumberChar[11] = { TEXT(
"0"), TEXT(
"1"), TEXT(
"2"), TEXT(
"3"), TEXT(
"4"), TEXT(
"5"), TEXT(
"6"), TEXT(
"7"), TEXT(
"8"), TEXT(
"9"), TEXT(
"-") };
2419 bool bIsNumberNegative =
false;
2426 bIsNumberNegative =
true;
2430 TempNum[--TempAt] = 0;
2435 TempNum[--TempAt] = *NumberChar[Num % 10];
2440 if (bIsNumberNegative)
2442 TempNum[--TempAt] = *NumberChar[10];
2445 *
this += TempNum + TempAt;
2452 if (DestSize >= (uint32)(Source
.Len() / 3) &&
2455 TCHAR ConvBuffer[4];
2456 ConvBuffer[3] = TEXT(
'\0');
2457 int32 WriteIndex = 0;
2459 for (int32 Index = 0; Index < Source
.Len(); Index += 3, WriteIndex++)
2461 ConvBuffer[0] = Source
[Index
];
2462 ConvBuffer[1] = Source
[Index + 1
];
2463 ConvBuffer[2] = Source
[Index + 2
];
2475 if (DestSize >= (uint32)(Source
.Len() / 2) &&
2478 TCHAR ConvBuffer[3];
2479 ConvBuffer[2] = TEXT(
'\0');
2480 int32 WriteIndex = 0;
2482 TCHAR* End =
nullptr;
2483 for (int32 Index = 0; Index < Source
.Len(); Index += 2, WriteIndex++)
2485 ConvBuffer[0] = Source
[Index
];
2486 ConvBuffer[1] = Source
[Index + 1
];
2496 TCHAR Temp[2] = { Ch,0 };
2504 Temp.Data.AddUninitialized(NumCharacters + 1);
2505 for (int32 Cx = 0; Cx < NumCharacters; ++Cx)
2509 Temp.Data[NumCharacters] = 0;
2515 int32 Pad = ChCount -
Len();
2529 int32 Pad = ChCount -
Len();
2548 return FCString::IsNumeric(Data.GetData());
2552
2553
2554
2555
2556
2557
2558
2559
2560inline int32
FString::ParseIntoArray(
TArray<
FString>& OutArray,
const TCHAR* pchDelim,
const bool InCullEmpty)
const
2564 const TCHAR *Start = Data.GetData();
2566 if (Start && *Start != TEXT(
'\0') && DelimLength)
2570 if (!InCullEmpty || At - Start)
2572 OutArray.Emplace(At - Start, Start);
2574 Start = At + DelimLength;
2576 if (!InCullEmpty || *Start)
2578 OutArray.Emplace(Start);
2606 if (Suffix + 1 < Wildcard
.Len())
2613 Wildcard = Wildcard
.Left(Suffix + 1
);
2618 int32 Prefix =
FMath::Min<int32
>(PrefixIndexOfStar < 0 ? INT_MAX : PrefixIndexOfStar
, PrefixIndexOfQuestion < 0 ? INT_MAX : PrefixIndexOfQuestion
);
2626 Wildcard = Wildcard
.Mid(Prefix
);
2627 Target = Target
.Mid(Prefix
);
2631 TCHAR FirstWild = Wildcard
[0
];
2633 if (FirstWild == TEXT(
'*') || FirstWild == TEXT(
'?'))
2637 if (FirstWild == TEXT(
'*') || Target
.Len() < 2)
2643 for (int32 Index = 0; Index <= MaxNum; Index++)
2664 static const TCHAR* WhiteSpace[] =
2674 int32 NumWhiteSpaces =
ARRAY_COUNT(WhiteSpace) - 1;
2676 if (pchExtraDelim && *pchExtraDelim)
2678 WhiteSpace[NumWhiteSpaces++] = pchExtraDelim;
2687 static const TCHAR* LineEndings[] =
2699#pragma warning(push)
2700#pragma warning(disable : 4291
)
2706 const TCHAR *Start = Data.GetData();
2707 const int32 Length =
Len();
2710 int32 SubstringBeginIndex = 0;
2713 for (int32 i = 0; i <
Len();)
2716 int32 DelimiterLength = 0;
2719 for (int32 DelimIndex = 0; DelimIndex < NumDelims; ++DelimIndex)
2727 SubstringEndIndex = i;
2734 const int32 SubstringLength = SubstringEndIndex - SubstringBeginIndex;
2736 if (!InCullEmpty || SubstringLength != 0)
2739 new (OutArray)
FString(SubstringEndIndex - SubstringBeginIndex
, Start + SubstringBeginIndex
);
2742 SubstringBeginIndex = SubstringEndIndex + DelimiterLength;
2743 i = SubstringBeginIndex;
2752 const int32 SubstringLength = Length - SubstringBeginIndex;
2754 if (!InCullEmpty || SubstringLength != 0)
2757 new (OutArray)
FString(Start + SubstringBeginIndex
);
2776 const TCHAR* Travel = Data.GetData();
2796 Travel = FromLocation + FromLength;
2807 int32 ReplacementCount = 0;
2810 && SearchText !=
nullptr && *SearchText != 0
2816 if (NumCharsToInsert == NumCharsToReplace)
2819 while (Pos !=
nullptr)
2824 for (int32 i = 0; i < NumCharsToInsert; i++)
2826 Pos[i] = ReplacementText[i];
2829 if (Pos + NumCharsToReplace -
**
this <
Len())
2845 TCHAR* WritePosition = (TCHAR*)Copy.Data.GetData();
2848 while (SearchPosition !=
nullptr)
2853 *SearchPosition = 0;
2856 (*
this)
+= WritePosition;
2859 (*
this)
+= ReplacementText;
2862 *SearchPosition = *SearchText;
2864 WritePosition = SearchPosition + NumCharsToReplace;
2869 (*
this)
+= WritePosition;
2873 return ReplacementCount;
2878
2879
2886 const TCHAR* pChar =
**
this;
2888 bool bEscaped =
false;
2895 else if (*pChar == TCHAR(
'\\'))
2899 else if (*pChar == TCHAR(
'"'))
2901 Result
+= TCHAR(
'\\');
2916 { TEXT(
"\\"), TEXT(
"\\\\") },
2917{ TEXT(
"\n"), TEXT(
"\\n") },
2918{ TEXT(
"\r"), TEXT(
"\\r") },
2919{ TEXT(
"\t"), TEXT(
"\\t") },
2920{ TEXT(
"\'"), TEXT(
"\\'") },
2921{ TEXT(
"\""), TEXT(
"\\\"") }
2927
2928
2929
2930
2931
2932
2933
2936 if (
Len() > 0 && (Chars ==
nullptr || Chars
->Num() > 0))
2953
2954
2955
2958 if (
Len() > 0 && (Chars ==
nullptr || Chars
->Num() > 0))
2977
2978
2979
2991 FinalString = LeftSide;
2998 int32 CharactersOnLine = (LeftSide
.Len() - LineBegin);
3000 int32 NumSpacesForTab = InSpacesPerTab - (CharactersOnLine % InSpacesPerTab);
3001 for (int32 i = 0; i < NumSpacesForTab; ++i)
3005 FinalString
+= RightSide;
3013 const TCHAR*
const StartPosition = (
*TargetString) + StartSearch;
3014 const TCHAR* CurrPosition = StartPosition;
3015 int32 ParenthesisCount = 0;
3018 while (*CurrPosition != 0 && *CurrPosition != TEXT(
'('))
3024 if (*CurrPosition == TEXT(
'('))
3029 while (*CurrPosition != 0 && ParenthesisCount > 0)
3031 if (*CurrPosition == TEXT(
'('))
3035 else if (*CurrPosition == TEXT(
')'))
3043 if (ParenthesisCount == 0 && *(CurrPosition - 1) == TEXT(
')'))
3045 return StartSearch + ((CurrPosition - 1) - StartPosition);
static unsigned int GetBuildUniqueId()
ARK_API LPVOID GetDataAddress(const std::string &name)
ARK_API BitField GetBitField(LPVOID base, const std::string &name)
ARK_API BitField GetBitField(const void *base, const std::string &name)
ARK_API DWORD64 GetAddress(const void *base, const std::string &name)
ARK_API LPVOID GetAddress(const std::string &name)
FPlatformTypes::CHAR16 UCS2CHAR
A 16-bit character containing a UCS2 (Unicode, 16-bit, fixed-width) code unit, used for compatibility...
FWindowsPlatformTypes FPlatformTypes
#define PLATFORM_LITTLE_ENDIAN
FPlatformTypes::CHAR8 UTF8CHAR
An 8-bit character containing a UTF8 (Unicode, 8-bit, variable-width) code unit.
FPlatformTypes::CHAR16 UTF16CHAR
A 16-bit character containing a UTF16 (Unicode, 16-bit, variable-width) code unit.
FPlatformTypes::CHAR32 UTF32CHAR
A 32-bit character containing a UTF32 (Unicode, 32-bit, fixed-width) code unit.
TCString< TCHAR > FCString
int32 FindMatchingClosingParenthesis(const FString &TargetString, const int32 StartSearch)
int32 HexToBytes(const FString &HexString, uint8 *OutBytes)
const TCHAR * GetData(const FString &String)
const uint8 TCharToNibble(const TCHAR Char)
const bool CheckTCharIsHex(const TCHAR Char)
FORCEINLINE uint32 GetTypeHash(const FString &Thing)
TCHAR * GetData(FString &String)
SIZE_T GetNum(const FString &String)
void ByteToHex(uint8 In, FString &Result)
static const uint32 MaxSupportedEscapeChars
FString BytesToHex(const uint8 *In, int32 Count)
int32 StringToBytes(const FString &String, uint8 *OutBytes, int32 MaxBufferSize)
static const TCHAR * CharToEscapeSeqMap[][2]
TCHAR NibbleToTChar(uint8 Num)
FString BytesToString(const uint8 *In, int32 Count)
FORCEINLINE TEnableIf< TIsTriviallyCopyAssignable< ElementType >::Value >::Type CopyAssignItems(ElementType *Dest, const ElementType *Source, int32 Count)
#define THRESH_VECTOR_NORMALIZED
#define THRESH_NORMALS_ARE_PARALLEL
#define THRESH_POINTS_ARE_SAME
#define THRESH_POINT_ON_PLANE
#define THRESH_NORMALS_ARE_ORTHOGONAL
#define KINDA_SMALL_NUMBER
#define ARRAY_COUNT(array)
FORCEINLINE TRemoveReference< T >::Type && MoveTemp(T &&Obj)
#define Expose_TNameOf(type)
FORCEINLINE float ComputeSquaredDistanceFromBoxToPoint(const FVector &Mins, const FVector &Maxs, const FVector &Point)
FORCEINLINE FVector ClampVector(const FVector &V, const FVector &Min, const FVector &Max)
FORCEINLINE FVector operator*(float Scale, const FVector &V)
ApiUtils & operator=(ApiUtils &&)=delete
void SetCheatManager(UShooterCheatManager *cheatmanager)
void SetWorld(UWorld *uworld)
ApiUtils & operator=(const ApiUtils &)=delete
void SetShooterGameMode(AShooterGameMode *shooter_game_mode)
std::unordered_map< uint64, AShooterPlayerController * > steam_id_map_
UShooterCheatManager * GetCheatManager() const override
Returns a point to URCON CheatManager.
ApiUtils(ApiUtils &&)=delete
AShooterGameMode * shooter_game_mode_
AShooterGameMode * GetShooterGameMode() const override
Returns a pointer to AShooterGameMode.
void RemovePlayerController(AShooterPlayerController *player_controller)
UShooterCheatManager * cheatmanager_
void SetPlayerController(AShooterPlayerController *player_controller)
ServerStatus GetStatus() const override
Returns the current server status.
AShooterPlayerController * FindPlayerFromSteamId_Internal(uint64 steam_id) const override
~ApiUtils() override=default
void SetStatus(ServerStatus status)
UWorld * GetWorld() const override
Returns a pointer to UWorld.
ApiUtils(const ApiUtils &)=delete
static FString GetSteamName(AController *player_controller)
Returns the steam name of player.
static FORCEINLINE FString GetItemBlueprint(UPrimalItem *item)
Returns blueprint from UPrimalItem.
static FVector GetPosition(APlayerController *player_controller)
Returns the position of a player.
uint64 GetSteamIDForPlayerID(int player_id) const
static FORCEINLINE FString GetClassBlueprint(UClass *the_class)
Returns blueprint path from any UClass.
void SendServerMessageToAll(FLinearColor msg_color, const T *msg, Args &&... args)
Sends server message to all players. Using fmt::format.
virtual UShooterCheatManager * GetCheatManager() const =0
Returns a point to URCON CheatManager.
UPrimalGameData * GetGameData()
Returns pointer to Primal Game Data.
static bool IsRidingDino(AShooterPlayerController *player_controller)
Returns true if character is riding a dino, false otherwise.
AShooterGameState * GetGameState()
Get Shooter Game State.
virtual ~IApiUtils()=default
AShooterPlayerController * FindPlayerFromSteamName(const FString &steam_name) const
Finds player from the given steam name.
static UShooterCheatManager * GetCheatManagerByPC(AShooterPlayerController *SPC)
Get UShooterCheatManager* of player controller.
static uint64 GetPlayerID(AController *controller)
static bool IsPlayerDead(AShooterPlayerController *player)
Returns true if player is dead, false otherwise.
void SendNotificationToAll(FLinearColor color, float display_scale, float display_time, UTexture2D *icon, const T *msg, Args &&... args)
Sends notification (on-screen message) to all players. Using fmt::format.
APrimalDinoCharacter * SpawnDino(AShooterPlayerController *player, FString blueprint, FVector *location, int lvl, bool force_tame, bool neutered) const
Spawns a dino near player or at specific coordinates.
TArray< AShooterPlayerController * > FindPlayerFromCharacterName(const FString &character_name, ESearchCase::Type search, bool full_match) const
Finds all matching players from the given character name.
static FORCEINLINE FString GetBlueprint(UObjectBase *object)
Returns blueprint path from any UObject.
static FString GetCharacterName(AShooterPlayerController *player_controller, bool include_first_name=true, bool include_last_name=true)
Returns the character name of player.
TArray< AActor * > GetAllActorsInRange(FVector location, float radius, EServerOctreeGroup::Type ActorType)
Gets all actors in radius at location.
void SendChatMessageToAll(const FString &sender_name, const T *msg, Args &&... args)
Sends chat message to all players. Using fmt::format.
TArray< AActor * > GetAllActorsInRange(FVector location, float radius, EServerOctreeGroup::Type ActorType, TArray< AActor * > ignores)
Gets all actors in radius at location, with ignore actors.
virtual AShooterGameMode * GetShooterGameMode() const =0
Returns a pointer to AShooterGameMode.
static uint64 GetSteamIdFromController(AController *controller)
Returns Steam ID from player controller.
virtual UWorld * GetWorld() const =0
Returns a pointer to UWorld.
static bool TeleportToPos(AShooterPlayerController *player_controller, const FVector &pos)
Teleports player to the given position.
void SendNotification(AShooterPlayerController *player_controller, FLinearColor color, float display_scale, float display_time, UTexture2D *icon, const T *msg, Args &&... args)
Sends notification (on-screen message) to the specific player. Using fmt::format.
static uint64 GetPlayerID(APrimalCharacter *character)
virtual AShooterPlayerController * FindPlayerFromSteamId_Internal(uint64 steam_id) const =0
AShooterPlayerController * FindControllerFromCharacter(AShooterCharacter *character) const
Finds player controller from the given player character.
static APrimalDinoCharacter * GetRidingDino(AShooterPlayerController *player_controller)
Returns the dino the character is riding.
static FString GetIPAddress(AShooterPlayerController *player_controller)
Returns IP address of player.
AShooterPlayerController * FindPlayerFromSteamId(uint64 steam_id) const
Finds player from the given steam id.
virtual ServerStatus GetStatus() const =0
Returns the current server status.
void SendServerMessage(AShooterPlayerController *player_controller, FLinearColor msg_color, const T *msg, Args &&... args)
Sends server message to the specific player. Using fmt::format.
static std::optional< FString > TeleportToPlayer(AShooterPlayerController *me, AShooterPlayerController *him, bool check_for_dino, float max_dist)
Teleport one player to another.
static int GetInventoryItemCount(AShooterPlayerController *player_controller, const FString &item_name)
Counts a specific items quantity.
void SendChatMessage(AShooterPlayerController *player_controller, const FString &sender_name, const T *msg, Args &&... args)
Sends chat message to the specific player. Using fmt::format.
FORCEINLINE const DataType & GetCharArray() const
FORCEINLINE friend bool operator<=(const FString &Lhs, const CharType *Rhs)
FORCEINLINE void RemoveAt(int32 Index, int32 Count=1, bool bAllowShrinking=true)
FORCEINLINE friend FString operator+(FString &&Lhs, FString &&Rhs)
FORCEINLINE FString & Append(const FString &Text)
FORCEINLINE uint32 GetAllocatedSize() const
FString TrimStart() const &
int32 Find(const TCHAR *SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart, int32 StartPosition=INDEX_NONE) const
FORCEINLINE friend FString operator/(const FString &Lhs, const FString &Rhs)
FORCEINLINE FString(const std::string &str)
int32 ParseIntoArray(TArray< FString > &OutArray, const TCHAR **DelimArray, int32 NumDelims, bool InCullEmpty=true) const
FORCEINLINE friend FString operator+(const FString &Lhs, const TCHAR *Rhs)
FORCEINLINE friend bool operator!=(const FString &Lhs, const CharType *Rhs)
FORCEINLINE int32 Find(const FString &SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart, int32 StartPosition=INDEX_NONE) const
FORCEINLINE friend DataType::RangedForIteratorType end(FString &Str)
FORCEINLINE friend FString operator+(FString &&Lhs, const FString &Rhs)
FString(FString &&)=default
FORCEINLINE FString & operator=(const TCHAR *Other)
FORCEINLINE friend bool operator<(const CharType *Lhs, const FString &Rhs)
FString TrimEnd() const &
FString Replace(const TCHAR *From, const TCHAR *To, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
FORCEINLINE FString LeftChop(int32 Count) const
FORCEINLINE bool FindChar(TCHAR InChar, int32 &Index) const
FORCEINLINE friend bool operator!=(const FString &Lhs, const FString &Rhs)
int32 ReplaceInline(const TCHAR *SearchText, const TCHAR *ReplacementText, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase)
FORCEINLINE FString Mid(int32 Start, int32 Count=INT_MAX) const
FORCEINLINE FString(FString &&Other, int32 ExtraSlack)
static FORCEINLINE FString ConcatFStrings(typename TIdentity< LhsType >::Type Lhs, typename TIdentity< RhsType >::Type Rhs)
static FString Chr(TCHAR Ch)
FORCEINLINE friend DataType::RangedForIteratorType begin(FString &Str)
FORCEINLINE friend FString operator+(const FString &Lhs, FString &&Rhs)
FORCEINLINE DataType & GetCharArray()
FORCEINLINE friend bool operator==(const FString &Lhs, const CharType *Rhs)
static FORCEINLINE FString FromInt(int32 Num)
FORCEINLINE FString & operator+=(const FString &Str)
FString & Append(const TCHAR *Text, int32 Count)
FORCEINLINE FString & operator/=(const FString &Str)
FORCEINLINE friend FString operator+(const FString &Lhs, const FString &Rhs)
FORCEINLINE int32 Compare(const FString &Other, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const
FORCEINLINE friend bool operator<=(const CharType *Lhs, const FString &Rhs)
FORCEINLINE friend bool operator==(const FString &Lhs, const FString &Rhs)
FString TrimStartAndEnd() &&
FORCEINLINE friend FString operator+(const TCHAR *Lhs, const FString &Rhs)
FORCEINLINE TIterator CreateIterator()
FORCEINLINE void Reserve(const uint32 CharacterCount)
FString ReplaceQuotesWithEscapedQuotes() const
FString & operator=(FString &&)=default
static int32 CullArray(TArray< FString > *InArray)
bool MatchesWildcard(const FString &Wildcard, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
FString ConvertTabsToSpaces(const int32 InSpacesPerTab)
bool StartsWith(const TCHAR *InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
FORCEINLINE friend bool operator!=(const CharType *Lhs, const FString &Rhs)
static FORCEINLINE FString ConcatTCHARsToFString(const TCHAR *Lhs, typename TIdentity< RhsType >::Type Rhs)
FORCEINLINE FString Left(int32 Count) const
static bool ToHexBlob(const FString &Source, uint8 *DestBuffer, const uint32 DestSize)
int32 ParseIntoArrayLines(TArray< FString > &OutArray, bool InCullEmpty=true) const
FORCEINLINE bool FindLastChar(TCHAR InChar, int32 &Index) const
std::string ToString() const
Convert FString to std::string.
FString TrimQuotes(bool *bQuotesRemoved=nullptr) const
FORCEINLINE FString & operator+=(const TCHAR *Str)
void AppendInt(int32 InNum)
FORCEINLINE const TCHAR * operator*() const
FORCEINLINE friend FString operator/(FString &&Lhs, const TCHAR *Rhs)
FORCEINLINE friend FString operator/(FString &&Lhs, const FString &Rhs)
FString RightPad(int32 ChCount) const
FORCEINLINE friend TEnableIf< TIsCharType< CharType >::Value, FString >::Type operator+(const FString &Lhs, CharType Rhs)
FORCEINLINE friend DataType::RangedForConstIteratorType end(const FString &Str)
void PathAppend(const TCHAR *Str, int32 StrLength)
FORCEINLINE bool Contains(const FString &SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart) const
FORCEINLINE FString(const CharType *Src, typename TEnableIf< TIsCharType< CharType >::Value >::Type *Dummy=nullptr)
FORCEINLINE FString RightChop(int32 Count) const
bool EndsWith(const FString &InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
static FString ChrN(int32 NumCharacters, TCHAR Char)
static FORCEINLINE FString ConcatFStringToTCHARs(typename TIdentity< LhsType >::Type Lhs, const TCHAR *Rhs)
FORCEINLINE friend FString operator+(const TCHAR *Lhs, FString &&Rhs)
FORCEINLINE TConstIterator CreateConstIterator() const
bool StartsWith(const FString &InPrefix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
FString ToUpper() const &
FString(const FString &)=default
static FString FormatAsNumber(int32 InNumber)
FORCEINLINE bool Equals(const FString &Other, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const
FORCEINLINE bool IsValidIndex(int32 Index) const
FORCEINLINE friend FString operator/(const FString &Lhs, const TCHAR *Rhs)
void TrimStartAndEndInline()
int32 ParseIntoArray(TArray< FString > &OutArray, const TCHAR *pchDelim, bool InCullEmpty=true) const
bool EndsWith(const TCHAR *InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
FORCEINLINE FString(int32 InCount, const TCHAR *InSrc)
FORCEINLINE friend DataType::RangedForConstIteratorType begin(const FString &Str)
FORCEINLINE friend bool operator>(const FString &Lhs, const CharType *Rhs)
FString ReplaceCharWithEscapedChar(const TArray< TCHAR > *Chars=nullptr) const
static bool ToBlob(const FString &Source, uint8 *DestBuffer, const uint32 DestSize)
FORCEINLINE TCHAR & operator[](int32 Index)
FORCEINLINE void InsertAt(int32 Index, TCHAR Character)
FORCEINLINE friend bool operator>=(const CharType *Lhs, const FString &Rhs)
FORCEINLINE friend FString operator/(const TCHAR *Lhs, const FString &Rhs)
FORCEINLINE void AppendChars(const TCHAR *Array, int32 Count)
FORCEINLINE friend TEnableIf< TIsCharType< CharType >::Value, FString >::Type operator+(FString &&Lhs, CharType Rhs)
FORCEINLINE void Shrink()
FORCEINLINE friend bool operator>(const CharType *Lhs, const FString &Rhs)
FORCEINLINE bool IsEmpty() const
FORCEINLINE FString Right(int32 Count) const
FORCEINLINE void InsertAt(int32 Index, const FString &Characters)
FORCEINLINE bool Contains(const TCHAR *SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart) const
FORCEINLINE friend bool operator>(const FString &Lhs, const FString &Rhs)
FORCEINLINE friend bool operator==(const CharType *Lhs, const FString &Rhs)
FORCEINLINE friend bool operator<(const FString &Lhs, const CharType *Rhs)
static FString Join(const TArray< T, Allocator > &Array, const TCHAR *Separator)
bool RemoveFromEnd(const FString &InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase)
FORCEINLINE TEnableIf< TIsCharType< CharType >::Value, FString & >::Type operator+=(CharType InChar)
FORCEINLINE const TCHAR & operator[](int32 Index) const
FORCEINLINE friend bool operator<(const FString &Lhs, const FString &Rhs)
FORCEINLINE friend bool operator>=(const FString &Lhs, const FString &Rhs)
FString ToLower() const &
int32 ParseIntoArrayWS(TArray< FString > &OutArray, const TCHAR *pchExtraDelim=nullptr, bool InCullEmpty=true) const
bool Split(const FString &InS, FString *LeftS, FString *RightS, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart) const
static FString Format(const T *format, Args &&... args)
Formats text using fmt::format.
FString LeftPad(int32 ChCount) const
FORCEINLINE int32 FindLastCharByPredicate(Predicate Pred) const
FORCEINLINE void Reset(int32 NewReservedSize=0)
FORCEINLINE void Empty(int32 Slack=0)
FORCEINLINE int32 Len() const
FORCEINLINE int32 FindLastCharByPredicate(Predicate Pred, int32 Count) const
void TrimToNullTerminator()
bool RemoveFromStart(const FString &InPrefix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase)
FORCEINLINE FString & AppendChar(const TCHAR InChar)
FORCEINLINE friend bool operator>=(const FString &Lhs, const CharType *Rhs)
FORCEINLINE friend bool operator<=(const FString &Lhs, const FString &Rhs)
FORCEINLINE void CheckInvariants() const
FORCEINLINE friend FString operator+(FString &&Lhs, const TCHAR *Rhs)
FString ReplaceEscapedCharWithChar(const TArray< TCHAR > *Chars=nullptr) const
FORCEINLINE FString(const FString &Other, int32 ExtraSlack)
FORCEINLINE FString & operator/=(const TCHAR *Str)
FString & operator=(const FString &)=default
FString TrimStartAndEnd() const &
FORCEINLINE int32 Num() const
FORCEINLINE int32 Add(const ElementType &Item)
void Reset(int32 NewSize=0)
int32 Remove(const ElementType &Item)
void Empty(int32 Slack=0)
FORCEINLINE ElementType * GetData() const
FORCEINLINE ObjectType * Get() const
IApiUtils & GetApiUtils()
void FromString(float &OutValue, const TCHAR *Buffer)
void FromString(int8 &OutValue, const TCHAR *Buffer)
void FromString(uint8 &OutValue, const TCHAR *Buffer)
void FromString(uint32 &OutValue, const TCHAR *Buffer)
TEnableIf< TIsCharType< CharType >::Value, FString >::Type ToString(const CharType *Ptr)
void FromString(int32 &OutValue, const TCHAR *Buffer)
void FromString(uint64 &OutValue, const TCHAR *Buffer)
FString ToSanitizedString(const T &Value)
void FromString(FString &OutValue, const TCHAR *Buffer)
void FromString(double &OutValue, const TCHAR *Buffer)
void FromString(uint16 &OutValue, const TCHAR *Buffer)
static TEnableIf< TIsArithmetic< T >::Value, bool >::Type TryParseString(T &OutValue, const TCHAR *Buffer)
void FromString(int16 &OutValue, const TCHAR *Buffer)
FString ToString(bool Value)
FORCEINLINE FString ToString(FString &&Str)
FORCEINLINE FString ToString(const FString &Str)
void FromString(int64 &OutValue, const TCHAR *Buffer)
bool MatchesWildcardRecursive(const TCHAR *Target, int32 TargetLength, const TCHAR *Wildcard, int32 WildcardLength)
FVector & DefaultActorLocationField()
int & TargetingTeamField()
USceneComponent * RootComponentField()
APlayerState * PlayerStateField()
UCheatManager * CheatManagerField()
FString * GetPlayerNetworkAddress(FString *result)
FUniqueNetIdRepl & UniqueIdField()
FString & PlayerNameField()
bool TeleportTo(FVector *DestLocation, FRotator *DestRotation, bool bIsATest, bool bNoCheck)
UPrimalInventoryComponent * MyInventoryComponentField()
void DoNeuter_Implementation()
static UClass * GetPrivateStaticClass()
void TameDino(AShooterPlayerController *ForPC, bool bIgnoreMaxTameLimit, int OverrideTamingTeamID)
int & TamingTeamIDField()
FString & TamerStringField()
int & AbsoluteBaseLevelField()
UPrimalPlayerData * GetPlayerData()
APrimalDinoCharacter * GetRidingDino()
unsigned __int64 GetSteamIDForPlayerID(int playerDataID)
void AddPlayerID(int playerDataID, unsigned __int64 netUniqueID)
__int64 & LinkedPlayerIDField()
void SetPlayerPos(float X, float Y, float Z)
AActor * SpawnActor(FString *blueprintPath, float spawnDistance, float spawnYOffset, float ZOffset, bool bDoDeferBeginPlay)
AShooterCharacter * GetPlayerCharacter()
FString * GetPlayerName(FString *result)
void SetTribeTamingDinoSettings(APrimalDinoCharacter *aDinoChar)
static uint32 MemCrc32(const void *Data, int32 Lenght)
FIntVector(FVector InVector)
static float UnwindRadians(float A)
static T InterpCircularOut(const T &A, const T &B, float Alpha)
static T InterpEaseInOut(const T &A, const T &B, float Alpha, float Exp)
static T InterpExpoInOut(const T &A, const T &B, float Alpha)
static FORCEINLINE double RoundToNegativeInfinity(double F)
static FORCEINLINE int32 RandRange(int32 Min, int32 Max)
static T BiLerp(const T &P00, const T &P10, const T &P01, const T &P11, const U &FracX, const U &FracY)
static T LerpStable(const T &A, const T &B, double Alpha)
static FORCEINLINE float RandRange(float InMin, float InMax)
static float UnwindDegrees(float A)
static FORCEINLINE float FastAsin(float Value)
static FORCEINLINE float RoundToNegativeInfinity(float F)
static float FindDeltaAngleRadians(float A1, float A2)
static U CubicCRSplineInterp(const U &P0, const U &P1, const U &P2, const U &P3, const float T0, const float T1, const float T2, const float T3, const float T)
static T InterpCircularInOut(const T &A, const T &B, float Alpha)
static float SmoothStep(float A, float B, float X)
static FORCEINLINE T Clamp(const T X, const T Min, const T Max)
static FORCEINLINE float RoundFromZero(float F)
static T CubicInterpSecondDerivative(const T &P0, const T &T0, const T &P1, const T &T1, const U &A)
static int32 LeastCommonMultiplier(int32 a, int32 b)
static FORCEINLINE T Square(const T A)
static T Lerp(const T &A, const T &B, const U &Alpha)
static FORCEINLINE T Max3(const T A, const T B, const T C)
static T InterpEaseOut(const T &A, const T &B, float Alpha, float Exp)
static FORCEINLINE T DivideAndRoundDown(T Dividend, T Divisor)
static FORCEINLINE float RoundToZero(float F)
static FORCEINLINE int32 RandHelper(int32 A)
static int32 GreatestCommonDivisor(int32 a, int32 b)
static T InterpSinOut(const T &A, const T &B, float Alpha)
static T InterpEaseIn(const T &A, const T &B, float Alpha, float Exp)
static FORCEINLINE float RoundToPositiveInfinity(float F)
static FORCEINLINE void PolarToCartesian(const float Rad, const float Ang, float &OutX, float &OutY)
static FORCEINLINE float FRandRange(float InMin, float InMax)
static float FindDeltaAngleDegrees(float A1, float A2)
static FORCEINLINE bool IsPowerOfTwo(T Value)
static FORCEINLINE auto RadiansToDegrees(T const &RadVal) -> decltype(RadVal *(180.f/PI))
static T InterpCircularIn(const T &A, const T &B, float Alpha)
static T InterpStep(const T &A, const T &B, float Alpha, int32 Steps)
static FORCEINLINE T DivideAndRoundUp(T Dividend, T Divisor)
static T InterpExpoOut(const T &A, const T &B, float Alpha)
static T CubicInterpDerivative(const T &P0, const T &T0, const T &P1, const T &T1, const U &A)
static T CubicInterp(const T &P0, const T &T0, const T &P1, const T &T1, const U &A)
static FORCEINLINE double RoundToPositiveInfinity(double F)
static FORCEINLINE void SinCos(float *ScalarSin, float *ScalarCos, float Value)
static FORCEINLINE T Min3(const T A, const T B, const T C)
static FORCEINLINE auto DegreesToRadians(T const &DegVal) -> decltype(DegVal *(PI/180.f))
static T LerpStable(const T &A, const T &B, float Alpha)
static T InterpExpoIn(const T &A, const T &B, float Alpha)
static FORCEINLINE double RoundToZero(double F)
static T InterpSinIn(const T &A, const T &B, float Alpha)
static FORCEINLINE double RoundFromZero(double F)
static T InterpSinInOut(const T &A, const T &B, float Alpha)
static FORCEINLINE bool RandBool()
unsigned __int64 & PlayerDataIDField()
FORCEINLINE FRotator(float InPitch, float InYaw, float InRoll)
TSharedPtr< FUniqueNetId > UniqueNetId
FORCEINLINE FVector operator+(float Bias) const
FORCEINLINE FVector operator*=(float Scale)
bool operator!=(const FVector &V) const
static float Triple(const FVector &X, const FVector &Y, const FVector &Z)
static bool Orthogonal(const FVector &Normal1, const FVector &Normal2, float OrthogonalCosineThreshold=THRESH_NORMALS_ARE_ORTHOGONAL)
static bool Parallel(const FVector &Normal1, const FVector &Normal2, float ParallelCosineThreshold=THRESH_NORMALS_ARE_PARALLEL)
FORCEINLINE FVector operator-(const FVector &V) const
FORCEINLINE FVector operator-=(const FVector &V)
FVector GetSafeNormal(float Tolerance=SMALL_NUMBER) const
static FVector VectorPlaneProject(const FVector &V, const FVector &PlaneNormal)
FVector operator/=(const FVector &V)
static bool PointsAreSame(const FVector &P, const FVector &Q)
FORCEINLINE FVector(float InF)
FORCEINLINE FVector operator+=(const FVector &V)
FORCEINLINE FVector operator-() const
FORCEINLINE FVector operator^(const FVector &V) const
bool IsUniform(float Tolerance=KINDA_SMALL_NUMBER) const
FORCEINLINE FVector operator-(float Bias) const
FRotator ToOrientationRotator() const
FVector(const FLinearColor &InColor)
FVector MirrorByVector(const FVector &MirrorNormal) const
FVector Reciprocal() const
static FORCEINLINE float DistSquaredXY(const FVector &V1, const FVector &V2)
static bool PointsAreNear(const FVector &Point1, const FVector &Point2, float Dist)
bool InitFromString(const FString &InSourceString)
static FORCEINLINE float DotProduct(const FVector &A, const FVector &B)
FVector ComponentMax(const FVector &Other) const
void ToDirectionAndLength(FVector &OutDir, float &OutLength) const
FORCEINLINE float operator|(const FVector &V) const
FRotator Rotation() const
FORCEINLINE FVector GetUnsafeNormal() const
FVector GetClampedToMaxSize(float MaxSize) const
FORCEINLINE FVector operator*(const FVector &V) const
void FindBestAxisVectors(FVector &Axis1, FVector &Axis2) const
FVector(FIntVector InVector)
static const FVector ZeroVector
float SizeSquared2D() const
FVector GetSafeNormal2D(float Tolerance=SMALL_NUMBER) const
float & Component(int32 Index)
static FORCEINLINE float BoxPushOut(const FVector &Normal, const FVector &Size)
FVector operator/(float Scale) const
static FVector RadiansToDegrees(const FVector &RadVector)
FVector2D UnitCartesianToSpherical() const
static float PointPlaneDist(const FVector &Point, const FVector &PlaneBase, const FVector &PlaneNormal)
FVector BoundToCube(float Radius) const
static FORCEINLINE float DistSquared(const FVector &V1, const FVector &V2)
FORCEINLINE FVector GetSignVector() const
FORCEINLINE FVector operator/(const FVector &V) const
static FORCEINLINE float Dist2D(const FVector &V1, const FVector &V2)
FVector ComponentMin(const FVector &Other) const
float & operator[](int32 Index)
static FORCEINLINE float Dist(const FVector &V1, const FVector &V2)
FVector GridSnap(const float &GridSz) const
static bool Coincident(const FVector &Normal1, const FVector &Normal2, float ParallelCosineThreshold=THRESH_NORMALS_ARE_PARALLEL)
FVector Projection() const
static bool Coplanar(const FVector &Base1, const FVector &Normal1, const FVector &Base2, const FVector &Normal2, float ParallelCosineThreshold=THRESH_NORMALS_ARE_PARALLEL)
FORCEINLINE FVector ProjectOnTo(const FVector &A) const
static FVector PointPlaneProject(const FVector &Point, const FVector &PlaneBase, const FVector &PlaneNormal)
bool IsNormalized() const
FORCEINLINE FVector ProjectOnToNormal(const FVector &Normal) const
static FVector PointPlaneProject(const FVector &Point, const FVector &A, const FVector &B, const FVector &C)
bool Equals(const FVector &V, float Tolerance=KINDA_SMALL_NUMBER) const
FQuat ToOrientationQuat() const
bool operator==(const FVector &V) const
FVector GetClampedToSize2D(float Min, float Max) const
float SizeSquared() const
float operator[](int32 Index) const
FVector GetClampedToSize(float Min, float Max) const
static FORCEINLINE float DistSquared2D(const FVector &V1, const FVector &V2)
FVector operator/=(float V)
static FORCEINLINE FVector CrossProduct(const FVector &A, const FVector &B)
FVector operator*=(const FVector &V)
void Set(float InX, float InY, float InZ)
FORCEINLINE FVector operator+(const FVector &V) const
FORCEINLINE FVector operator*(float Scale) const
static FVector DegreesToRadians(const FVector &DegVector)
FORCEINLINE CONSTEXPR FVector(float InX, float InY, float InZ)
FORCEINLINE float CosineAngle2D(FVector B) const
bool AllComponentsEqual(float Tolerance=KINDA_SMALL_NUMBER) const
FVector GetClampedToMaxSize2D(float MaxSize) const
static FORCEINLINE float DistXY(const FVector &V1, const FVector &V2)
static void CreateOrthonormalBasis(FVector &XAxis, FVector &YAxis, FVector &ZAxis)
FORCEINLINE bool IsUnit(float LengthSquaredTolerance=KINDA_SMALL_NUMBER) const
FVector RotateAngleAxis(const float AngleDeg, const FVector &Axis) const
float HeadingAngle() const
static float EvaluateBezier(const FVector *ControlPoints, int32 NumPoints, TArray< FVector > &OutPoints)
float Component(int32 Index) const
FORCEINLINE FVector(const FVector2D V, float InZ)
bool IsNearlyZero(float Tolerance=KINDA_SMALL_NUMBER) const
FORCEINLINE FVector(EForceInit)
static FORCEINLINE float Distance(const FVector &V1, const FVector &V2)
bool Normalize(float Tolerance=SMALL_NUMBER)
static FORCEINLINE uint64 Strtoui64(const CharType *Start, CharType **End, int32 Base)
static CharType * Stristr(CharType *Str, const CharType *Find)
static FORCEINLINE CharType * Strstr(CharType *String, const CharType *Find)
static FORCEINLINE const CharType * Strstr(const CharType *String, const CharType *Find)
static FORCEINLINE double Atod(const CharType *String)
static FORCEINLINE int32 Stricmp(const CharType *String1, const CharType *String2)
static FORCEINLINE int32 Strnicmp(const CharType *String1, const CharType *String2, SIZE_T Count)
static FORCEINLINE float Atof(const CharType *String)
static FORCEINLINE int32 Strlen(const CharType *String)
static FORCEINLINE int32 Atoi(const CharType *String)
static FORCEINLINE int32 Strncmp(const CharType *String1, const CharType *String2, SIZE_T Count)
static FORCEINLINE int32 Strtoi(const CharType *Start, CharType **End, int32 Base)
static const CharType * Stristr(const CharType *Str, const CharType *Find)
static FORCEINLINE int64 Atoi64(const CharType *String)
static FORCEINLINE int32 Strcmp(const CharType *String1, const CharType *String2)
static CharType ToLower(CharType Char)
static bool IsWhitespace(CharType Char)
static CharType ToUpper(CharType Char)
static void FromString(T &Value, const TCHAR *Buffer)
static FString ToSanitizedString(const T &Value)
static FString ToString(const T &Value)
T * Get(bool bEvenIfPendingKill=false)
FORCEINLINE T * operator->()
UObject * GetDefaultObject(bool bCreateIfNeeded)
static FORCEINLINE bool Compare(TCHAR Lhs, TCHAR Rhs)
static FORCEINLINE bool Compare(TCHAR Lhs, TCHAR Rhs)
FString * GetFullName(FString *result, UObject *StopOuter)
bool IsA(UClass *SomeBase)
UPrimalGameData * PrimalGameDataOverrideField()
UPrimalGameData * PrimalGameDataField()
FPrimalPlayerDataStruct * MyDataField()
FVector * GetWorldLocation(FVector *result)
static TArray< AActor * > * ServerOctreeOverlapActors(TArray< AActor * > *result, UWorld *theWorld, FVector AtLoc, float Radius, EServerOctreeGroup::Type OctreeType, bool bForceActorLocationDistanceCheck)
TArray< TAutoWeakObjectPtr< APlayerController > > & PlayerControllerListField()
APlayerController * GetFirstPlayerController()
AGameState * GameStateField()