1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #ifndef ECResyncSet_INCLUDED
- #define ECResyncSet_INCLUDED
- #include <map>
- #include <vector>
- #include <kopano/zcdefs.h>
- #include <mapidefs.h>
- #include <edkmdb.h>
- namespace KC {
- class ECResyncSetIterator;
- class ECResyncSet _kc_final {
- public:
- typedef std::vector<BYTE> array_type;
- struct storage_type {
- storage_type(const array_type& _entryId, const FILETIME& _lastModTime)
- : entryId(_entryId), lastModTime(_lastModTime), flags(SYNC_NEW_MESSAGE)
- { }
- array_type entryId;
- FILETIME lastModTime;
- ULONG flags;
- };
- typedef std::map<array_type, storage_type> map_type;
- typedef map_type::size_type size_type;
- void Append(const SBinary &sbinSourceKey, const SBinary &sbinEntryID, const FILETIME &lastModTime);
- bool Remove(const SBinary &sbinSourceKey);
- ECResyncSetIterator Find(const SBinary &sBinSourceKey);
- bool IsEmpty() const { return m_map.empty(); }
- size_type Size() const { return m_map.size(); }
- private:
- map_type m_map;
- friend class ECResyncSetIterator;
- };
- class ECResyncSetIterator _kc_final {
- public:
- ECResyncSetIterator(ECResyncSet &resyncSet);
- ECResyncSetIterator(ECResyncSet &resyncSet, const SBinary &sBinSourceKey);
- bool IsValid() const;
- LPENTRYID GetEntryID() const;
- ULONG GetEntryIDSize() const;
- const FILETIME& GetLastModTime() const;
- ULONG GetFlags() const;
- void SetFlags(ULONG flags);
- void Next();
- private:
- typedef ECResyncSet::map_type::iterator iterator_type;
- ECResyncSet *m_lpResyncSet;
- iterator_type m_iterator;
- const static FILETIME s_nullTime;
- };
- }
- #endif
|