Use CAutoGeneralHandle
[TortoiseGit.git] / src / TortoiseProc / ILogReceiver.h
blob3771becd31ba4c45a8936ffa888efc19fc49b4b4
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2007-2007 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #pragma once
21 ///////////////////////////////////////////////////////////////
22 // temporarily used to disambiguate LogChangedPath definitions
23 ///////////////////////////////////////////////////////////////
25 #ifndef __ILOGRECEIVER_H__
26 #define __ILOGRECEIVER_H__
27 #endif
29 ///////////////////////////////////////////////////////////////
30 // required includes
31 ///////////////////////////////////////////////////////////////
33 //#include "svn_types.h"
36 /**
37 * data structure to accommodate the change list.
39 struct LogChangedPath
41 CString sPath;
42 // CString sCopyFromPath;
43 CString lCopyFromRev;
44 DWORD action;
46 /// returns the action as a string
47 const CString& GetAction() const;
49 private:
51 /// cached return value of GetAction()
52 mutable CString actionAsString;
57 /// auto-deleting extension of MFC Arrays for pointer arrays
59 template<class T>
60 class CAutoArray : public CArray<T*,T*>
62 public:
64 // default and copy construction
66 CAutoArray()
70 CAutoArray (const CAutoArray& rhs)
72 Copy (rhs);
75 // destruction deletes members
77 ~CAutoArray()
79 for (INT_PTR i = 0, count = GetCount(); i < count; ++i)
80 delete GetAt (i);
84 typedef CAutoArray<LogChangedPath> LogChangedPathArray;
86 /**
87 * standard revision properties
90 struct StandardRevProps
92 CString author;
93 // apr_time_t timeStamp;
94 CString message;
97 /**
98 * data structure to accommodate the list of user-defined revision properties.
100 struct UserRevProp
102 CString name;
103 CString value;
106 typedef CAutoArray<UserRevProp> UserRevPropArray;
110 * Interface for receiving log information. It will be used as a callback
111 * in ILogQuery::Log().
113 * To cancel the log and/or indicate errors, throw an SVNError exception.
115 class ILogReceiver
117 public:
119 /// call-back for every revision found
120 /// (called at most once per revision)
122 /// the implementation may modify but not delete()
123 /// the data containers passed to it
125 /// any pointer may be NULL
127 /// may throw a SVNError to cancel the log
129 virtual void ReceiveLog ( LogChangedPathArray* changes
130 , CString rev
131 , const StandardRevProps* stdRevProps
132 , UserRevPropArray* userRevProps
133 , bool mergesFollow) = 0;