2016-09-01 16:34:30 +02:00
|
|
|
#ifndef DATA_UTILS_H
|
|
|
|
#define DATA_UTILS_H
|
|
|
|
|
2016-09-30 23:55:25 +02:00
|
|
|
#include "./global.h"
|
|
|
|
|
2017-02-22 18:16:41 +01:00
|
|
|
#include <QStringList>
|
2016-09-01 16:34:30 +02:00
|
|
|
|
2016-12-18 16:50:35 +01:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QUrl)
|
2016-09-01 16:34:30 +02:00
|
|
|
|
|
|
|
namespace ChronoUtilities {
|
|
|
|
class DateTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Data {
|
|
|
|
|
2016-09-30 23:55:25 +02:00
|
|
|
QString LIB_SYNCTHING_CONNECTOR_EXPORT agoString(ChronoUtilities::DateTime dateTime);
|
2016-12-18 16:50:35 +01:00
|
|
|
bool LIB_SYNCTHING_CONNECTOR_EXPORT isLocal(const QUrl &url);
|
2016-09-01 16:34:30 +02:00
|
|
|
|
2017-02-22 18:16:41 +01:00
|
|
|
template<class Objects>
|
|
|
|
QStringList LIB_SYNCTHING_CONNECTOR_EXPORT ids(const Objects &objects)
|
|
|
|
{
|
|
|
|
QStringList ids;
|
|
|
|
ids.reserve(objects.size());
|
|
|
|
for(const auto &object : objects) {
|
|
|
|
ids << object.id;
|
|
|
|
}
|
|
|
|
return ids;
|
|
|
|
}
|
2016-09-01 16:34:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // DATA_UTILS_H
|