Duke's Big Numbers 1.0
C++ and Blueprint libraries for performing math, analysis, and formatting with really large numbers (>10e308).
Loading...
Searching...
No Matches
BigIntegerFormatterLibrary.h
1// Copyright (C)2023 Smiling Cat Entertainment, LTD. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Kismet/BlueprintFunctionLibrary.h"
7#include "Format/BigIntegerFormatter.h"
8#include "Format/DecimalInvariantFormatter.h"
9#include "Format/DecimalFullFormatter.h"
10#include "Format/DecimalScalingFormatter.h"
11#include "Format/HexadecimalInvariantFormatter.h"
12#include "Format/ScientificGroupLabeler.h"
13#include "Format/NamedGroupLabeler.h"
14#include "Format/SIUnitsGroupLabeler.h"
15#include "BigIntegerFormatterLibrary.generated.h"
16
20UENUM(BlueprintType)
21enum class EDefaultFormatterType : uint8
22{
23 DecimalInvariant,
24 DecimalFull,
25 DecimalScaledNamed,
26 DecimalScaledScientific,
27 DecimalScaledEngineering,
28 DecimalScaledSIName,
29 DecimalScaledSISymbol,
30 HexadecimalInvariant,
31};
32
36UENUM(BlueprintType)
37enum class EDefaultGroupLabelerType : uint8
38{
39 Scientific,
40 Named,
41 SIName,
42 SISymbol,
43};
44
48UCLASS()
49class DUKESBIGNUMBERS_API UBigIntegerFormatterLibrary : public UBlueprintFunctionLibrary
50{
51 GENERATED_BODY()
52
53public:
54
61 UFUNCTION(BlueprintPure, meta = (DisplayName = "To Invariant Decimal String", CompactNodeTitle = "->DEC$"), Category = "Math|BigInteger")
62 static FString ToDecimalInvariantString(const FBigInteger& Number);
63
71 UFUNCTION(BlueprintCallable, meta = (DisplayName = "Append Invariant Decimal To String", CompactNodeTitle = "+DEC$"), Category = "Math|BigInteger")
72 static FString& AppendDecimalInvariantToString(const FBigInteger& Number, UPARAM(ref) FString& AppendTo);
73
80 UFUNCTION(BlueprintPure, meta = (DisplayName = "To Full Decimal String", CompactNodeTitle = "->FMTDEC$"), Category = "Math|BigInteger")
81 static FString ToDecimalFullString(const FBigInteger& Number);
82
90 UFUNCTION(BlueprintCallable, meta = (DisplayName = "Append Full Decimal To String", CompactNodeTitle = "+FMTDEC$"), Category = "Math|BigInteger")
91 static FString& AppendDecimalFullToString(const FBigInteger& Number, UPARAM(ref) FString& AppendTo);
92
99 UFUNCTION(BlueprintPure, meta = (DisplayName = "To Scientific String", CompactNodeTitle = "->SCI$"), Category = "Math|BigInteger")
100 static FString ToScientificString(const FBigInteger& Number);
101
109 UFUNCTION(BlueprintCallable, meta = (DisplayName = "Append Scientific To String", CompactNodeTitle = "+SCI$"), Category = "Math|BigInteger")
110 static FString& AppendScientificToString(const FBigInteger& Number, UPARAM(ref) FString& AppendTo);
111
118 UFUNCTION(BlueprintPure, meta = (DisplayName = "To Engineering String", CompactNodeTitle = "->ENG$"), Category = "Math|BigInteger")
119 static FString ToEngineeringString(const FBigInteger& Number);
120
128 UFUNCTION(BlueprintCallable, meta = (DisplayName = "Append Engineering To String", CompactNodeTitle = "+ENG$"), Category = "Math|BigInteger")
129 static FString& AppendEngineeringToString(const FBigInteger& Number, UPARAM(ref) FString& AppendTo);
130
137 UFUNCTION(BlueprintPure, meta = (DisplayName = "To Named String", CompactNodeTitle = "->thous$"), Category = "Math|BigInteger")
138 static FString ToNamedString(const FBigInteger& Number);
139
147 UFUNCTION(BlueprintCallable, meta = (DisplayName = "Append Named To String", CompactNodeTitle = "+thous$"), Category = "Math|BigInteger")
148 static FString& AppendNamedToString(const FBigInteger& Number, UPARAM(ref) FString& AppendTo);
149
156 UFUNCTION(BlueprintPure, meta = (DisplayName = "To SIName String", CompactNodeTitle = "->kilo$"), Category = "Math|BigInteger")
157 static FString ToSINameString(const FBigInteger& Number);
158
166 UFUNCTION(BlueprintCallable, meta = (DisplayName = "Append SIName To String", CompactNodeTitle = "+kilo$"), Category = "Math|BigInteger")
167 static FString& AppendSINameToString(const FBigInteger& Number, UPARAM(ref) FString& AppendTo);
168
175 UFUNCTION(BlueprintPure, meta = (DisplayName = "To SISymbol String", CompactNodeTitle = "->k$"), Category = "Math|BigInteger")
176 static FString ToSISymbolString(const FBigInteger& Number);
177
185 UFUNCTION(BlueprintCallable, meta = (DisplayName = "Append SISymbol To String", CompactNodeTitle = "+k$"), Category = "Math|BigInteger")
186 static FString& AppendSISymbolToString(const FBigInteger& Number, UPARAM(ref) FString& AppendTo);
187
194 UFUNCTION(BlueprintPure, meta = (DisplayName = "To Invariant Hexadecimal String", CompactNodeTitle = "->HEX$"), Category = "Math|BigInteger")
195 static FString ToHexadecimalInvariantString(const FBigInteger& Number);
196
204 UFUNCTION(BlueprintCallable, meta = (DisplayName = "Append Invariant Hexadecimal To String", CompactNodeTitle = "+HEX$"), Category = "Math|BigInteger")
205 static FString& AppendHexadecimalInvariantToString(const FBigInteger& Number, UPARAM(ref) FString& AppendTo);
206
213 UFUNCTION(BlueprintPure, meta = (DisplayName = "Get Default Formatter"), Category = "Math|BigInteger")
214 static UBigIntegerFormatter* GetDefaultFormatter(EDefaultFormatterType Type);
215
222 UFUNCTION(BlueprintPure, meta = (DisplayName = "Get Scientific Group Label"), Category = "Math|BigInteger")
223 static FString GetScientificGroupLabel(int32 PowerOfTen);
224
233 UFUNCTION(BlueprintCallable, meta = (DisplayName = "Append Scientific Group Label"), Category = "Math|BigInteger")
234 static FString& AppendScientificGroupLabel(int32 PowerOfTen, UPARAM(ref) FString& AppendTo, int32& Remainder);
235
242 UFUNCTION(BlueprintPure, meta = (DisplayName = "Get Named Group Label"), Category = "Math|BigInteger")
243 static FString GetNamedGroupLabel(int32 PowerOfTen);
244
253 UFUNCTION(BlueprintCallable, meta = (DisplayName = "Append Named Group Label"), Category = "Math|BigInteger")
254 static FString& AppendNamedGroupLabel(int32 PowerOfTen, UPARAM(ref) FString& AppendTo, int32& Remainder);
255
262 UFUNCTION(BlueprintPure, meta = (DisplayName = "Get SI Name Group Label"), Category = "Math|BigInteger")
263 static FString GetSINameGroupLabel(int32 PowerOfTen);
264
273 UFUNCTION(BlueprintCallable, meta = (DisplayName = "Append SI Name Group Label"), Category = "Math|BigInteger")
274 static FString& AppendSINameGroupLabel(int32 PowerOfTen, UPARAM(ref) FString& AppendTo, int32& Remainder);
275
282 UFUNCTION(BlueprintPure, meta = (DisplayName = "Get SI Symbol Group Label"), Category = "Math|BigInteger")
283 static FString GetSISymbolGroupLabel(int32 PowerOfTen);
284
293 UFUNCTION(BlueprintCallable, meta = (DisplayName = "Append SI Symbol Group Label"), Category = "Math|BigInteger")
294 static FString& AppendSISymbolGroupLabel(int32 PowerOfTen, UPARAM(ref) FString& AppendTo, int32& Remainder);
295
302 UFUNCTION(BlueprintPure, meta = (DisplayName = "Get Default Group Labeler"), Category = "Math|BigInteger")
303 static UGroupLabeler* GetDefaultGroupLabeler(EDefaultGroupLabelerType Type);
304
305};
306
307// If conditional inlining is ON, include inlinable functions here.
308#if DBN_INLINE_ENABLED
309#include "BigIntegerFormatterLibrary.inl"
310#endif
Definition: BigIntegerFormatter.h:19
Definition: BigIntegerFormatterLibrary.h:50
Definition: GroupLabeler.h:19
Definition: BigInteger.h:50