You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
* Changed Config GetTable to return a pointer that can be null if table does not exist [CL 34393645 by henrik karlsson in ue5-main branch]
40 lines
961 B
C++
40 lines
961 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "UbaConfig.h"
|
|
|
|
namespace uba
|
|
{
|
|
bool TestConfig(Logger& logger, const StringBufferBase& rootDir)
|
|
{
|
|
static const char* configText =
|
|
"RootDir = \"e:\\foo\"\r\n"
|
|
"[CacheClient]\r\n"
|
|
"UseDirectoryPreparsing = true\r\n"
|
|
"# Comment = true\r\n"
|
|
"";
|
|
|
|
Config config;
|
|
if (!config.LoadFromText(logger, configText, strlen(configText)))
|
|
return false;
|
|
|
|
const ConfigTable* tablePtr = config.GetTable(TC("CacheClient"));
|
|
if (!tablePtr)
|
|
return false;
|
|
const ConfigTable& table = *tablePtr;
|
|
bool test = false;
|
|
if (!table.GetValueAsBool(test, TC("UseDirectoryPreparsing")))
|
|
return false;
|
|
if (test != true)
|
|
return false;
|
|
const tchar* str = nullptr;
|
|
if (!table.GetValueAsString(str, TC("RootDir")))
|
|
return false;
|
|
if (TStrcmp(str, TC("e:\\foo")) != 0)
|
|
return false;
|
|
if (table.GetValueAsBool(test, TC("Comment")))
|
|
return false;
|
|
return true;
|
|
}
|
|
} |