A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
VaRestJsonValue.h
Go to the documentation of this file.
1// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved.
2
3#pragma once
4
5#include "VaRestJsonValue.generated.h"
6
8class FJsonValue;
9
13UENUM(BlueprintType)
14enum class EVaJson : uint8
15{
16 None,
18 String,
19 Number,
20 Boolean,
21 Array,
22 Object,
23};
24
28UCLASS(BlueprintType, Blueprintable)
29class VAREST_API UVaRestJsonValue : public UObject
30{
31 GENERATED_UCLASS_BODY()
32
33public:
35 UFUNCTION(BlueprintCallable, Category = "VaRest|Json")
36 void Reset();
37
39 TSharedPtr<FJsonValue>& GetRootValue();
40
42 void SetRootValue(TSharedPtr<FJsonValue>& JsonValue);
43
45 // FJsonValue API
46
48 UFUNCTION(BlueprintPure, Category = "VaRest|Json")
49 EVaJson GetType() const;
50
52 UFUNCTION(BlueprintPure, Category = "VaRest|Json")
53 FString GetTypeString() const;
54
56 UFUNCTION(BlueprintPure, Category = "VaRest|Json")
57 bool IsNull() const;
58
61 UFUNCTION(BlueprintPure, Category = "VaRest|Json")
62 float AsNumber() const;
63
65 UFUNCTION(BlueprintPure, Category = "VaRest|Json")
66 int32 AsInt32() const;
67
69 UFUNCTION(BlueprintPure, Category = "VaRest|Json")
70 int64 AsInt64() const;
71
73 UFUNCTION(BlueprintPure, Category = "VaRest|Json")
74 FString AsString() const;
75
77 UFUNCTION(BlueprintPure, Category = "VaRest|Json")
78 bool AsBool() const;
79
81 UFUNCTION(BlueprintCallable, Category = "VaRest|Json")
82 TArray<UVaRestJsonValue*> AsArray() const;
83
85 UFUNCTION(BlueprintCallable, Category = "VaRest|Json")
86 UVaRestJsonObject* AsObject();
87
89 // Data
90
91private:
93 TSharedPtr<FJsonValue> JsonVal;
94
96 // Helpers
97
98protected:
100 void ErrorMessage(const FString& InType) const;
101};
EVaJson
UENUM(BlueprintType)
UCLASS(BlueprintType, Blueprintable)
UCLASS(BlueprintType, Blueprintable)
TSharedPtr< FJsonValue > JsonVal