| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include <filesystem> |
| 7 | #include <optional> |
| 8 | #include <string> |
| 9 | #include <string_view> |
| 10 | #include <utility> |
| 11 | #include <vector> |
| 12 | |
| 13 | class IProfile; |
| 14 | |
| 15 | class IProfileFileParser |
| 16 | { |
| 17 | public: |
| 18 | static constexpr std::string_view ProfileDataFileName{"profile"}; |
| 19 | static constexpr std::string_view IconDataFileName{"icon"}; |
| 20 | |
| 21 | virtual std::string fileExtension() const = 0; |
| 22 | |
| 23 | virtual std::optional<std::vector<char>> |
| 24 | load(std::filesystem::path const &path, |
| 25 | std::string const &internalDataName) = 0; |
| 26 | |
| 27 | virtual bool |
| 28 | save(std::filesystem::path const &path, |
| 29 | std::vector<std::pair<std::string, std::vector<char>>> const &data) = 0; |
| 30 | |
| 31 | virtual ~IProfileFileParser() = default; |
| 32 | }; |