diff options
author | flow <flowlnlnln@gmail.com> | 2022-11-20 11:04:10 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-11-20 11:10:26 -0300 |
commit | df0f9259c0bf79e10b27ad5b429b53559ffd15f0 (patch) | |
tree | 0f0d061fb8cc8017de86403e61e2abdcaf732c42 /launcher/minecraft/mod/tasks/LocalResourcePackParseTask.h | |
parent | d92ae530d7c585eb859d852ba1877230a82d867e (diff) | |
download | PrismLauncher-df0f9259c0bf79e10b27ad5b429b53559ffd15f0.tar.gz PrismLauncher-df0f9259c0bf79e10b27ad5b429b53559ffd15f0.tar.bz2 PrismLauncher-df0f9259c0bf79e10b27ad5b429b53559ffd15f0.zip |
refactor: move RP/TP validation to their respective utils
This makes it easier to validate individual resources, and allows the
logic to be used in other places in the future, if we need to.
Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/minecraft/mod/tasks/LocalResourcePackParseTask.h')
-rw-r--r-- | launcher/minecraft/mod/tasks/LocalResourcePackParseTask.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/launcher/minecraft/mod/tasks/LocalResourcePackParseTask.h b/launcher/minecraft/mod/tasks/LocalResourcePackParseTask.h index d3c25464..69dbd6ad 100644 --- a/launcher/minecraft/mod/tasks/LocalResourcePackParseTask.h +++ b/launcher/minecraft/mod/tasks/LocalResourcePackParseTask.h @@ -26,13 +26,19 @@ #include "tasks/Task.h" namespace ResourcePackUtils { -bool process(ResourcePack& pack); -void processZIP(ResourcePack& pack); -void processFolder(ResourcePack& pack); +enum class ProcessingLevel { Full, BasicInfoOnly }; + +bool process(ResourcePack& pack, ProcessingLevel level = ProcessingLevel::Full); + +void processZIP(ResourcePack& pack, ProcessingLevel level = ProcessingLevel::Full); +void processFolder(ResourcePack& pack, ProcessingLevel level = ProcessingLevel::Full); void processMCMeta(ResourcePack& pack, QByteArray&& raw_data); void processPackPNG(ResourcePack& pack, QByteArray&& raw_data); + +/** Checks whether a file is valid as a resource pack or not. */ +bool validate(QFileInfo file); } // namespace ResourcePackUtils class LocalResourcePackParseTask : public Task { |