-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add quotes automatically to the fields that require them.
- Loading branch information
1 parent
641f3db
commit 93dc0e4
Showing
3 changed files
with
51 additions
and
7 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
Source/PubnubLibrary/Private/FunctionLibraries/PubnubUtilities.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright 2024 PubNub Inc. All Rights Reserved. | ||
|
||
|
||
#include "FunctionLibraries/PubnubUtilities.h" | ||
#include "Json.h" | ||
|
||
|
||
FString UPubnubUtilities::AddQuotesToString(const FString InString, bool SkipIfHasQuotes) | ||
{ | ||
if(InString.Left(1) != "\"" || InString.Right(1) != "\"" || !SkipIfHasQuotes) | ||
{ | ||
return "\"" + InString + "\""; | ||
} | ||
|
||
return InString; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
Source/PubnubLibrary/Public/FunctionLibraries/PubnubUtilities.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2024 PubNub Inc. All Rights Reserved. | ||
|
||
#pragma once | ||
|
||
#include "CoreMinimal.h" | ||
#include "Kismet/BlueprintFunctionLibrary.h" | ||
#include "PubnubUtilities.generated.h" | ||
|
||
/** | ||
* | ||
*/ | ||
UCLASS() | ||
class PUBNUBLIBRARY_API UPubnubUtilities : public UBlueprintFunctionLibrary | ||
{ | ||
GENERATED_BODY() | ||
public: | ||
|
||
static FString AddQuotesToString(const FString InString, bool SkipIfHasQuotes = true); | ||
}; |