Files
UnrealEngineUWP/Engine/Plugins/Web/WebAPI/Source/WebAPILiquidJS/Private/WebAPILiquidJSSettings.cpp
George Rolfe e54c69d811 WebAPI re-submit
#rb simon.therriault
#jira UETOOL-4463
#preflight 62424a85c61d8a458f223a59

[CL 19540648 by George Rolfe in ue5-main branch]
2022-03-29 08:43:59 -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;
}