32#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
33#ifdef _QX_ENABLE_BOOST_SERIALIZATION
34#ifndef _QX_SERIALIZE_QVECTOR_H_
35#define _QX_SERIALIZE_QVECTOR_H_
41#include <boost/serialization/serialization.hpp>
42#include <boost/serialization/split_free.hpp>
43#include <boost/serialization/nvp.hpp>
45#include <QtCore/qvector.h>
48namespace serialization {
50template <
class Archive,
typename T>
51inline void save(Archive & ar,
const QVector<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 for (
long l = 0; l < lCount; l++)
58 ar << boost::serialization::make_nvp(
"item", t.at(l));
61template <
class Archive,
typename T>
62inline void load(Archive & ar, QVector<T> & t,
const unsigned int file_version)
64 Q_UNUSED(file_version);
66 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, QVector<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)