Files
UnrealEngineUWP/Engine/Plugins/Experimental/Web/WebAPI/Source/WebAPILiquidJS/Private/WebAPILiquidJSSettings.cpp
George Rolfe d5e0097429 WebAPI plugin moved to experimental
#jira UE-159081
#rb none
#preflight 62cb89d7604402cc47bfce7e

[CL 21036518 by George Rolfe in ue5-main branch]
2022-07-10 22:56:39 -04:00

39 lines
984 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "WebAPILiquidJSSettings.h"
FString UWebAPILiquidJSSettings::GetServiceUrl(const FString& InSubPath)
{
// Remove prefix / to avoid double-up
FString SubPath = InSubPath;
SubPath.RemoveFromStart(TEXT("/"));
if(Port != FormattedWithPort)
{
FormattedServiceUrl = FString::Format(*ServiceUrl, FStringFormatNamedArguments(
{{ TEXT("Port"), Port }}
));
FormattedServiceUrl.RemoveFromEnd(TEXT("/"));
FormattedWithPort = Port;
check(!FormattedServiceUrl.Contains(TEXT("{")));
check(!FormattedServiceUrl.Contains(TEXT("}")));
}
return FormattedServiceUrl + TEXT("/") + SubPath;
}
FString UWebAPILiquidJSSettings::GetServiceUrl(const FString& InSubPath) const
{
if(Port != FormattedWithPort)
{
// Need to call non-const version before this is ever called!
checkNoEntry();
}
FString SubPath = InSubPath;
SubPath.RemoveFromStart(TEXT("/"));
return FormattedServiceUrl + TEXT("/") + SubPath;
}