2022-09-22 20:07:56 -04:00
|
|
|
//
|
|
|
|
// EuropaTools
|
|
|
|
//
|
2025-01-07 14:17:50 -05:00
|
|
|
// (C) 2021-2025 modeco80 <lily.modeco80@protonmail.ch>
|
2022-09-22 20:07:56 -04:00
|
|
|
//
|
2025-01-07 18:02:27 -05:00
|
|
|
// SPDX-License-Identifier: MIT
|
2022-09-22 20:07:56 -04:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef EUROPA_IO_PAKPROGRESSREPORTSINK_H
|
|
|
|
#define EUROPA_IO_PAKPROGRESSREPORTSINK_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace europa::io {
|
|
|
|
|
2025-01-07 15:13:10 -05:00
|
|
|
/// Interface for [PakWriter] to output detailed progress information.
|
2022-09-22 20:07:56 -04:00
|
|
|
struct PakProgressReportSink {
|
|
|
|
struct PakEvent {
|
2025-01-07 15:13:10 -05:00
|
|
|
enum class EventCode {
|
|
|
|
FillInHeader, /// Filling in header.
|
|
|
|
WritingHeader, /// Writing header.
|
|
|
|
WritingToc /// Writing archive TOC.
|
2022-09-22 20:07:56 -04:00
|
|
|
};
|
|
|
|
|
2025-01-07 15:13:10 -05:00
|
|
|
EventCode eventCode;
|
2022-09-22 20:07:56 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct FileEvent {
|
2025-01-07 15:13:10 -05:00
|
|
|
enum class EventCode {
|
|
|
|
FileWriteBegin, /// File has began write to package
|
|
|
|
FileWriteEnd, /// File has been written to package
|
2022-09-22 20:07:56 -04:00
|
|
|
};
|
|
|
|
|
2025-01-07 15:13:10 -05:00
|
|
|
EventCode eventCode;
|
|
|
|
const std::string& targetFileName;
|
2022-09-22 20:07:56 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
virtual ~PakProgressReportSink() = default;
|
|
|
|
|
|
|
|
virtual void OnEvent(const PakEvent& event) = 0;
|
|
|
|
virtual void OnEvent(const FileEvent& event) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace europa::io
|
|
|
|
|
|
|
|
#endif // EUROPA_IO_PAKPROGRESSREPORTSINK_H
|