1/* 2 * Copyright (c) 2008 Stephan A��mus <superstippi@gmx.de> 3 * All rights reserved. Distributed under the terms of the MIT license. 4 */ 5#ifndef CHANGES_ITERATOR_H 6#define CHANGES_ITERATOR_H 7 8#include <HashMap.h> 9#include <HashString.h> 10 11#include "FileIterator.h" 12 13class BEntry; 14class BDirectory; 15class Model; 16 17class ChangesIterator : public FileIterator { 18public: 19 ChangesIterator(const Model* model); 20 virtual ~ChangesIterator(); 21 22 virtual bool IsValid() const; 23 virtual bool GetNextName(char* buffer); 24 virtual bool NotifyNegatives() const; 25 26public: 27 void EntryAdded(const char* path); 28 void EntryRemoved(const char* path); 29 void EntryChanged(const char* path); 30 31 bool IsEmpty() const; 32 void PrintToStream() const; 33 34private: 35 typedef HashMap<HashString, uint32> PathMap; 36 enum { 37 ENTRY_ADDED = 0, 38 ENTRY_REMOVED, 39 ENTRY_CHANGED 40 }; 41 42 PathMap fPathMap; 43 int32 fIteratorIndex; 44 45 bool fRecurseDirs : 1; 46 bool fRecurseLinks : 1; 47 bool fSkipDotDirs : 1; 48 bool fTextOnly : 1; 49}; 50 51#endif // CHANGES_ITERATOR_H 52