// Copyright 2020 Citra Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. #pragma once #include #include #include "common/serialization/boost_discrete_interval.hpp" namespace boost::serialization { template void save(Archive& ar, const boost::icl::interval_set& set, const unsigned int file_version) { ar << static_cast(set.iterative_size()); for (auto& v : set) { ar << v; } } template void load(Archive& ar, boost::icl::interval_set& set, const unsigned int file_version) { u64 count{}; ar >> count; set.clear(); for (u64 i = 0; i < count; i++) { typename boost::icl::interval_set::interval_type value{}; ar >> value; set += value; } } template void serialize(Archive& ar, boost::icl::interval_set& set, const unsigned int file_version) { boost::serialization::split_free(ar, set, file_version); } } // namespace boost::serialization