]> git.mxchange.org Git - simgear.git/blob - simgear/io/SVNRepository.hxx
Reset: allow re-init of Nasal Ghosts.
[simgear.git] / simgear / io / SVNRepository.hxx
1 // DAVMirrorTree.hxx - mirror a DAV tree to the local file system
2 //
3 // Copyright (C) 2012  James Turner <zakalawe@mac.com>
4 //
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.
9 //
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.
14 //
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.
18
19
20 #ifndef SG_IO_DAVMIRRORTREE_HXX
21 #define SG_IO_DAVMIRRORTREE_HXX
22
23 #include <string>
24 #include <vector>
25 #include <memory>
26
27 #include <simgear/misc/sg_path.hxx>
28
29 namespace simgear  {
30   
31   namespace HTTP {
32     class Client;
33   }
34   
35 class SVNDirectory;  
36 class SVNRepoPrivate;
37
38 class SVNRepository
39 {
40 public:
41   
42     SVNRepository(const SGPath& root, HTTP::Client* cl);
43     ~SVNRepository();
44
45     SVNDirectory* rootDir() const;
46     SGPath fsBase() const;
47
48     void setBaseUrl(const std::string& url);
49     std::string baseUrl() const;
50
51     HTTP::Client* http() const;
52
53     void update();
54
55     bool isDoingSync() const;
56     
57     enum ResultCode {
58         SVN_NO_ERROR = 0,
59         SVN_ERROR_NOT_FOUND,
60         SVN_ERROR_SOCKET,
61         SVN_ERROR_XML,
62         SVN_ERROR_TXDELTA,
63         SVN_ERROR_IO,
64         SVN_ERROR_CHECKSUM
65     };
66     
67     ResultCode failure() const;
68 private:
69     bool isBare() const;
70     
71     std::auto_ptr<SVNRepoPrivate> _d;
72 };
73
74 } // of namespace simgear
75
76 #endif // of SG_IO_DAVMIRRORTREE_HXX