Documentation for the Unreal C++ Plugin
Loading...
Searching...
No Matches
ApexLibrary.cpp
Go to the documentation of this file.
1// Copyright 2022 PixoVR Corp. All Rights Reserved.
2
3#include "ApexLibrary.h"
4#include "ApexAPI.h"
5#include "Interfaces/IPluginManager.h"
6
7#if WITH_EDITOR
8#include "Editor/EditorEngine.h"
9#endif
10
11FXAPIExtension UApexLibrary::CreateExtensionData(const TMap<FString, UVaRestJsonValue*>& Data)
12{
13 FXAPIExtension Extension;
14
15 for (const TTuple<FString, UVaRestJsonValue*>& ValuePair : Data)
16 {
17 Extension.Add(ValuePair.Key, ValuePair.Value->GetRootValue());
18 }
19
20 return Extension;
21}
22
23UVaRestJsonValue* UApexLibrary::JsonValueFromString(FString String)
24{
25 TSharedPtr<FJsonValue> SharedValue = MakeShared<FJsonValueString>(String);
26 UVaRestJsonValue* RestJsonValue = NewObject<UVaRestJsonValue>();
27 RestJsonValue->SetRootValue(SharedValue);
28
29 return RestJsonValue;
30}
31
33{
34 const auto PluginRef = IPluginManager::Get().FindPlugin("ApexSDK");
35
36 return !PluginRef.IsValid() ? FString("invalid") : PluginRef->GetDescriptor().VersionName;
37}
static UVaRestJsonValue * JsonValueFromString(FString String)
UFUNCTION(BlueprintCallable, Category = "Apex|API")
static FString GetApexSDKVersion()
static FXAPIExtension CreateExtensionData(const TMap< FString, UVaRestJsonValue * > &Data)
UFUNCTION(BlueprintCallable, Category = "Apex|API")
USTRUCT(BlueprintType)
TSharedPtr< FJsonValue > & Add(FString InKey, const TSharedPtr< FJsonValue > &InValue)