1#ifndef XPED_YAS_HELPERS_HPP
2#define XPED_YAS_HELPERS_HPP
6#include "yas/serialize.hpp"
7#include "yas/std_types.hpp"
14template <std::
size_t F>
15struct serializer<type_prop::not_a_fundamental, ser_case::use_internal_serializer, F, std::filesystem::path>
17 template <
typename Archive>
18 static Archive& save(Archive& ar,
const std::filesystem::path& p)
20 __YAS_CONSTEXPR_IF(F & yas::json)
22 if(p.string().empty()) {
26 save_string(ar, p.string().data(), p.string().size());
32 ar.write_seq_size(p.string().length());
33 ar.write(p.string().data(), p.string().length());
38 template <
typename Archive>
39 static Archive& load(Archive& ar, std::filesystem::path& p)
43 __YAS_CONSTEXPR_IF(F & yas::json)
48 __YAS_THROW_IF_WRONG_JSON_CHARS(ar,
"\"");
49 }
else if(ch ==
'n') {
51 __YAS_THROW_IF_WRONG_JSON_CHARS(ar,
"null");
53 }
else if(is_valid_for_int_and_double(ar, ch)) {
55 for(ch = ar.peekch(); is_valid_for_int_and_double(ar, ch); ch = ar.peekch()) { tmp += ar.getch(); }
57 __YAS_THROW_IF_WRONG_JSON_CHARS(ar,
"unreachable");
62 const auto size = ar.read_seq_size();
64 ar.read(__YAS_CCAST(
char*, tmp.data()), size);