After attempting to get into C++ for a few weeks now I still get stuck on one issue, these are the lnk issues. I’ve checked for references, which are correct it looks like. The code is below.:
Consoledump.cpp
#pragma once
#include "ConsoleDump.h"
#include "CoreMinimal.h"
#include "FileManager.h"
#include "FileManagerGeneric.h"
#include "FileHelper.h"
FString text;
// FileSystem
bool FORCEINLINE createFindFolder()
{
FString folderLocation = "C:/ProgramData/StoreManager";
IPlatformFile& file = FPlatformFileManager().Get().GetPlatformFile();
if (!file.DirectoryExists(*folderLocation))
{
file.CreateDirectory(*folderLocation);
if (!file.DirectoryExists(*folderLocation))
{
return false;
} else
{
return true;
}
}
return true;
}
bool FORCEINLINE createWriteFile(FString textArray)
{
FString directory = "C:/ProgramData/StoreManager";
FString fileName = "SM_ConsoleDump";
bool overwrite = true;
IPlatformFile& PlatformFile = FPlatformFileManager::Get().GetPlatformFile();
if (PlatformFile.CreateDirectoryTree(*directory))
{
FString absolutepath = directory + "/" + fileName;
if (overwrite || !PlatformFile.FileExists(*absolutepath))
{
//FString linefinder = textArray->FindLastChar;
//int32 lines = textArray->Find(linefinder);
FFileHelper::SaveStringToFile(textArray, *fileName);
return true;
}
return true;
}
return true;
}
// Console //
void FORCEINLINE dumpConsole(FString text)
{
createFindFolder();
if (createFindFolder())
{
createWriteFile(text);
}
}
ConsoleDump.h:
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "FileManager.h"
#include "FileManagerGeneric.h"
#include "FileHelper.h"
#include "ConsoleDump.generated.h"
/**
*
*/
UCLASS()
class STOREBUILDER_API UConsoleDump : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
void dumpConsole();
public:
void dumpConsole(FString text);
};