ファイルの中身を返す
Source
FileInfo.h
// Fill out your copyright notice in the Description page of Project Settings.
# pragma once
# include "Kismet/BlueprintFunctionLibrary.h"
# include "FileInfo.generated.h"
/**
*
*/
UCLASS()
class CPPSAMPLE_API UFileInfo : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public :
UFUNCTION(BlueprintCallable, Category = "MyBPLibrary")
static FString FileLoadStr(FString CompleteFilePath);
};
FileInfo.cpp
// Fill out your copyright notice in the Description page of Project Settings.
# include "CPPSample.h"
# include "FileInfo.h"
FString UFileInfo::FileLoadStr(FString CompleteFilePath)
{
FString FileData = "";
FFileHelper::LoadFileToString(FileData, *CompleteFilePath);
return FileData;
}
組み合わせる
UE4 CPP ファイル一覧を取得して配列に格納するブループリントの作成
http://qiita.com/gansaibow/private/7dee2f3d61af9bd8b37f
指定したディレクトリ配下のTextファイルの文字列を出力する
参考URL
FFileHelper::LoadFileToString
https://docs.unrealengine.com/latest/INT/API/Runtime/Core/Misc/FFileHelper/LoadFileToString/index.html
Reading Text File Line by Line
https://answers.unrealengine.com/questions/81697/reading-text-file-line-by-line.html