14 |
|
#endif |
15 |
|
|
16 |
|
#include <api/locks.hpp> |
17 |
+ |
#include <api/path.hpp> |
18 |
+ |
#include <ext/queues.hpp> |
19 |
|
|
20 |
< |
#include <queue> // XXX: no ext::Queue yet :( |
19 |
< |
|
20 |
> |
#include "Subversion/Client.hpp" |
21 |
|
#include "Url.hpp" |
22 |
|
|
23 |
|
struct Command : public ext::ReferenceCounted { |
24 |
< |
const cse::String root; |
24 |
> |
const api::Path root; |
25 |
> |
const cse::String path; |
26 |
|
protected: |
27 |
< |
Command(const cse::String &root) : root(root) {} |
28 |
< |
public: |
29 |
< |
operator const cse::String &() { return root; } |
27 |
> |
#ifdef __FreeBSD__ |
28 |
> |
Command(const cse::String &root) : root(api::Path(root).GetRealPath()), path(root) {} |
29 |
> |
#else |
30 |
> |
Command(const cse::String &root) : root((root.IsEmpty() ? api::Path(_B(".")) : api::Path(root)).GetRealPath()), path(root) {} |
31 |
> |
#endif |
32 |
|
}; |
33 |
|
|
34 |
|
class CommandRunner |
35 |
|
{ |
36 |
|
protected: |
37 |
|
const cse::String &sitemap; |
38 |
< |
const cse::String &base; |
35 |
< |
std::queue<Url> &queue; |
38 |
> |
ext::Queue<Url> &queue; |
39 |
|
api::ThreadMutex &queueLock; |
40 |
< |
CommandRunner(const cse::String &sitemap, const cse::String &base, std::queue<Url> &queue, api::ThreadMutex &queueLock) : sitemap(sitemap), base(base), queue(queue), queueLock(queueLock) {} |
40 |
> |
Subversion::Client client; |
41 |
> |
CommandRunner(const cse::String &sitemap, ext::Queue<Url> &queue, api::ThreadMutex &queueLock) : sitemap(sitemap), queue(queue), queueLock(queueLock) {} |
42 |
> |
template <typename Type> |
43 |
> |
Type GetProperties(const cse::String &property, const cse::String &target); |
44 |
> |
cse::String GetPassword(const api::Path &directory); |
45 |
|
}; |
46 |
|
|
47 |
|
#endif//_Command_hpp_ |