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

kded

  • kded
kctimefactory.cpp
1 /* This file is part of the KDE libraries
2  * Copyright (C) 2000 Waldo Bastian <bastian@kde.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License version 2 as published by the Free Software Foundation;
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Library General Public License for more details.
12  *
13  * You should have received a copy of the GNU Library General Public License
14  * along with this library; see the file COPYING.LIB. If not, write to
15  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  * Boston, MA 02110-1301, USA.
17  **/
18 
19 #include "kctimefactory.h"
20 #include "tdesycoca.h"
21 #include "tdesycocatype.h"
22 
23 #include <assert.h>
24 
25 KCTimeInfo::KCTimeInfo()
26  : KSycocaFactory( KST_CTimeInfo ), ctimeDict(977)
27 {
28  ctimeDict.setAutoDelete(true);
29  if (m_str)
30  {
31  (*m_str) >> m_dictOffset;
32  }
33  else
34  {
35  m_dictOffset = 0;
36  }
37 }
38 
39 KCTimeInfo::~KCTimeInfo()
40 {
41 }
42 
43 void
44 KCTimeInfo::saveHeader(TQDataStream &str)
45 {
46  KSycocaFactory::saveHeader(str);
47 
48  str << m_dictOffset;
49 }
50 
51 void
52 KCTimeInfo::save(TQDataStream &str)
53 {
54  KSycocaFactory::save(str);
55 
56  m_dictOffset = str.device()->at();
57  TQDictIterator<TQ_UINT32> it(ctimeDict);
58  while( it.current())
59  {
60  str << it.currentKey() << *(it.current());
61  ++it;
62  }
63  str << TQString::null << (TQ_UINT32) 0;
64 
65  int endOfFactoryData = str.device()->at();
66 
67  saveHeader(str);
68  str.device()->at(endOfFactoryData);
69 }
70 
71 void
72 KCTimeInfo::addCTime(const TQString &path, TQ_UINT32 ctime)
73 {
74  assert(!path.isEmpty());
75  ctimeDict.replace(path, new TQ_UINT32(ctime));
76 }
77 
78 TQ_UINT32
79 KCTimeInfo::ctime(const TQString &path)
80 {
81  TQ_UINT32 *ctimeP = ctimeDict[path];
82  return ctimeP ? *ctimeP : 0;
83 }
84 
85 void
86 KCTimeInfo::fillCTimeDict(TQDict<TQ_UINT32> &dict)
87 {
88  assert(m_str);
89  m_str->device()->at(m_dictOffset);
90  TQString path;
91  TQ_UINT32 ctime;
92  while(true)
93  {
94  KSycocaEntry::read(*m_str, path);
95  (*m_str) >> ctime;
96  if (path.isEmpty()) break;
97  dict.replace(path, new TQ_UINT32(ctime));
98  }
99 }
KCTimeInfo::save
virtual void save(TQDataStream &str)
Write out data.
Definition: kctimefactory.cpp:52
KCTimeInfo::saveHeader
virtual void saveHeader(TQDataStream &str)
Write out header information.
Definition: kctimefactory.cpp:44
KCTimeInfo::KCTimeInfo
KCTimeInfo()
Create factory.
Definition: kctimefactory.cpp:25

kded

Skip menu "kded"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kded

Skip menu "kded"
  • 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 kded by doxygen 1.9.1
This website is maintained by Timothy Pearson.