draconisplusplus/include/rfl/parsing/Parser_map_like.hpp

32 lines
962 B
C++
Raw Normal View History

2024-05-31 22:59:00 -04:00
#ifndef RFL_PARSING_PARSER_MAP_LIKE_HPP_
#define RFL_PARSING_PARSER_MAP_LIKE_HPP_
#include <map>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <unordered_map>
#include "../Result.hpp"
#include "../always_false.hpp"
#include "MapParser.hpp"
#include "Parser_base.hpp"
namespace rfl {
2024-06-08 14:10:59 -04:00
namespace parsing {
2024-05-31 22:59:00 -04:00
2024-06-08 14:10:59 -04:00
template <class R, class W, class T, class ProcessorsType>
requires AreReaderAndWriter<R, W, std::map<std::string, T>>
struct Parser<R, W, std::map<std::string, T>, ProcessorsType>
2024-06-16 00:13:15 -04:00
: public MapParser<R, W, std::map<std::string, T>, ProcessorsType> {};
2024-05-31 22:59:00 -04:00
2024-06-08 14:10:59 -04:00
template <class R, class W, class T, class ProcessorsType>
requires AreReaderAndWriter<R, W, std::unordered_map<std::string, T>>
struct Parser<R, W, std::unordered_map<std::string, T>, ProcessorsType>
2024-06-16 00:13:15 -04:00
: public MapParser<R, W, std::unordered_map<std::string, T>, ProcessorsType> {};
2024-05-31 22:59:00 -04:00
2024-06-08 14:10:59 -04:00
} // namespace parsing
} // namespace rfl
2024-05-31 22:59:00 -04:00
#endif