Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Finish v1.1-r20
Browse files Browse the repository at this point in the history
  • Loading branch information
ufna committed Mar 7, 2018
2 parents 198828d + 5a75e8b commit bf0f8e0
Show file tree
Hide file tree
Showing 20 changed files with 1,524 additions and 75 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Key features:

Check the [Wiki](https://hiazma.atlassian.net/wiki/display/VAR) for plugin usage examples and installation notes.

Current version: **1.1 R 18** (UE 4.16-4.17)
Current version: **1.1 R 20** (UE 4.18)

![SCREENSHOT](SCREENSHOT.jpg)

Expand All @@ -23,5 +23,5 @@ Legal info

Unreal® is a trademark or registered trademark of Epic Games, Inc. in the United States of America and elsewhere.

Unreal® Engine, Copyright 1998 – 2017, Epic Games, Inc. All rights reserved.
Unreal® Engine, Copyright 1998 – 2018, Epic Games, Inc. All rights reserved.

1 change: 0 additions & 1 deletion Source/VaRestEditorPlugin/Private/VaRestEditorPlugin.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2015 Vladimir Alyamkin. All Rights Reserved.
// Original code by https://github.com/unktomi

#include "VaRestEditorPluginPrivatePCH.h"
#include "VaRestEditorPlugin.h"

#define LOCTEXT_NAMESPACE "FVaRestEditorPluginModule"
Expand Down
16 changes: 0 additions & 16 deletions Source/VaRestEditorPlugin/Private/VaRestEditorPluginPrivatePCH.h

This file was deleted.

10 changes: 8 additions & 2 deletions Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// Copyright 2015 Vladimir Alyamkin. All Rights Reserved.
// Original code by https://github.com/unktomi

#include "VaRestEditorPluginPrivatePCH.h"
#include "VaRest_BreakJson.h"

#include "Runtime/Launch/Resources/Version.h"
#include "KismetCompiler.h"
#include "EditorCategoryUtils.h"
#include "EdGraphUtilities.h"
#include "EdGraph/EdGraph.h"
#include "EdGraph/EdGraphNodeUtils.h" // for FNodeTextCache
#include "BlueprintNodeSpawner.h"
#include "BlueprintActionDatabaseRegistrar.h"

#include "Runtime/Launch/Resources/Version.h"

#define LOCTEXT_NAMESPACE "VaRest_BreakJson"

Expand Down
5 changes: 3 additions & 2 deletions Source/VaRestEditorPlugin/VaRestEditorPlugin.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ public class VaRestEditorPlugin : ModuleRules
{
public VaRestEditorPlugin(ReadOnlyTargetRules Target) : base(Target)
{

PublicIncludePaths.AddRange(
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

PublicIncludePaths.AddRange(
new string[] {
"VaRestPlugin",
"VaRestPlugin/Public"
Expand Down
20 changes: 20 additions & 0 deletions Source/VaRestPlugin/Classes/VaRestJsonObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "VaRestJsonObject.generated.h"

class UVaRestJsonValue;
class FJsonObject;

/**
* Blueprintable FJsonObject wrapper
Expand Down Expand Up @@ -166,6 +167,25 @@ class VARESTPLUGIN_API UVaRestJsonObject : public UObject
void SetObjectArrayField(const FString& FieldName, const TArray<UVaRestJsonObject*>& ObjectArray);


//////////////////////////////////////////////////////////////////////////
// Deserialize

public:
/** Deserialize byte content to json */
int32 DeserializeFromUTF8Bytes(const ANSICHAR* Bytes, int32 Size);

/** Deserialize byte content to json */
int32 DeserializeFromTCHARBytes(const TCHAR* Bytes, int32 Size);

/** Deserialize byte stream from reader */
void DecodeFromArchive(TUniquePtr<FArchive>& Reader);

/** Save json to file */
bool WriteToFile(const FString& Path);

static bool WriteStringToArchive(FArchive& Ar, const TCHAR* StrPtr, int64 Len);


//////////////////////////////////////////////////////////////////////////
// Data

Expand Down
1 change: 1 addition & 0 deletions Source/VaRestPlugin/Classes/VaRestJsonValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "VaRestJsonValue.generated.h"

class UVaRestJsonObject;
class FJsonValue;

/**
* Represents all the types a Json Value can be.
Expand Down
12 changes: 12 additions & 0 deletions Source/VaRestPlugin/Classes/VaRestLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@ class UVaRestLibrary : public UBlueprintFunctionLibrary
static bool Base64DecodeData(const FString& Source, TArray<uint8>& Dest);


//////////////////////////////////////////////////////////////////////////
// File system integration

public:
/**
* Load JSON from formatted text file
* @param Path File name relative to the Content folder
*/
UFUNCTION(BlueprintCallable, Category = "VaRest|Utility", meta = (WorldContext = "WorldContextObject"))
static class UVaRestJsonObject* LoadJsonFromFile(UObject* WorldContextObject, const FString& Path);


//////////////////////////////////////////////////////////////////////////
// Easy URL processing

Expand Down
26 changes: 24 additions & 2 deletions Source/VaRestPlugin/Classes/VaRestRequestJSON.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#pragma once

#include "Engine/LatentActionManager.h"
#include "LatentActions.h"
#include "Http.h"

#include "VaRestTypes.h"
Expand Down Expand Up @@ -210,6 +211,7 @@ class VARESTPLUGIN_API UVaRestRequestJSON : public UObject
/** Apply current internal setup to request and process it */
void ProcessRequest();


//////////////////////////////////////////////////////////////////////////
// Request callbacks

Expand Down Expand Up @@ -262,13 +264,29 @@ class VARESTPLUGIN_API UVaRestRequestJSON : public UObject
// Data

public:
/** Request response stored as a string */
/**
* Get request response stored as a string
* @param bCacheResponseContent - Set true if you plan to use it few times to prevent deserialization each time
*/
UFUNCTION(BlueprintCallable, Category = "VaRest|Response")
FString GetResponseContentAsString(bool bCacheResponseContent = true);

public:
/** Response size */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "VaRest|Response")
int32 ResponseSize;

/** DEPRECATED: Please use GetResponseContentAsString() instead */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "VaRest|Response")
FString ResponseContent;

/** Is the response valid JSON? */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "VaRest|Response")
bool bIsValidJsonResponse;

protected:
/** Default value for deprecated ResponseContent variable */
static FString DeprecatedResponseString;

protected:
/** Latent action helper */
Expand Down Expand Up @@ -309,5 +327,9 @@ class VARESTPLUGIN_API UVaRestRequestJSON : public UObject

/** Request we're currently processing */
TSharedRef<IHttpRequest> HttpRequest = FHttpModule::Get().CreateRequest();


public:
/** Returns reference to internal request object */
TSharedRef<IHttpRequest> GetHttpRequest() const { return HttpRequest; };

};
Loading

0 comments on commit bf0f8e0

Please sign in to comment.