#pragma once #include #include #include #include #include #include #include namespace hex { class EncodingFile { public: enum class Type { Thingy }; EncodingFile() = default; EncodingFile(Type type, const std::fs::path &path); EncodingFile(Type type, const std::string &path); [[nodiscard]] std::pair getEncodingFor(std::span buffer) const; [[nodiscard]] size_t getEncodingLengthFor(std::span buffer) const; [[nodiscard]] size_t getLongestSequence() const { return this->m_longestSequence; } [[nodiscard]] bool valid() const { return this->m_valid; } [[nodiscard]] const std::string& getTableContent() const { return this->m_tableContent; } private: void parse(const std::string &content); bool m_valid = false; std::string m_tableContent; std::map, std::string>> m_mapping; size_t m_longestSequence = 0; }; }