1 |
douglas |
688 |
// Command |
2 |
|
|
// |
3 |
douglas |
686 |
// Douglas Thrift |
4 |
|
|
// |
5 |
|
|
// $Id$ |
6 |
|
|
|
7 |
|
|
#ifndef _Command_hpp_ |
8 |
|
|
#define _Command_hpp_ |
9 |
|
|
|
10 |
|
|
#include <cxx/platform.hpp> |
11 |
|
|
|
12 |
|
|
#ifdef MENES_PRAGMA_ONCE |
13 |
|
|
#pragma once |
14 |
|
|
#endif |
15 |
|
|
|
16 |
|
|
#include <api/locks.hpp> |
17 |
douglas |
701 |
#include <api/path.hpp> |
18 |
douglas |
695 |
#include <ext/queues.hpp> |
19 |
douglas |
686 |
|
20 |
douglas |
697 |
#include "Subversion/Client.hpp" |
21 |
douglas |
686 |
#include "Url.hpp" |
22 |
|
|
|
23 |
douglas |
688 |
struct Command : public ext::ReferenceCounted { |
24 |
douglas |
701 |
const api::Path root; |
25 |
douglas |
713 |
const cse::String path; |
26 |
douglas |
688 |
protected: |
27 |
douglas |
706 |
#ifdef __FreeBSD__ |
28 |
douglas |
713 |
Command(const cse::String &root) : root(api::Path(root).GetRealPath()), path(root) {} |
29 |
douglas |
706 |
#else |
30 |
douglas |
713 |
Command(const cse::String &root) : root((root.IsEmpty() ? api::Path(_B(".")) : api::Path(root)).GetRealPath()), path(root) {} |
31 |
douglas |
706 |
#endif |
32 |
douglas |
688 |
}; |
33 |
douglas |
686 |
|
34 |
|
|
class CommandRunner |
35 |
|
|
{ |
36 |
|
|
protected: |
37 |
douglas |
713 |
const cse::String &sitemap; |
38 |
douglas |
695 |
ext::Queue<Url> &queue; |
39 |
douglas |
686 |
api::ThreadMutex &queueLock; |
40 |
douglas |
698 |
Subversion::Client client; |
41 |
douglas |
713 |
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 |
douglas |
716 |
cse::String GetPassword(const api::Path &directory); |
45 |
douglas |
686 |
}; |
46 |
|
|
|
47 |
|
|
#endif//_Command_hpp_ |