strigi/src/streams
archiveentrycache.h
Go to the documentation of this file.00001 /* This file is part of Strigi Desktop Search 00002 * 00003 * Copyright (C) 2006,2009 Jos van den Oever <jos@vandenoever.info> 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Library General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Library General Public License 00016 * along with this library; see the file COPYING.LIB. If not, write to 00017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 * Boston, MA 02110-1301, USA. 00019 */ 00020 #ifndef ARCHIVEENTRYCACHE_H 00021 #define ARCHIVEENTRYCACHE_H 00022 00023 #include "substreamprovider.h" 00024 00032 class ArchiveEntryCache { 00033 public: 00034 class SubEntry; 00035 typedef std::map<std::string, SubEntry *> SubEntryMap; 00036 00040 class SubEntry { 00041 public: 00043 Strigi::EntryInfo entry; 00045 SubEntryMap entries; 00047 SubEntry() { } 00049 virtual ~SubEntry(); 00050 }; 00054 class RootSubEntry : public SubEntry { 00055 public: 00057 RootSubEntry() :SubEntry() {} 00059 bool indexed; 00060 const SubEntry* findEntry(const std::string& rootpath, 00061 const std::string& url) const; 00062 }; 00063 ~ArchiveEntryCache() { 00064 std::map<std::string, RootSubEntry*>::const_iterator i; 00065 for (i = cache.begin(); i != cache.end(); ++i) { 00066 delete i->second; 00067 } 00068 } 00074 typedef std::map<std::string, RootSubEntry*> RootCache; 00075 RootCache cache; 00083 const SubEntry* findEntry(const std::string& url) const; 00095 std::map<std::string, RootSubEntry*>::const_iterator findRootEntry( 00096 const std::string& url) const; 00097 }; 00098 00099 #endif
KDE 4.4 API Reference