[KLF Backend][KLF Tools][KLF Home]
KLatexFormula Project
klfutil.h
Go to the documentation of this file.
1/***************************************************************************
2 * file klfutil.h
3 * This file is part of the KLatexFormula Project.
4 * Copyright (C) 2011 by Philippe Faist
5 * philippe.faist at bluewin.ch
6 * *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program; if not, write to the *
19 * Free Software Foundation, Inc., *
20 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21 ***************************************************************************/
22/* $Id$ */
23
24
25#ifndef KLFUTIL_H
26#define KLFUTIL_H
27
28#include <QString>
29#include <QStringList>
30#include <QUrl>
31#include <QMap>
32#include <QVariant>
33//#include <QProgressDialog>
34#include <QLabel>
35//#include <QDomElement>
36#include <QTextFormat>
37
38#include <klfdefs.h>
39
40
42KLF_EXPORT bool klfEnsureDir(const QString& dir);
43
44
46
50template<class Value>
52{
53public:
54 bool operator()(const Value& a, const Value& b) { return a == b; }
55};
56
58
65{
66 Qt::CaseSensitivity cs;
67public:
68 klfStrCaseEqualFunc(Qt::CaseSensitivity caseSensitive) : cs(caseSensitive) { }
69 bool operator()(const QString& a, const QString& b) { return QString::compare(a, b, cs) == 0; }
70};
71
72
81template<class Key, class Value, class ValCompareFunc>
82inline bool klfMapIsIncludedIn(const QMap<Key,Value>& a, const QMap<Key,Value>& b,
83 ValCompareFunc cfunc = klfEqualFunc<Value>())
84{
86 for (iter = a.begin(); iter != a.end(); ++iter) {
87 if (!b.contains(iter.key()) || ! cfunc(b[iter.key()], iter.value())) {
88 return false;
89 }
90 }
91 // the map a is included in b
92 return true;
93}
94
96
100template<class Key>
101inline bool klfMapIsIncludedIn(const QMap<Key,QString>& a, const QMap<Key,QString>& b, Qt::CaseSensitivity cs)
102{
103 return klfMapIsIncludedIn(a, b, klfStrCaseEqualFunc(cs));
104}
105
106
108
134
142
151KLF_EXPORT uint klfUrlCompare(const QUrl& url1, const QUrl& url2, uint interestFlags = 0xffffffff,
152 const QStringList& interestQueryItems = QStringList());
153
154
166KLF_EXPORT bool klfMatch(const QVariant& testForHitCandidateValue, const QVariant& queryValue,
167 Qt::MatchFlags flags, const QString& queryStringCache = QString());
168
169
170
171template<class T>
172inline QVariantList klfListToVariantList(const QList<T>& list)
173{
174 QVariantList l;
175 int k;
176 for (k = 0; k < list.size(); ++k)
177 l << QVariant::fromValue<T>(list[k]);
178
179 return l;
180}
181
182
183template<class T>
184inline QList<T> klfVariantListToList(const QVariantList& vlist)
185{
186 QList<T> list;
187 int k;
188 for (k = 0; k < vlist.size(); ++k) {
189 list << vlist[k].value<T>();
190 }
191 return list;
192}
193
194template<class T> inline QVariantMap klfMapToVariantMap(const QMap<QString, T>& map)
195{
196 QVariantMap vmap;
197 for (typename QMap<QString,T>::const_iterator it = map.begin(); it != map.end(); ++it) {
198 vmap[it.key()] = QVariant::fromValue<T>(it.value());
199 }
200 return vmap;
201}
202
203
204template<class T>
205 inline QMap<QString, T> klfVariantMapToMap(const QVariantMap& vmap)
206{
208 for (QVariantMap::const_iterator it = vmap.begin(); it != vmap.end(); ++it) {
209 map[it.key()] = it.value().value<T>();
210 }
211 return map;
212}
213
214
215
235KLF_EXPORT QStringList klfSearchFind(const QString& wildcard_expression, int limit = -1);
236
250KLF_EXPORT QString klfSearchPath(const QString& prog, const QString& extra_path = "");
251
260KLF_EXPORT QString klfSearchPath(const QString& fname, const QStringList& path);
261
262
263
272
281 const QString& value);
282
291 const QString& value);
292
296
300
301
311
316 KlfEnvMergeFlagsMask = 0x00ff0000
318
319
328KLF_EXPORT void klfMergeEnvironment(QStringList * env, const QStringList& addvars,
329 const QStringList& pathvars = QStringList(),
330 uint mergeaction = KlfEnvPathPrepend);
331
343 const QStringList& pathvars = QStringList(),
344 uint mergeaction = KlfEnvPathPrepend);
345
352
358
365
366
377KLF_EXPORT QString klfSetEnvironmentPath(const QString& oldpaths, const QString& newpaths,
379
392
400 const QString& var = QLatin1String("PATH"),
402
409KLF_EXPORT void klfSetEnvironmentPath(QStringList * env, const QStringList& newitems,
410 const QString& var = QLatin1String("PATH"),
412
420 bool recursive = true);
421
427
428
437KLF_EXPORT QString klfPrefixedPath(const QString& path, const QString& reference = QString());
438
439
447
448
451template<class T, class MapOp>
452inline QList<T> klfListMap(const QList<T>& list, MapOp op)
453{
454 QList<T> l;
455 for(typename QList<T>::const_iterator it = list.begin(); it != list.end(); ++it) {
456 l << op(*it);
457 }
458 return l;
459}
460
462{
465 inline QString operator()(const QString& str)
466 {
467 return templ.arg(str);
468 }
469};
470
483inline QStringList klfMapStringList(const QStringList& list, const QString& mapstr)
484{
485 return klfListMap(list, __klf_StrArg_MapOp(mapstr));
486}
487
488template<class T> inline QList<T> klfMkList(const T& a) { return QList<T>()<<a; }
489template<class T> inline QList<T> klfMkList(const T& a, const T& b) { return QList<T>()<<a<<b; }
490template<class T> inline QList<T> klfMkList(const T& a, const T& b, const T& c) { return QList<T>()<<a<<b<<c; }
491template<class T>
492inline QList<T> klfMkList(const T& a, const T& b, const T& c, const T& d) { return QList<T>()<<a<<b<<c<<d; }
493
494
495template<class Value>
496struct KLFMapInitData { const char * key; Value value; };
497
498template<class Value>
500{
502 int k;
503 for (k = 0; x[k].key != NULL; ++k) {
504 map[QString::fromUtf8(x[k].key)] = x[k].value;
505 }
506 return map;
507}
508
509
510class KLFTargeter;
511
513public:
514 KLFTarget() : pTargetOf() { }
515 virtual ~KLFTarget();
516
517protected:
519 friend class KLFTargeter;
520};
521
523public:
524 KLFTargeter() : pTarget(NULL) { }
525 virtual ~KLFTargeter();
526
527 virtual void setTarget(KLFTarget *target);
528
529protected:
531 friend class KLFTarget;
532};
533
534
535
536
537
538
539
613template<class T> class KLFRefPtr
614{
615public:
617 typedef T* Pointer;
618
619 KLFRefPtr() : p(NULL), autodelete(true)
620 {
622 }
623
624 KLFRefPtr(const KLFRefPtr& copy) : p(copy.p), autodelete(copy.autodelete)
625 {
626 KLF_DEBUG_BLOCK(KLF_FUNC_NAME+" [copy]") ;
627 set();
628 }
629
631 {
633 unset();
634 }
635
636 T * ptr() { return p; }
637 const T * ptr() const { return p; }
638
639 bool autoDelete() const { return autodelete; }
640 void setAutoDelete(bool on) { autodelete = on; }
641
642 void setPointer(Pointer newptr)
643 {
644 klfDbg("new pointer: "<<newptr<<"; old pointer was "<<p) ;
645 if (newptr == p) // no change
646 return;
647 unset();
648 p = newptr;
649 set();
650 }
651 void setNull()
652 {
653 setPointer(NULL);
654 }
655
657 {
658 KLF_DEBUG_BLOCK(KLF_FUNC_NAME+"(KLFRefPtr<T*>)") ;
659 setPointer(other.p);
660 autodelete = other.autodelete;
661 return *this;
662 }
663 template<class OtherPtr> KLFRefPtr<T>& operator=(OtherPtr aptr)
664 {
665 KLF_DEBUG_BLOCK(KLF_FUNC_NAME+"(OtherPtr)") ;
666 setPointer((T*)(aptr));
667 return *this;
668 }
669
671 {
672 KLF_DEBUG_BLOCK(KLF_FUNC_NAME+"(Pointer)") ;
673 setPointer(newptr);
674 return *this;
675 }
676
677 /*
678 KLFRefPtr<T>& operator=(long int value)
679 {
680 if ((void*)value != (void*)NULL) {
681 klfWarning("ERROR: *** Cannot set non-NULL long int value "<<value) ;
682 }
683 setPointer(NULL);
684 return *this;
685 }
686 KLFRefPtr<T>& operator=(int value)
687 {
688 if ((void*)value != (void*)NULL) {
689 klfWarning("ERROR: *** Cannot set non-NULL long int value "<<value) ;
690 }
691 setPointer(NULL);
692 return *this;
693 }
694 */
695
696 inline operator T *()
697 { return p; }
698 inline operator const T *() const
699 { return p; }
700
701 inline T * operator()()
702 { return p; }
703 inline const T * operator()() const
704 { return p; }
705
706 /* inline T & operator*()
707 { return *p; }
708 inline const T & operator*() const
709 { return *p; } */
710
712 { return p; }
713 inline Pointer operator->() const
714 { return p; }
715
716 template<class OtherPtr>
717 inline OtherPtr dyn_cast() { return dynamic_cast<OtherPtr>(p); }
718
719 template<class OtherPtr>
720 inline const OtherPtr dyn_cast() const { return dynamic_cast<const OtherPtr>(p); }
721
722 inline bool operator==(void * otherptr) const
723 { return (void *)p == otherptr; }
724
725 inline bool operator==(const KLFRefPtr<T>& otherptr) const
726 { return p == otherptr.p; }
727
728 inline bool operator!=(void * otherptr) const
729 { return ! (this->operator==(otherptr)); }
730
731 inline bool operator!=(const KLFRefPtr<T>& otherptr) const
732 { return ! (this->operator==(otherptr)); }
733
734
735private:
736 void operator+=(int ) { }
737 void operator-=(int ) { }
738
740 Pointer p;
743 bool autodelete;
744
745 void unset() {
747 if (p != NULL) {
748 int n = p->deref();
749 klfDbg(p<<": deref()! n="<<n<<"; autodelete="<<autodelete) ;
750 if (autodelete && n <= 0) {
751 klfDbg("Deleting at refcount="<<n<<".") ;
752 delete p;
753 }
754 p = NULL;
755 }
756 }
757 void set() {
759 if (p != NULL) {
760 int n = p->ref();
761 Q_UNUSED(n) ;
762 klfDbg(p<<": ref()! n="<<n) ;
763 }
764 }
765
766};
767
768
769
770
771
772
773
774
775
776
779{
780 KLFPointerGuard() : ptr(NULL), refcount(0) {}
781
782 void * ptr;
783
784 int ref() { return ++refcount; }
785 int deref() { return --refcount; }
786private:
787 int refcount;
788};
789
835template<class T>
837{
838public:
839 typedef T* Pointer;
840
842 {
843 ptrguard = NULL;
844 }
846 {
847 }
848
850 {
851 ptrguard = copy.ptrguard;
852 }
854 {
855 *this = obj;
856 }
857
858 inline Pointer ptr()
859 {
860 if (ptrguard == NULL)
861 return NULL;
862 return (Pointer) ptrguard->ptr;
863 }
864
865 inline operator T*()
866 { return ptr(); }
867 inline operator const T*()
868 { return ptr(); }
869
870 inline T* operator()()
871 { return ptr(); }
872 inline const T* operator()() const
873 { return ptr(); }
874
875 inline T& operator*()
876 { return *ptr(); }
877 inline const T& operator*() const
878 { return *ptr(); }
879
880 inline T* operator->()
881 { return ptr(); }
882 inline const T* operator->() const
883 { return ptr(); }
884
885
887 {
888 if (p == NULL) {
889 invalidate();
890 return NULL;
891 }
892 if (ptrguard != NULL) {
893 klfWarning("Leaving tracked pointer "<<ptrguard->ptr<<" for another pointer!") ;
894 } else {
895 ptrguard = new KLFPointerGuard;
896 }
897 ptrguard->ptr = (void*)p;
898 return p;
899 };
900
902 {
903 KLF_ASSERT_CONDITION(ptrguard == NULL, "Leaving tracked pointer "<<ptrguard->ptr<<" for a copy pointer!",
904 ;) ;
905 ptrguard = copy.ptrguard;
906 return *this;
907 }
908
910 {
911 if (ptrguard != NULL)
912 ptrguard->ptr = NULL;
913 }
914
915 void reset()
916 {
917 ptrguard.setNull();
918 }
919
920private:
922};
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941// -----
942
943
944
945template<class T>
947 static QVariant convert(const T& value)
948 {
949 return QVariant::fromValue<T>(value);
950 }
951 static T recover(const QVariant& variant)
952 {
953 return variant.value<T>();
954 }
955};
956template<class T>
958 static QVariant convert(const QList<T>& list)
959 {
960 return QVariant::fromValue<QVariantList>(klfListToVariantList(list));
961 }
962 static QList<T> recover(const QVariant& variant)
963 {
964 return klfVariantListToList<T>(variant.toList());
965 }
966};
967template<>
969 static QVariant convert(const QTextCharFormat& value)
970 {
971 return QVariant::fromValue<QTextFormat>(value);
972 }
973 static QTextCharFormat recover(const QVariant& variant)
974 {
975 return variant.value<QTextFormat>().toCharFormat();
976 }
977};
978
979
980
981
985#define KLFTOOLS_INIT \
986 Q_INIT_RESOURCE(klftoolsres)
987
988
989
990#endif
Stores a pointer to an object with refcount.
Definition: klfutil.h:614
Pointer operator->() const
Definition: klfutil.h:713
bool autoDelete() const
Definition: klfutil.h:639
T * Pointer
Definition: klfutil.h:617
OtherPtr dyn_cast()
Definition: klfutil.h:717
KLFRefPtr< T > & operator=(Pointer newptr)
Definition: klfutil.h:670
~KLFRefPtr()
Definition: klfutil.h:630
bool operator!=(void *otherptr) const
Definition: klfutil.h:728
void setAutoDelete(bool on)
Definition: klfutil.h:640
void setPointer(Pointer newptr)
Definition: klfutil.h:642
T * operator()()
Definition: klfutil.h:701
bool operator==(void *otherptr) const
Definition: klfutil.h:722
T * ptr()
Definition: klfutil.h:636
const OtherPtr dyn_cast() const
Definition: klfutil.h:720
KLFRefPtr(const KLFRefPtr &copy)
Definition: klfutil.h:624
Pointer operator->()
Definition: klfutil.h:711
KLFRefPtr()
Definition: klfutil.h:619
bool operator==(const KLFRefPtr< T > &otherptr) const
Definition: klfutil.h:725
void setNull()
Definition: klfutil.h:651
const T * ptr() const
Definition: klfutil.h:637
const T * operator()() const
Definition: klfutil.h:703
KLFRefPtr< T > & operator=(OtherPtr aptr)
Definition: klfutil.h:663
bool operator!=(const KLFRefPtr< T > &otherptr) const
Definition: klfutil.h:731
KLFRefPtr< T > & operator=(const KLFRefPtr< T > &other)
Definition: klfutil.h:656
Store a guarded pointer, synchronizing other copies of this pointer.
Definition: klfutil.h:837
void invalidate()
Definition: klfutil.h:909
T * operator()()
Definition: klfutil.h:870
const KLFSyncGuardPtr & operator=(const KLFSyncGuardPtr &copy)
Definition: klfutil.h:901
KLFSyncGuardPtr(T *obj)
Definition: klfutil.h:853
void reset()
Definition: klfutil.h:915
const T & operator*() const
Definition: klfutil.h:877
T & operator*()
Definition: klfutil.h:875
Pointer operator=(Pointer p)
Definition: klfutil.h:886
const T * operator->() const
Definition: klfutil.h:882
Pointer ptr()
Definition: klfutil.h:858
KLFSyncGuardPtr(const KLFSyncGuardPtr &copy)
Definition: klfutil.h:849
const T * operator()() const
Definition: klfutil.h:872
T * operator->()
Definition: klfutil.h:880
QList< KLFTargeter * > pTargetOf
Definition: klfutil.h:518
KLFTarget()
Definition: klfutil.h:514
KLFTarget * pTarget
Definition: klfutil.h:530
KLFTargeter()
Definition: klfutil.h:524
Implements default equality tester with operator==.
Definition: klfutil.h:52
bool operator()(const Value &a, const Value &b)
Definition: klfutil.h:54
implements an equality tester between strings
Definition: klfutil.h:65
bool operator()(const QString &a, const QString &b)
Definition: klfutil.h:69
klfStrCaseEqualFunc(Qt::CaseSensitivity caseSensitive)
Definition: klfutil.h:68
const char * key
Definition: klfdatautil.cpp:96
#define klfWarning(streamableItems)
#define KLF_DEBUG_BLOCK(msg)
Utility to debug the execution of a block.
#define KLF_ASSERT_CONDITION(expr, msg, failaction)
Asserting Conditions (NON-FATAL)
#define KLF_FUNC_NAME
#define klfDbg(streamableItems)
print debug stream items
Base declarations for klatexformula and some utilities.
#define KLF_EXPORT
Definition: klfdefs.h:41
KLF_EXPORT QMap< QString, QString > klfEnvironmentListToMap(const QStringList &env)
convert environment list into a map of variable names to values
Definition: klfutil.cpp:426
KLF_EXPORT bool klfMatch(const QVariant &testForHitCandidateValue, const QVariant &queryValue, Qt::MatchFlags flags, const QString &queryStringCache=QString())
Generalized value matching.
Definition: klfutil.cpp:145
KLF_EXPORT void klfSetEnvironmentVariable(QStringList *env, const QString &var, const QString &value)
set the value of a variable in environment variables list, replacing existing definition if any.
Definition: klfutil.cpp:378
KLF_EXPORT void klfMergeEnvironment(QStringList *env, const QStringList &addvars, const QStringList &pathvars=QStringList(), uint mergeaction=KlfEnvPathPrepend)
merge two environment definitions
Definition: klfutil.cpp:443
KLF_EXPORT QStringList klfSplitEnvironmentPath(const QString &value)
split the value of a PATH-like environment variable into paths (common for $PATH)
Definition: klfutil.cpp:480
KLF_EXPORT QString klfGetEnvironmentVariable(const QStringList &env, const QString &var)
returns the value of an environment variable, defined in env.
Definition: klfutil.cpp:364
KLF_EXPORT QString klfExpandEnvironmentVariables(const QString &expression, const QStringList &env=QStringList(), bool recursive=true)
Expands references to environment variables to their values.
Definition: klfutil.cpp:614
QMap< QString, Value > klfMakeMap(KLFMapInitData< Value > x[])
Definition: klfutil.h:499
KLF_EXPORT QString klfSearchPath(const QString &prog, const QString &extra_path="")
Smart executable searching in a given path list with wildcards.
Definition: klfutil.cpp:261
KLF_EXPORT QString klfJoinEnvironmentPath(const QStringList &paths)
join several paths together to form a PATH-like environment variable value (common for $PATH)
Definition: klfutil.cpp:497
KLF_EXPORT QStringList klfCurrentEnvironment()
Returns the current system's environment.
Definition: klfutil.cpp:621
QList< T > klfListMap(const QList< T > &list, MapOp op)
Definition: klfutil.h:452
QVariantList klfListToVariantList(const QList< T > &list)
Definition: klfutil.h:172
KLF_EXPORT QStringList klfGetEnvironmentPath(const QStringList &env, const QString &var=QLatin1String("PATH"))
get the path items of an environment variable (commonly $PATH)
Definition: klfutil.cpp:473
QStringList klfMapStringList(const QStringList &list, const QString &mapstr)
Definition: klfutil.h:483
QList< T > klfVariantListToList(const QVariantList &vlist)
Definition: klfutil.h:184
QMap< QString, T > klfVariantMapToMap(const QVariantMap &vmap)
Definition: klfutil.h:205
QVariantMap klfMapToVariantMap(const QMap< QString, T > &map)
Definition: klfutil.h:194
KLF_EXPORT QString klfUrlLocalFilePath(const QUrl &url)
Definition: klfutil.cpp:634
KLF_EXPORT QStringList klfMapToEnvironmentList(const QMap< QString, QString > &map)
convert a map of variable names to values to an environment list
Definition: klfutil.cpp:403
KLF_EXPORT QString klfSetEnvironmentPath(const QString &oldpaths, const QString &newpaths, uint action=KlfEnvPathAppend|KlfEnvPathNoDuplicates)
set/add path items to a PATH-like environment variable (commonly $PATH)
Definition: klfutil.cpp:548
bool klfMapIsIncludedIn(const QMap< Key, Value > &a, const QMap< Key, Value > &b, ValCompareFunc cfunc=klfEqualFunc< Value >())
Compares two QMap's for inclusion.
Definition: klfutil.h:82
KLF_EXPORT QString klfPrefixedPath(const QString &path, const QString &reference=QString())
Returns absolute path to path as seen from reference.
Definition: klfutil.cpp:316
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.
Definition: klfutil.cpp:78
KLF_EXPORT QStringList klfSearchFind(const QString &wildcard_expression, int limit=-1)
Find files matching a path with wildcards.
Definition: klfutil.cpp:243
KlfEnvAction
Used in klfMergeEnvironment() and klfSetEnvironmentPath().
Definition: klfutil.h:303
@ KlfEnvPathNoAction
Don't take any action, just apply flags.
Definition: klfutil.h:307
@ KlfEnvPathNoDuplicates
Remove duplicates from the variable.
Definition: klfutil.h:309
@ KlfEnvPathPrepend
Prepend given value to list of path items.
Definition: klfutil.h:304
@ KlfEnvPathFlagsMask
Mask out the path flags.
Definition: klfutil.h:310
@ KlfEnvMergeExpandNotRecursive
If we're expanding new environment variables, don't expand them recursively.
Definition: klfutil.h:315
@ KlfEnvMergeExpandVars
Merge environments by expanding new values according to current environment.
Definition: klfutil.h:313
@ KlfEnvPathAppend
Append given path items to current list.
Definition: klfutil.h:306
@ KlfEnvPathActionMask
Mask out the requested action.
Definition: klfutil.h:308
@ KlfEnvMergeFlagsMask
Mask out the merge actions flags.
Definition: klfutil.h:316
@ KlfEnvPathReplace
Replace current path items by given ones.
Definition: klfutil.h:305
KLF_EXPORT bool klfEnsureDir(const QString &dir)
Ensure existence of a directory.
Definition: klfutil.cpp:41
KlfUrlCompareFlag
Some relevant values for klfUrlCompare()
Definition: klfutil.h:120
@ klfUrlCompareFlagIgnoreQueryItemValueCase
This is NOT a specific test. It modifies the behavior of klfUrlCompare() by instructing it to compare...
Definition: klfutil.h:139
@ KlfUrlCompareEqual
Urls are equal. The order of query items may be different, but the same are given with the same value...
Definition: klfutil.h:123
@ KlfUrlCompareBaseEqual
Urls have same base URL. Query items are ignored.
Definition: klfutil.h:133
@ KlfUrlCompareMoreSpecific
Urls have same base URL. All query items in url2 are present in url1 with the same values,...
Definition: klfutil.h:131
@ KlfUrlCompareLessSpecific
Urls have same base URL. All query items in url1 are present in url2 with the same values,...
Definition: klfutil.h:127
QList< T > klfMkList(const T &a)
Definition: klfutil.h:488
iterator begin()
iterator end()
int size() const
T value(int i) const
const Key & key() const
const T & value() const
iterator begin()
bool contains(const Key &key) const
iterator end()
const T value(const Key &key, const T &defaultValue) const
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const
int compare(const QString &other, Qt::CaseSensitivity cs) const
QString fromUtf8(const char *str, int size)
typedef MatchFlags
QList< QVariant > toList() const
T value() const
__klf_StrArg_MapOp(const QString &t)
Definition: klfutil.h:463
QString operator()(const QString &str)
Definition: klfutil.h:465
const char * key
Definition: klfutil.h:496
Value value
Definition: klfutil.h:496
void * ptr
Definition: klfutil.h:782
static QList< T > recover(const QVariant &variant)
Definition: klfutil.h:962
static QVariant convert(const QList< T > &list)
Definition: klfutil.h:958
static QVariant convert(const QTextCharFormat &value)
Definition: klfutil.h:969
static QTextCharFormat recover(const QVariant &variant)
Definition: klfutil.h:973
static T recover(const QVariant &variant)
Definition: klfutil.h:951
static QVariant convert(const T &value)
Definition: klfutil.h:947

Generated by doxygen 1.9.4