2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Start data export in lib_export.

This commit is contained in:
John Preston
2018-06-02 17:29:21 +03:00
parent c2fa149ffd
commit c587c011d2
52 changed files with 1994 additions and 320 deletions

View File

@@ -7,9 +7,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include <set>
#include "logs.h"
#include "core/basic_types.h"
#include "base/flags.h"
#include "base/algorithm.h"
#include "base/assertion.h"
// Define specializations for QByteArray for Qt 5.3.2, because
// QByteArray in Qt 5.3.2 doesn't declare "pointer" subtype.
@@ -179,33 +182,12 @@ inline void accumulate_max(T &a, const T &b) { if (a < b) a = b; }
template <typename T>
inline void accumulate_min(T &a, const T &b) { if (a > b) a = b; }
class Exception : public std::exception {
public:
Exception(const QString &msg, bool isFatal = true) : _fatal(isFatal), _msg(msg.toUtf8()) {
LOG(("Exception: %1").arg(msg));
}
bool fatal() const {
return _fatal;
}
virtual const char *what() const throw() {
return _msg.constData();
}
virtual ~Exception() throw() {
}
private:
bool _fatal;
QByteArray _msg;
};
using TimeId = int32;
void unixtimeInit();
void unixtimeSet(TimeId serverTime, bool force = false);
TimeId unixtime();
uint64 msgid();
int32 reqid();
int GetNextRequestId();
QDateTime ParseDateTime(TimeId serverTime);
@@ -224,7 +206,6 @@ void finish();
}
using TimeMs = int64;
bool checkms(); // returns true if time has changed
TimeMs getms(bool checked = false);