MCPcopy Create free account
hub / github.com/NotYetGames/DlgSystem / ExportToFileFormat

Method ExportToFileFormat

Source/DlgSystem/Private/DlgDialogue.cpp:494–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492}
493
494void UDlgDialogue::ExportToFileFormat(EDlgDialogueTextFormat TextFormat) const
495{
496 // TODO(vampy): Check for errors
497 const bool bHasExtension = UDlgSystemSettings::HasTextFileExtension(TextFormat);
498 const FString& TextFileName = GetTextFilePathName(TextFormat);
499 if (bHasExtension)
500 {
501 FDlgLogger::Get().Infof(TEXT("Exporting data for Dialogue = `%s` TO file = `%s`"), *GetPathName(), *TextFileName);
502 }
503
504 switch (TextFormat)
505 {
506 case EDlgDialogueTextFormat::JSON:
507 {
508 FDlgJsonWriter JsonWriter;
509 JsonWriter.Write(GetClass(), this);
510 JsonWriter.ExportToFile(TextFileName);
511 break;
512 }
513 case EDlgDialogueTextFormat::DialogueDEPRECATED:
514 {
515 FDlgConfigWriter DlgWriter(TEXT("Dlg"));
516 DlgWriter.Write(GetClass(), this);
517 DlgWriter.ExportToFile(TextFileName);
518 break;
519 }
520 case EDlgDialogueTextFormat::All:
521 {
522 // Useful for debugging
523 // Export to all formats
524 const int32 TextFormatsNum = static_cast<int32>(EDlgDialogueTextFormat::NumTextFormats);
525 for (int32 TextFormatIndex = static_cast<int32>(EDlgDialogueTextFormat::StartTextFormats);
526 TextFormatIndex < TextFormatsNum; TextFormatIndex++)
527 {
528 const EDlgDialogueTextFormat CurrentTextFormat = static_cast<EDlgDialogueTextFormat>(TextFormatIndex);
529 ExportToFileFormat(CurrentTextFormat);
530 }
531 break;
532 }
533 default:
534 // It Should not have any extension
535 check(!bHasExtension);
536 break;
537 }
538}
539
540FDlgParticipantData& UDlgDialogue::GetParticipantDataEntry(FName ParticipantName, FName FallbackParticipantName, bool bCheckNone, const FString& ContextMessage)
541{

Callers

nothing calls this directly

Calls 2

ExportToFileMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected