32#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
33#ifdef _QX_ENABLE_BOOST_SERIALIZATION
34#ifndef _QX_SERIALIZE_QLINKEDLIST_H_
35#define _QX_SERIALIZE_QLINKEDLIST_H_
41#include <boost/serialization/serialization.hpp>
42#include <boost/serialization/split_free.hpp>
43#include <boost/serialization/nvp.hpp>
45#include <QtCore/qlinkedlist.h>
48namespace serialization {
50template <
class Archive,
typename T>
51inline void save(Archive & ar,
const QLinkedList<T> & t,
const unsigned int file_version)
53 Q_UNUSED(file_version);
54 long lCount = t.count();
55 ar << boost::serialization::make_nvp(
"count", lCount);
57 QLinkedListIterator<T> itr(t);
59 ar << boost::serialization::make_nvp(
"item", itr.next());
62template <
class Archive,
typename T>
63inline void load(Archive & ar, QLinkedList<T> & t,
const unsigned int file_version)
65 Q_UNUSED(file_version);
67 ar >> boost::serialization::make_nvp(
"count", lCount);
72 for (
long l = 0; l < lCount; l++)
74 ar >> boost::serialization::make_nvp(
"item", item);
79template <
class Archive,
typename T>
80inline void serialize(Archive & ar, QLinkedList<T> & t,
const unsigned int file_version)
82 boost::serialization::split_free(ar, t, file_version);
void serialize(Archive &ar, boost::tuple< T0, T1 > &t, const unsigned int file_version)
void load(Archive &ar, boost::unordered_map< Key, Value > &t, const unsigned int)
void save(Archive &ar, const boost::unordered_map< Key, Value > &t, const unsigned int)