19 #include "kctimefactory.h"
20 #include "tdesycoca.h"
21 #include "tdesycocatype.h"
26 : KSycocaFactory( KST_CTimeInfo ), ctimeDict(977)
28 ctimeDict.setAutoDelete(
true);
31 (*m_str) >> m_dictOffset;
39 KCTimeInfo::~KCTimeInfo()
46 KSycocaFactory::saveHeader(str);
54 KSycocaFactory::save(str);
56 m_dictOffset = str.device()->at();
57 TQDictIterator<TQ_UINT32> it(ctimeDict);
60 str << it.currentKey() << *(it.current());
63 str << TQString::null << (TQ_UINT32) 0;
65 int endOfFactoryData = str.device()->at();
68 str.device()->at(endOfFactoryData);
72 KCTimeInfo::addCTime(
const TQString &path, TQ_UINT32 ctime)
74 assert(!path.isEmpty());
75 ctimeDict.replace(path,
new TQ_UINT32(ctime));
79 KCTimeInfo::ctime(
const TQString &path)
81 TQ_UINT32 *ctimeP = ctimeDict[path];
82 return ctimeP ? *ctimeP : 0;
86 KCTimeInfo::fillCTimeDict(TQDict<TQ_UINT32> &dict)
89 m_str->device()->at(m_dictOffset);
94 KSycocaEntry::read(*m_str, path);
96 if (path.isEmpty())
break;
97 dict.replace(path,
new TQ_UINT32(ctime));
virtual void save(TQDataStream &str)
Write out data.
virtual void saveHeader(TQDataStream &str)
Write out header information.
KCTimeInfo()
Create factory.