LeechCraft 0.6.70-19214-g121e5318a7
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
serialization.cpp
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#include "serialization.h"
10#include <QtDebug>
11#include <util/sll/logging.h>
12
13namespace LC::Util
14{
15 namespace detail
16 {
17 void ReportBadVersion (std::source_location loc, qint64 min, qint64 max, qint64 version)
18 {
19 LogAt (loc).warning () << "unsupported version" << version << "; expected [" << min << " .. " << max << "]";
20 }
21
22 void ReportBadStreamStatus (std::source_location loc, QDataStream::Status status)
23 {
24 LogAt (loc).warning () << "bad stream status" << status;
25 }
26 }
27
28 template UTIL_SYS_API std::optional<quint8> EnsureVersion<quint8> (QDataStream&, quint8, quint8, std::source_location);
29 template UTIL_SYS_API std::optional<qint8> EnsureVersion<qint8> (QDataStream&, qint8, qint8, std::source_location);
30 template UTIL_SYS_API std::optional<quint16> EnsureVersion<quint16> (QDataStream&, quint16, quint16, std::source_location);
31}
void ReportBadVersion(std::source_location loc, qint64 min, qint64 max, qint64 version)
void ReportBadStreamStatus(std::source_location loc, QDataStream::Status status)
std::optional< T > EnsureVersion(QDataStream &in, std::type_identity_t< T > min, std::type_identity_t< T > max, std::source_location loc=std::source_location::current())
QMessageLogger LogAt(std::source_location loc)
Definition logging.cpp:14
#define UTIL_SYS_API
Definition sysconfig.h:16