KDb

KDbUtils.cpp
1 /* This file is part of the KDE project
2  Copyright (C) 2003-2019 JarosÅ‚aw Staniek <[email protected]>
3 
4  Portions of kstandarddirs.cpp:
5  Copyright (C) 1999 Sirtaj Singh Kang <[email protected]>
6  Copyright (C) 1999,2007 Stephan Kulow <[email protected]>
7  Copyright (C) 1999 Waldo Bastian <[email protected]>
8  Copyright (C) 2009 David Faure <[email protected]>
9 
10  Portions of kshell.cpp:
11  Copyright (c) 2003,2007 Oswald Buddenhagen <[email protected]>
12 
13  This program is free software; you can redistribute it and/or
14  modify it under the terms of the GNU Library General Public
15  License as published by the Free Software Foundation; either
16  version 2 of the License, or (at your option) any later version.
17 
18  This program is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  Library General Public License for more details.
22 
23  You should have received a copy of the GNU Library General Public License
24  along with this program; see the file COPYING. If not, write to
25  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
26  * Boston, MA 02110-1301, USA.
27 */
28 
29 #include "KDbUtils.h"
30 #include "KDb.h"
31 #include "KDbConnection.h"
32 #include "KDbDriverManager.h"
33 #include "KDbUtils_p.h"
34 #include "config-kdb.h"
35 #include "kdb_debug.h"
36 
37 #include <QRegularExpression>
38 #include <QDataStream>
39 #include <QDir>
40 #include <QFile>
41 #include <QFileInfo>
42 
43 static const int SQUEEZED_TEXT_LIMIT = 1024;
44 static const int SQUEEZED_TEXT_SUFFIX = 24;
45 
46 #ifdef Q_OS_WIN
47 #include <windows.h>
48 #ifdef _WIN32_WCE
49 #include <basetyps.h>
50 #endif
51 #ifdef Q_OS_WIN64
52 //! @todo did not find a reliable way to fix with kdewin mingw header
53 #define interface struct
54 #endif
55 #endif
56 
57 using namespace KDbUtils;
58 
59 class Q_DECL_HIDDEN Property::Private
60 {
61 public:
62  Private() : isNull(true) {}
63  Private(const QVariant &aValue, const QString &aCaption)
64  : value(aValue), caption(aCaption), isNull(false)
65  {
66  }
67  bool operator==(const Private &other) const {
68  return std::tie(value, caption, isNull) == std::tie(other.value, other.caption, other.isNull);
69  }
70  QVariant value; //!< Property value
71  QString caption; //!< User visible property caption
72  bool isNull;
73 };
74 
76  : d(new Private)
77 {
78 }
79 
80 Property::Property(const QVariant &value, const QString &caption)
81  : d(new Private(value, caption))
82 {
83 }
84 
85 Property::Property(const Property &other)
86 : d(new Private(*other.d))
87 {
88 }
89 
90 Property::~Property()
91 {
92  delete d;
93 }
94 
95 bool Property::operator==(const Property &other) const
96 {
97  return *d == *other.d;
98 }
99 
100 bool Property::isNull() const
101 {
102  return d->isNull;
103 }
104 
105 QVariant Property::value() const
106 {
107  return d->value;
108 }
109 
110 void Property::setValue(const QVariant &value)
111 {
112  d->value = value;
113  d->isNull = false;
114 }
115 
116 QString Property::caption() const
117 {
118  return d->caption;
119 }
120 
121 void Property::setCaption(const QString &caption)
122 {
123  d->caption = caption;
124  d->isNull = false;
125 }
126 
127 //---------
128 
129 bool KDbUtils::hasParent(QObject *par, QObject *o)
130 {
131  if (!o || !par) {
132  return false;
133  }
134  while (o && o != par) {
135  o = o->parent();
136  }
137  return o == par;
138 }
139 
140 QString KDbUtils::toISODateStringWithMs(const QTime& time)
141 {
142 #ifdef HAVE_QT_ISODATEWITHMS
143  return time.toString(Qt::ISODateWithMs);
144 #else
145  QString result;
146  if (time.isValid()) {
147  result = QString::asprintf("%02d:%02d:%02d.%03d", time.hour(), time.minute(), time.second(),
148  time.msec());
149  }
150  return result;
151 #endif
152 }
153 
154 QString KDbUtils::toISODateStringWithMs(const QDateTime& dateTime)
155 {
156 #ifdef HAVE_QT_ISODATEWITHMS
157  return dateTime.toString(Qt::ISODateWithMs);
158 #else
159  QString result;
160  if (!dateTime.isValid()) {
161  return result;
162  }
163  result = dateTime.toString(Qt::ISODate);
164  if (result.isEmpty()) { // failure
165  return result;
166  }
167  QString timeString = KDbUtils::toISODateStringWithMs(dateTime.time());
168  if (timeString.isEmpty()) { // failure
169  return QString();
170  }
171  const int offset = strlen("0000-00-00T");
172  const int timeLen = strlen("00:00:00");
173  result.replace(offset, timeLen, timeString); // replace time with time+ms
174  return result;
175 #endif
176 }
177 
178 QTime KDbUtils::timeFromISODateStringWithMs(const QString &string)
179 {
180 #ifdef HAVE_QT_ISODATEWITHMS
181  return QTime::fromString(string, Qt::ISODateWithMs);
182 #else
183  return QTime::fromString(string, Qt::ISODate); // supports HH:mm:ss.zzzzz already
184 #endif
185 }
186 
187 QDateTime KDbUtils::dateTimeFromISODateStringWithMs(const QString &string)
188 {
189 #ifdef HAVE_QT_ISODATEWITHMS
191 #else
192  return QDateTime::fromString(string, Qt::ISODate); // supports HH:mm:ss.zzzzz already
193 #endif
194 }
195 
196 QDateTime KDbUtils::stringToHackedQTime(const QString &s)
197 {
198  if (s.isEmpty()) {
199  return QDateTime();
200  }
201  return QDateTime(QDate(0, 1, 2), KDbUtils::timeFromISODateStringWithMs(s));
202 }
203 
204 void KDbUtils::serializeMap(const QMap<QString, QString>& map, QByteArray *array)
205 {
206  if (!array) {
207  return;
208  }
210  ds.setVersion(QDataStream::Qt_3_1);
211  ds << map;
212 }
213 
214 void KDbUtils::serializeMap(const QMap<QString, QString>& map, QString *string)
215 {
216  if (!string) {
217  return;
218  }
219  QByteArray array;
220  QDataStream ds(&array, QIODevice::WriteOnly);
221  ds.setVersion(QDataStream::Qt_3_1);
222  ds << map;
223  kdbDebug() << array[3] << array[4] << array[5];
224  const int size = array.size();
225  string->clear();
226  string->reserve(size);
227  for (int i = 0; i < size; i++) {
228  (*string)[i] = QChar(ushort(array[i]) + 1);
229  }
230 }
231 
232 QMap<QString, QString> KDbUtils::deserializeMap(const QByteArray& array)
233 {
235  QByteArray ba(array);
237  ds.setVersion(QDataStream::Qt_3_1);
238  ds >> map;
239  return map;
240 }
241 
242 QMap<QString, QString> KDbUtils::deserializeMap(const QString& string)
243 {
244  QByteArray array;
245  const int size = string.length();
246  array.resize(size);
247  for (int i = 0; i < size; i++) {
248  array[i] = char(string[i].unicode() - 1);
249  }
251  QDataStream ds(&array, QIODevice::ReadOnly);
252  ds.setVersion(QDataStream::Qt_3_1);
253  ds >> map;
254  return map;
255 }
256 
257 QString KDbUtils::stringToFileName(const QString& string)
258 {
259  QString _string(string);
260  _string.replace(QRegularExpression(QLatin1String("[\\\\/:\\*?\"<>|]")), QLatin1String(" "));
261  if (_string.startsWith(QLatin1Char('.'))) {
262  _string.prepend(QLatin1Char('_'));
263  }
264  return _string.simplified();
265 }
266 
267 void KDbUtils::simpleCrypt(QString *string)
268 {
269  if (!string) {
270  return;
271  }
272  for (int i = 0; i < string->length(); i++) {
273  ushort& unicode = (*string)[i].unicode();
274  unicode += (47 + i);
275  }
276 }
277 
278 bool KDbUtils::simpleDecrypt(QString *string)
279 {
280  if (!string) {
281  return false;
282  }
283  QString result(*string);
284  for (int i = 0; i < result.length(); i++) {
285  ushort& unicode = result[i].unicode();
286  if (unicode <= (47 + i)) {
287  return false;
288  }
289  unicode -= (47 + i);
290  }
291  *string = result;
292  return true;
293 }
294 
295 QString KDbUtils::pointerToStringInternal(void* pointer, int size)
296 {
297  QString string;
298  unsigned char* cstr_pointer = (unsigned char*) & pointer;
299  for (int i = 0; i < size; i++) {
300  QString s;
301  s.sprintf("%2.2x", cstr_pointer[i]);
302  string.append(s);
303  }
304  return string;
305 }
306 
307 void* KDbUtils::stringToPointerInternal(const QString& string, int size)
308 {
309  if ((string.length() / 2) < size)
310  return nullptr;
311  QByteArray array;
312  array.resize(size);
313  bool ok;
314  for (int i = 0; i < size; i++) {
315  array[i] = (unsigned char)(string.midRef(i * 2, 2).toUInt(&ok, 16));
316  if (!ok)
317  return nullptr;
318  }
319  return static_cast<void*>(array.data());
320 }
321 
322 //---------
323 
324 //! @internal
325 class Q_DECL_HIDDEN StaticSetOfStrings::Private
326 {
327 public:
328  Private() : array(nullptr), set(nullptr) {}
329  ~Private() {
330  delete set;
331  }
332  const char* const * array;
333  QSet<QByteArray> *set;
334 };
335 
336 StaticSetOfStrings::StaticSetOfStrings()
337  : d(new Private)
338 {
339 }
340 
341 StaticSetOfStrings::StaticSetOfStrings(const char* const array[])
342  : d(new Private)
343 {
344  setStrings(array);
345 }
346 
347 StaticSetOfStrings::~StaticSetOfStrings()
348 {
349  delete d;
350 }
351 
352 void StaticSetOfStrings::setStrings(const char* const array[])
353 {
354  delete d->set;
355  d->set = nullptr;
356  d->array = array;
357 }
358 
359 bool StaticSetOfStrings::isEmpty() const
360 {
361  return d->array == nullptr;
362 }
363 
364 bool StaticSetOfStrings::contains(const QByteArray& string) const
365 {
366  if (!d->set) {
367  d->set = new QSet<QByteArray>();
368  for (const char * const * p = d->array;*p;p++)
369  d->set->insert(QByteArray::fromRawData(*p, qstrlen(*p)));
370  }
371  return d->set->contains(string);
372 }
373 
374 //---------
375 
376 #ifdef Q_OS_MACOS
377 //! Internal, from kdelibs' kstandarddirs.cpp
378 static QString getBundle(const QString& path, bool ignore)
379 {
380  QFileInfo info;
381  QString bundle = path;
382  bundle += QLatin1String(".app/Contents/MacOS/") + bundle.section(QLatin1Char('/'), -1);
383  info.setFile( bundle );
384  FILE *file;
385  if (file = fopen(info.absoluteFilePath().toUtf8().constData(), "r")) {
386  fclose(file);
387  struct stat _stat;
388  if ((stat(info.absoluteFilePath().toUtf8().constData(), &_stat)) < 0) {
389  return QString();
390  }
391  if ( ignore || (_stat.st_mode & S_IXUSR) ) {
392  if ( ((_stat.st_mode & S_IFMT) == S_IFREG) || ((_stat.st_mode & S_IFMT) == S_IFLNK) ) {
393  return bundle;
394  }
395  }
396  }
397  return QString();
398 }
399 #endif
400 
401 //! Internal, from kdelibs' kstandarddirs.cpp
402 static QString checkExecutable(const QString& path, bool ignoreExecBit)
403 {
404 #ifdef Q_OS_MACOS
405  QString bundle = getBundle(path, ignoreExecBit);
406  if (!bundle.isEmpty()) {
407  return bundle;
408  }
409 #endif
410  QFileInfo info(path);
411  QFileInfo orig = info;
412 #ifdef Q_OS_MACOS
413  FILE *file;
414  if (file = fopen(orig.absoluteFilePath().toUtf8().constData(), "r")) {
415  fclose(file);
416  struct stat _stat;
417  if ((stat(orig.absoluteFilePath().toUtf8().constData(), &_stat)) < 0) {
418  return QString();
419  }
420  if ( ignoreExecBit || (_stat.st_mode & S_IXUSR) ) {
421  if ( ((_stat.st_mode & S_IFMT) == S_IFREG) || ((_stat.st_mode & S_IFMT) == S_IFLNK) ) {
422  orig.makeAbsolute();
423  return orig.filePath();
424  }
425  }
426  }
427  return QString();
428 #else
429  if (info.exists() && info.isSymLink())
430  info = QFileInfo(info.canonicalFilePath());
431  if (info.exists() && ( ignoreExecBit || info.isExecutable() ) && info.isFile()) {
432  // return absolute path, but without symlinks resolved in order to prevent
433  // problems with executables that work differently depending on name they are
434  // run as (for example gunzip)
435  orig.makeAbsolute();
436  return orig.filePath();
437  }
438  return QString();
439 #endif
440 }
441 
442 //! Internal, from kdelibs' kstandarddirs.cpp
443 #if defined _WIN32 || defined _WIN64
444 # define KPATH_SEPARATOR ';'
445 # define ESCAPE '^'
446 #else
447 # define KPATH_SEPARATOR ':'
448 # define ESCAPE '\\'
449 #endif
450 
451 //! Internal, from kdelibs' kstandarddirs.cpp
452 static inline QString equalizePath(QString &str)
453 {
454 #ifdef Q_OS_WIN
455  // filter pathes through QFileInfo to have always
456  // the same case for drive letters
457  QFileInfo f(str);
458  if (f.isAbsolute())
459  return f.absoluteFilePath();
460  else
461 #endif
462  return str;
463 }
464 
465 //! Internal, from kdelibs' kstandarddirs.cpp
466 static void tokenize(QStringList& tokens, const QString& str,
467  const QString& delim)
468 {
469  const int len = str.length();
470  QString token;
471 
472  for(int index = 0; index < len; index++) {
473  if (delim.contains(str[index])) {
474  tokens.append(equalizePath(token));
475  token.clear();
476  } else {
477  token += str[index];
478  }
479  }
480  if (!token.isEmpty()) {
481  tokens.append(equalizePath(token));
482  }
483 }
484 
485 //! Internal, based on kdelibs' kshell.cpp
486 static QString tildeExpand(const QString &fname)
487 {
488  if (!fname.isEmpty() && fname[0] == QLatin1Char('~')) {
489  int pos = fname.indexOf( QLatin1Char('/') );
490  QString ret = QDir::homePath(); // simplified
491  if (pos > 0) {
492  ret += fname.midRef(pos);
493  }
494  return ret;
495  } else if (fname.length() > 1 && fname[0] == QLatin1Char(ESCAPE) && fname[1] == QLatin1Char('~')) {
496  return fname.mid(1);
497  }
498  return fname;
499 }
500 
501 //! Internal, from kdelibs' kstandarddirs.cpp
502 static QStringList systemPaths(const QString& pstr)
503 {
504  QStringList tokens;
505  QString p = pstr;
506 
507  if (p.isEmpty()) {
508  p = QString::fromLocal8Bit( qgetenv( "PATH" ) );
509  }
510 
511  QString delimiters(QLatin1Char(KPATH_SEPARATOR));
512  delimiters += QLatin1Char('\b');
513  tokenize(tokens, p, delimiters);
514 
515  QStringList exePaths;
516 
517  // split path using : or \b as delimiters
518  for(int i = 0; i < tokens.count(); i++) {
519  exePaths << tildeExpand(tokens[ i ]);
520  }
521  return exePaths;
522 }
523 
524 //! Internal, from kdelibs' kstandarddirs.cpp
525 #ifdef Q_OS_WIN
526 static QStringList executableExtensions()
527 {
528  QStringList ret = QString::fromLocal8Bit(qgetenv("PATHEXT")).split(QLatin1Char(';'));
529  if (!ret.contains(QLatin1String(".exe"), Qt::CaseInsensitive)) {
530  // If %PATHEXT% does not contain .exe, it is either empty, malformed, or distorted in ways that we cannot support, anyway.
531  ret.clear();
532  ret << QLatin1String(".exe")
533  << QLatin1String(".com")
534  << QLatin1String(".bat")
535  << QLatin1String(".cmd");
536  }
537  return ret;
538 }
539 #endif
540 
541 //! Based on kdelibs' kstandarddirs.cpp
542 QString KDbUtils::findExe(const QString& appname,
543  const QString& path,
544  FindExeOptions options)
545 {
546 #ifdef Q_OS_WIN
547  QStringList executable_extensions = executableExtensions();
548  if (!executable_extensions.contains(
551  {
552  QString found_exe;
553  foreach (const QString& extension, executable_extensions) {
554  found_exe = findExe(appname + extension, path, options);
555  if (!found_exe.isEmpty()) {
556  return found_exe;
557  }
558  }
559  return QString();
560  }
561 #endif
562 
563  // absolute or relative path?
564  if (appname.contains(QDir::separator())) {
565  return checkExecutable(appname, options & FindExeOption::IgnoreExecBit);
566  }
567 
568  QString p;
569  QString result;
570 
571  const QStringList exePaths = systemPaths(path);
572  for (QStringList::ConstIterator it = exePaths.begin(); it != exePaths.end(); ++it)
573  {
574  p = (*it) + QLatin1Char('/');
575  p += appname;
576 
577  // Check for executable in this tokenized path
578  result = checkExecutable(p, options & FindExeOption::IgnoreExecBit);
579  if (!result.isEmpty()) {
580  return result;
581  }
582  }
583 
584  // Not found in PATH, look into a bin dir
585  p = QFile::decodeName(BIN_INSTALL_DIR "/");
586  p += appname;
587  result = checkExecutable(p, options & FindExeOption::IgnoreExecBit);
588  if (!result.isEmpty()) {
589  return result;
590  }
591 
592  // If we reach here, the executable wasn't found.
593  // So return empty string.
594  return QString();
595 }
596 
597 // ---
598 
599 class Q_DECL_HIDDEN PropertySet::Private
600 {
601 public:
602  Private() {}
603  Private(const Private &other) {
604  copy(other);
605  }
606  void copy(const Private &other) {
607  for (AutodeletedHash<QByteArray, Property*>::ConstIterator it(other.data.constBegin());
608  it != other.data.constEnd(); ++it)
609  {
610  data.insert(it.key(), new Property(*it.value()));
611  }
612  }
613  bool operator==(const Private &other) const {
614  if (data.count() != other.data.count()) {
615  return false;
616  }
617  for (AutodeletedHash<QByteArray, Property*>::ConstIterator it(other.data.constBegin());
618  it != other.data.constEnd(); ++it)
619  {
620  AutodeletedHash<QByteArray, Property*>::ConstIterator findHere(data.constFind(it.key()));
621  if (*findHere.value() != *it.value()) {
622  return false;
623  }
624  }
625  return true;
626  }
628 };
629 
630 PropertySet::PropertySet()
631  : d(new Private)
632 {
633 }
634 
635 PropertySet::PropertySet(const PropertySet &other)
636  : d(new Private(*other.d))
637 {
638 }
639 
640 PropertySet::~PropertySet()
641 {
642  delete d;
643 }
644 
646 {
647  if (this != &other) {
648  d->data.clear();
649  d->copy(*other.d);
650  }
651  return *this;
652 }
653 
654 bool PropertySet::operator==(const PropertySet &other) const
655 {
656  return *d == *other.d;
657 }
658 
659 void PropertySet::insert(const QByteArray &name, const QVariant &value, const QString &caption)
660 {
661  QString realCaption = caption;
662  Property *existing = d->data.value(name);
663  if (existing) {
664  existing->setValue(value);
665  if (!caption.isEmpty()) { // if not, reuse
666  existing->setCaption(caption);
667  }
668  } else {
669  if (KDb::isIdentifier(name)) {
670  d->data.insert(name, new Property(value, realCaption));
671  } else {
672  kdbWarning() << name << "cannot be used as property name";
673  }
674  }
675 }
676 
677 void PropertySet::setCaption(const QByteArray &name, const QString &caption)
678 {
679  Property *existing = d->data.value(name);
680  if (existing) {
681  existing->setCaption(caption);
682  }
683 }
684 
685 void PropertySet::setValue(const QByteArray &name, const QVariant &value)
686 {
687  Property *existing = d->data.value(name);
688  if (existing) {
689  existing->setValue(value);
690  }
691 }
692 
694 {
695  d->data.remove(name);
696 }
697 
699 {
700  Property *result = d->data.value(name);
701  return result ? *result : Property();
702 }
703 
705 {
706  return d->data.keys();
707 }
708 
709 QVariant KDbUtils::squeezedValue(const QVariant &value)
710 {
711  switch(value.type()) {
712  case QVariant::String:
713  if (value.toString().length() > SQUEEZED_TEXT_LIMIT) {
714  return QVariant(value.toString().left(SQUEEZED_TEXT_LIMIT - SQUEEZED_TEXT_SUFFIX)
715  + QString::fromLatin1("...")
716  + value.toString().right(SQUEEZED_TEXT_SUFFIX)
717  + QString::fromLatin1("[%1 characters]").arg(value.toString().length()));
718  }
719  break;
720  case QVariant::ByteArray:
721  if (value.toByteArray().length() > SQUEEZED_TEXT_LIMIT) {
722  return QVariant(value.toByteArray().left(SQUEEZED_TEXT_LIMIT - SQUEEZED_TEXT_SUFFIX)
723  + "..."
724  + value.toByteArray().right(SQUEEZED_TEXT_SUFFIX)
725  + '[' + QByteArray::number(value.toByteArray().length())
726  + " bytes]");
727  }
728  break;
729  default:
730  break;
731  }
732 //! @todo add BitArray, Url, Hash, Map, Pixmap, Image?
733  return value;
734 }
void setCaption(const QByteArray &name, const QString &caption)
Sets caption for property name to caption.
Definition: KDbUtils.cpp:677
void append(const T &value)
QString section(QChar sep, int start, int end, QString::SectionFlags flags) const const
QByteArray right(int len) const const
void insert(const QByteArray &name, const QVariant &value, const QString &caption=QString())
Inserts property with a given name, value and caption.
Definition: KDbUtils.cpp:659
bool makeAbsolute()
QTime fromString(const QString &string, Qt::DateFormat format)
CaseInsensitive
SectionIncludeLeadingSep
QByteArray fromRawData(const char *data, int size)
void remove(const QByteArray &name)
Removes property with a given name.
Definition: KDbUtils.cpp:693
QStringRef midRef(int position, int n) const const
QStringList split(const QString &sep, QString::SplitBehavior behavior, Qt::CaseSensitivity cs) const const
int count(const T &value) const const
QChar separator()
void setValue(const QByteArray &name, const QVariant &value)
Sets value for property name to value.
Definition: KDbUtils.cpp:685
bool contains(const QString &str, Qt::CaseSensitivity cs) const const
QTime time() const const
void clear()
A set created from static (0-terminated) array of raw null-terminated strings.
Definition: KDbUtils.h:387
QByteArray number(int n, int base)
bool isValid() const const
QString homePath()
QByteArray toByteArray() const const
const QChar * unicode() const const
QString caption()
bool exists() const const
bool isFile() const const
void setFile(const QString &file)
Property()
Constructs a null property.
Definition: KDbUtils.cpp:75
bool isExecutable() const const
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
QString & sprintf(const char *cformat,...)
FILE * fopen(const QString &pathname, const char *mode)
A set of properties.
Definition: KDbUtils.h:479
QString fromLocal8Bit(const char *str, int size)
QString absoluteFilePath() const const
QVariant::Type type() const const
QHash::const_iterator constEnd() const const
A single property.
Definition: KDbUtils.h:446
bool contains(const QByteArray &string) const
Definition: KDbUtils.cpp:364
bool isEmpty() const const
QByteArray toUtf8() const const
PropertySet & operator=(const PropertySet &other)
Assigns other to this property set and returns a reference to this property set.
Definition: KDbUtils.cpp:645
int length() const const
Property property(const QByteArray &name) const
Definition: KDbUtils.cpp:698
QString filePath() const const
KCOREADDONS_EXPORT QString tildeExpand(const QString &path)
int msec() const const
QList< QByteArray > names() const
Definition: KDbUtils.cpp:704
Autodeleting hash.
Definition: KDbUtils.h:178
QDateTime fromString(const QString &string, Qt::DateFormat format)
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const const
int hour() const const
QString & replace(int position, int n, QChar after)
typedef ConstIterator
KDB_EXPORT bool isIdentifier(const QString &s)
Definition: KDb.cpp:2133
QByteArray left(int len) const const
void resize(int size)
const char * constData() const const
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
int second() const const
QString left(int n) const const
QString right(int n) const const
QString fromLatin1(const char *str, int size)
bool isValid() const const
void clear()
QString toString(Qt::DateFormat format) const const
QList::iterator begin()
int size() const const
int length() const const
QString asprintf(const char *cformat,...)
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
QString toString(Qt::DateFormat format) const const
QList::iterator end()
QFuture< void > map(Sequence &sequence, MapFunctor function)
QString mid(int position, int n) const const
bool operator==(const PropertySet &other) const
Definition: KDbUtils.cpp:654
int minute() const const
QObject * parent() const const
QString & append(QChar ch)
const QList< QKeySequence > & copy()
ISODateWithMs
char * data()
QString canonicalFilePath() const const
QString toString() const const
QString decodeName(const QByteArray &localFileName)
int stat(const QString &path, KDE_struct_stat *buf)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Dec 9 2022 04:09:47 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.