1 // DAVCollectionMirror.hxx - mirror a DAV collection to the local filesystem
3 // Copyright (C) 2013 James Turner <zakalawe@mac.com>
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License as
7 // published by the Free Software Foundation; either version 2 of the
8 // License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // 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
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef SG_IO_DAVCOLLECTIONMIRROR_HXX
21 #define SG_IO_DAVCOLLECTIONMIRROR_HXX
27 #include <simgear/misc/sg_path.hxx>
28 #include <simgear/misc/strutils.hxx>
29 #include <simgear/io/DAVMultiStatus.hxx>
34 namespace HTTP { class Request; }
41 typedef std::vector<SVNDirectory*> DirectoryList;
47 SVNDirectory(SVNRepository *repo, const SGPath& path);
50 void setBaseUrl(const std::string& url);
52 // init from a collection
53 SVNDirectory(SVNDirectory* pr, DAVCollection* col);
55 void beginUpdateReport();
56 void updateReportComplete();
58 bool isDoingSync() const;
60 std::string url() const;
62 std::string name() const;
64 DAVResource* addChildFile(const std::string& fileName);
65 SVNDirectory* addChildDirectory(const std::string& dirName);
67 // void updateChild(DAVResource* child);
68 void deleteChildByName(const std::string& name);
73 simgear::Dir fsDir() const;
75 std::string repoPath() const;
77 SVNRepository* repository() const;
78 DAVCollection* collection() const
81 std::string cachedRevision() const
82 { return _cachedRevision; }
84 void mergeUpdateReportDetails(unsigned int depth, string_list& items);
86 SVNDirectory* parent() const;
87 SVNDirectory* child(const std::string& dirName) const;
93 DirectoryList::iterator findChildDir(const std::string& dirName);
99 std::string _cachedRevision;
100 bool _doingUpdateReport;
102 SVNDirectory* _parent;
103 DirectoryList _children;
106 } // of namespace simgear
108 #endif // of SG_IO_DAVCOLLECTIONMIRROR_HXX