OSDN Git Service

174db7d91194f518baab8ca5fac0a789d471ddb8
[kita/kita.git] / kita / src / kitacacheinfo.h
1 /***************************************************************************
2  *   Copyright (C) 2003 by Hideki Ikemoto                                  *
3  *   ikemo@users.sourceforge.jp                                            *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  ***************************************************************************/
10
11 #ifndef _KITACACHEINFO_H_
12 #define _KITACACHEINFO_H_
13
14 #include <kurl.h>
15
16 #include <qmap.h>
17
18 /**
19  * 
20  * Hideki Ikemoto
21  **/
22 class KitaCacheInfo
23 {
24 public:
25   static KitaCacheInfo* getInstance();
26   void setVestedNum(const KURL& url, int num);
27   int getVestedNum(const KURL& url);
28   void setResNum( const KURL& url, int num );
29   int resNum( const KURL& url );
30   friend QDataStream& operator<<(QDataStream& s, KitaCacheInfo& c);
31   friend QDataStream& operator>>(QDataStream& s, KitaCacheInfo& c);
32 private:
33   KitaCacheInfo();
34   ~KitaCacheInfo();
35   QMap<QString, int> m_vestedDict;
36   QMap<QString, int> m_resNumDict;
37   static KitaCacheInfo* instance;
38 };
39
40 #endif