Agrarsense
|
#include <CSVFile.h>
Public Member Functions | |
void | WriteRow (const TArray< FString > &Cells) |
void | OpenFilePath () |
void | Close () |
void | Destroy () |
Static Public Member Functions | |
static UCSVFile * | CreateCSVFile (const FString &FileNameWithoutExtension, const FCSVFileSettings &Settings) |
Private Member Functions | |
void | Create (const FString &FileNameWithoutExtension, const FCSVFileSettings &Settings) |
void | OpenStream () |
void | WriteRaw (const FString &Line) |
Private Attributes | |
TArray< FString > | PendingRows |
FString | FilePath |
FCSVFileSettings | CurrentSettings |
std::ofstream | CSVStream |
CSV file writer utility Usage example:
FCSVFileSettings Settings; UCSVFile* CSV = UCSVFile::CreateCSVFile("MyCoolCSVFile", Settings); CSV->WriteRow({ TEXT("Time"), TEXT("X"), TEXT("Y"), TEXT("Z") }); CSV->WriteRow({ TEXT("12.3"), TEXT("100"), TEXT("200"), TEXT("300") }); CSV->Destroy();
void UCSVFile::Close | ( | ) |
Definition at line 107 of file CSVFile.cpp.
References CSVStream, CurrentSettings, FCSVFileSettings::FileWriteOption, PendingRows, Queue, and WriteRaw().
Referenced by Destroy().
|
private |
Definition at line 25 of file CSVFile.cpp.
References FCSVFileSettings::CreateUnique, CurrentSettings, FCSVFileSettings::CustomPath, FilePath, UAgrarsensePaths::GetDataFolder(), and OpenStream().
Referenced by CreateCSVFile().
|
static |
Definition at line 14 of file CSVFile.cpp.
References Create().
Referenced by AInstancedRendererManager::ExportTreesAsCSV().
void UCSVFile::Destroy | ( | ) |
Definition at line 125 of file CSVFile.cpp.
References Close().
Referenced by AInstancedRendererManager::ExportTreesAsCSV().
void UCSVFile::OpenFilePath | ( | ) |
Definition at line 131 of file CSVFile.cpp.
References FilePath, and UFileUtilities::OpenFileExplorer().
|
private |
Definition at line 53 of file CSVFile.cpp.
References FCSVFileSettings::Append, CSVStream, CurrentSettings, and FilePath.
Referenced by Create(), WriteRaw(), and WriteRow().
|
private |
Definition at line 99 of file CSVFile.cpp.
References CSVStream, and OpenStream().
Referenced by Close(), and WriteRow().
void UCSVFile::WriteRow | ( | const TArray< FString > & | Cells | ) |
Definition at line 69 of file CSVFile.cpp.
References CSVStream, CurrentSettings, FCSVFileSettings::Delimiter, FCSVFileSettings::FileWriteOption, Immediate, OpenStream(), PendingRows, Queue, Semicolon, Tab, and WriteRaw().
Referenced by AInstancedRendererManager::ExportTreesAsCSV().
|
private |
Definition at line 91 of file CSVFile.h.
Referenced by Close(), OpenStream(), WriteRaw(), and WriteRow().
|
private |
Definition at line 89 of file CSVFile.h.
Referenced by Close(), Create(), OpenStream(), and WriteRow().
|
private |
Definition at line 87 of file CSVFile.h.
Referenced by Create(), OpenFilePath(), and OpenStream().
|
private |
Definition at line 85 of file CSVFile.h.
Referenced by Close(), and WriteRow().