• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

tdeconfigdata.h
00001 /*
00002    This file is part of the KDE libraries
00003    Copyright (c) 1999-2000 Preston Brown <pbrown@kde.org>
00004    Copyright (C) 1996-2000 Matthias Kalle Dalheimer <kalle@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019    Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef _TDECONFIGDATA_H
00023 #define _TDECONFIGDATA_H
00024 
00025 #include <tqmap.h> // generic red-black tree class
00026 #include "tdelibs_export.h"
00027 
00032 struct TDECORE_EXPORT KEntry
00033 {
00034   KEntry()
00035     : mValue(0), bDirty(false), bNLS(false), 
00036       bGlobal(false), bImmutable(false), bDeleted(false), bExpand(false) {}
00037   TQCString mValue;
00041   bool    bDirty :1;
00045   bool    bNLS   :1;
00049   bool    bGlobal:1;
00053   bool    bImmutable:1;
00057   bool    bDeleted:1;
00061   bool    bExpand:1;
00062 };
00063 
00069 struct TDECORE_EXPORT KEntryKey
00070 {
00071   KEntryKey(const TQCString& _group = 0,
00072         const TQCString& _key = 0)
00073       : mGroup(_group), mKey(_key), bLocal(false), bDefault(false),
00074         c_key(_key.data()) {}
00078   TQCString mGroup;
00082   TQCString mKey;
00086   bool    bLocal  :1;
00090   bool    bDefault:1;
00091  
00092   const char *c_key;
00093 };
00094 
00099 inline bool operator <(const KEntryKey &k1, const KEntryKey &k2)
00100 {
00101    //saves one strcmp on each call
00102    int result=qstrcmp(k1.mGroup.data(),k2.mGroup.data());
00103    if (result!=0)
00104       return (result<0);     
00105 
00106   if (!k1.c_key && k2.c_key)
00107     return true;
00108 
00109   result = 0;
00110   if (k1.c_key && k2.c_key)
00111      result = strcmp(k1.c_key, k2.c_key);
00112   if (result != 0)
00113      return result < 0;
00114   if (!k1.bLocal && k2.bLocal)
00115     return true;
00116   if (k1.bLocal && !k2.bLocal)
00117     return false;
00118   return (!k1.bDefault && k2.bDefault);
00119 }
00120 
00128 typedef TQMap<KEntryKey, KEntry> KEntryMap;
00129 
00135 typedef TQMap<KEntryKey, KEntry>::Iterator KEntryMapIterator;
00136 
00144 typedef TQMap<KEntryKey, KEntry>::ConstIterator KEntryMapConstIterator;
00145 
00146 #endif

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.