// Fill out your copyright notice in the Description page of Project Settings.


#include "BPTools.h"

FString UBPTools::ReadConfigString(const FString& FilePath)
{

    if (!FPaths::FileExists(FilePath))
    {
        UE_LOG(LogTemp, Error, TEXT("file no exist: %s"), *FilePath);
        return "";
    }

    FString FileContent;
    bool bSuccess = FFileHelper::LoadFileToString(FileContent, *FilePath);
    if (bSuccess)
    {
        UE_LOG(LogTemp, Log, TEXT("file content : %s"), *FileContent);
        return FileContent;
    }
    else
    {
        UE_LOG(LogTemp, Error, TEXT("file read failed: %s"), *FilePath);
        return "";
    }
    return FileContent;
}