CFileSystemChangeStorage.h
Go to the documentation of this file.
1 #ifndef ihotf_CFileSystemChangeStorage_included
2 #define ihotf_CFileSystemChangeStorage_included
3 
4 
5 // Qt includes
6 #include <QtCore/QList>
7 #include <QtCore/QMutex>
8 
9 // AcfSln includes
11 
12 
13 namespace ihotf
14 {
15 
16 
22 {
23 public:
25 
26  // reimplemented (ihotf::IFileSystemChangeStorage)
27  virtual int GetStorageItemsCount() const;
28  virtual QString GetItemPath(int fileIndex) const;
29  virtual int GetItemState(int fileIndex) const;
30  virtual void UpdateStorageItem(const QString& path, int changeFlag);
31  virtual void RemoveStorageItem(int itemIndex);
32  virtual void ResetStorage();
33 
34 private:
35  int GetFileIndexFromPath(const QString& filePath) const;
36 
37 private:
38  struct FileItem
39  {
40  FileItem()
41  :state(0)
42  {
43  }
44 
45  QString path;
46  int state;
47  };
48 
49  typedef QList<FileItem> FileItems;
50  FileItems m_storageItems;
51 
52  mutable QMutex m_mutex;
53 };
54 
55 
56 } // namespace ihotf
57 
58 
59 #endif // !ihotf_CFileSystemChangeStorage_included
60 
virtual int GetItemState(int fileIndex) const
Get item state with the given index from the storage.
virtual void RemoveStorageItem(int itemIndex)
Remove the item from the storage.
virtual void ResetStorage()
Reset the storage.
Implementation of the file storage.
virtual int GetStorageItemsCount() const
Get number of items in the storage.
Common interface for a storage of files.
virtual QString GetItemPath(int fileIndex) const
Get item path with the given index from the storage.
virtual void UpdateStorageItem(const QString &path, int changeFlag)
Update storage item.

© 2007-2017 Witold Gantzke and Kirill Lepskiy