29 #include <QStringList> 33 #include <QProgressDialog> 35 #include <QDomElement> 53 bool operator()(
const Value& a,
const Value& b) {
return a == b; }
65 Qt::CaseSensitivity cs;
80 template<
class Key,
class Value,
class ValCompareFunc>
85 for (iter = a.
begin(); iter != a.
end(); ++iter) {
166 Qt::MatchFlags flags,
const QString& queryStringCache =
QString());
212 const char *listOrMapTypeName = NULL);
221 for (k = 0; k < list.
size(); ++k)
222 l << QVariant::fromValue<T>(list[k]);
233 for (k = 0; k < vlist.size(); ++k) {
234 list << vlist[k].
value<T>();
273 #define KLFTOOLS_INIT \ 274 Q_INIT_RESOURCE(klftoolsres)
KLF_EXPORT uint klfUrlCompare(const QUrl &url1, const QUrl &url2, uint interestFlags=0xffffffff, const QStringList &interestQueryItems=QStringList())
Compares two URLs and returns some flags as to how they differ.
KLF_EXPORT bool klfMatch(const QVariant &testForHitCandidateValue, const QVariant &queryValue, Qt::MatchFlags flags, const QString &queryStringCache=QString())
Generalized value matching.
KLF_EXPORT QString klfPrefixedPath(const QString &path, const QString &reference=QString())
Returns absolute path to path as seen from reference.
KLF_EXPORT QByteArray klfEscapedToData(const QByteArray &escaped)
bool operator()(const QString &a, const QString &b)
bool klfMapIsIncludedIn(const QMap< Key, Value > &a, const QMap< Key, Value > &b, ValCompareFunc cfunc=klfEqualFunc< Value >())
Compares two QMap's for inclusion.
KLF_EXPORT QDomElement klfSaveVariantMapToXML(const QVariantMap &vmap, QDomElement xmlNode)
Lossless save of full map to XML with type information.
KLF_EXPORT QByteArray klfDataToEscaped(const QByteArray &data)
KlfUrlCompareFlag
Some relevant values for klfUrlCompare()
KLF_EXPORT QVariantList klfLoadVariantListFromXML(const QDomElement &xmlNode)
Load a list saved with klfSaveVariantListToXML()
Urls are equal. The order of query items may be different, but the same are given with the same value...
klfStrCaseEqualFunc(Qt::CaseSensitivity caseSensitive)
KLF_EXPORT QString klfUrlLocalFilePath(const QUrl &url)
KLF_EXPORT QVariant klfLoadVariantFromText(const QByteArray &string, const char *dataTypeName, const char *listOrMapTypeName=NULL)
compare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs)
KLF_EXPORT bool klfEnsureDir(const QString &dir)
Ensure existence of a directory.
KLF_EXPORT QDomElement klfSaveVariantListToXML(const QVariantList &vlist, QDomElement xmlNode)
Lossless save of full list to XML with type information.
This is NOT a specific test. It modifies the behavior of klfUrlCompare() by instructing it to compare...
Urls have same base URL. All query items in url1 are present in url2 with the same values...
bool operator()(const Value &a, const Value &b)
KLF_EXPORT QByteArray klfSaveVariantToText(const QVariant &value, bool saveListAndMapsAsXML=false)
QVariantList klfListToVariantList(const QList< T > &list)
Urls have same base URL. All query items in url2 are present in url1 with the same values...
QList< T > klfVariantListToList(const QVariantList &vlist)
KLF_EXPORT QVariantMap klfLoadVariantMapFromXML(const QDomElement &xmlNode)
Load a map saved with klfSaveVariantMapToXML()
Implements default equality tester with operator==.
implements an equality tester between strings
Urls have same base URL. Query items are ignored.