diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-03-27 16:58:18 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-03-27 16:58:18 +0200 |
commit | 9c053ec1b1c7cd91ca6c0cc6f65803cc3f114c7f (patch) | |
tree | 70f49e064a00d3abdc0f6da3854a5b237ffc77ef /lib/embed.h | |
parent | Initial commit (diff) | |
download | rcc-9c053ec1b1c7cd91ca6c0cc6f65803cc3f114c7f.tar.xz |
Add namespace to format
rcc:
- add -n/--namespace to command line
- make default compression None
- fix None compression not printing hexdumps
libembed:
- add a zstd decompression test
Diffstat (limited to 'lib/embed.h')
-rw-r--r-- | lib/embed.h | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/lib/embed.h b/lib/embed.h index 566b14c..bd041ff 100644 --- a/lib/embed.h +++ b/lib/embed.h @@ -1,34 +1,29 @@ #pragma once -#include <span> -#include <string> -#include <unordered_map> -#include <frozen/unordered_map.h> #include <frozen/string.h> +#include <frozen/unordered_map.h> +#include <span> +#include <vector> -namespace embed { +namespace embed +{ enum Compression { None, Zstd }; -struct ResourceData { - Compression compression = None; - std::span<const unsigned char> dictionary; -}; - -class Resources { +template <Compression c> +class Resources +{ public: - explicit Resources(const ResourceData &info); + Resources() = default; + explicit Resources(const std::span<const unsigned char> &dictionary); + ~Resources(); - [[nodiscard]] - std::span<unsigned char> decompress(const std::span<const unsigned char> &entry); + [[nodiscard]] std::vector<unsigned char> decompress(const std::span<const unsigned char> &entry); -private: - const ResourceData m_info; }; // class } - |