• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Nepomuk

  • sources
  • kde-4.12
  • kdelibs
  • nepomuk
  • query
util.h
Go to the documentation of this file.
1 /*
2  This file is part of the Nepomuk KDE project.
3  Copyright (C) 2008-2010 Sebastian Trueg <trueg@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef _NEPOMUK_QUERY_UTILS_H_
21 #define _NEPOMUK_QUERY_UTILS_H_
22 
23 #include <QtCore/QList>
24 #include <QtCore/QHash>
25 
26 template<typename T>
27 bool compareQList( const QList<T>& rp1, const QList<T>& rp2 ) {
28  if( rp1.count() != rp2.count() )
29  return false;
30  foreach( const T& rp, rp1 ) {
31  if ( !rp2.contains( rp ) ) {
32  return false;
33  }
34  }
35  return true;
36 }
37 
38 template<typename Key, typename Value>
39 bool compareHash( const QHash<Key, Value>& h1, const QHash<Key, Value>& h2 ) {
40  if( h1.count() != h2.count() )
41  return false;
42  for( typename QHash<Key, Value>::ConstIterator it1 = h1.constBegin();
43  it1 != h1.constEnd(); ++it1 ) {
44  typename QHash<Key, Value>::ConstIterator it2 = h2.find( it1.key() );
45  if( it2 == h2.constEnd() ||
46  *it1 != *it2 )
47  return false;
48  }
49  return true;
50 }
51 
52 #endif
compareQList
bool compareQList(const QList< T > &rp1, const QList< T > &rp2)
Definition: util.h:27
compareHash
bool compareHash(const QHash< Key, Value > &h1, const QHash< Key, Value > &h2)
Definition: util.h:39
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Nepomuk

Skip menu "Nepomuk"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal