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 |
705 |
operator api::Path() const { return root; } |
26 |
douglas |
688 |
protected: |
27 |
douglas |
706 |
#ifdef __FreeBSD__ |
28 |
douglas |
701 |
Command(const cse::String &root) : root(api::Path(root).GetRealPath()) {} |
29 |
douglas |
706 |
#else |
30 |
|
|
Command(const cse::String &root) : root((root.IsEmpty() ? api::Path(_B(".")) : api::Path(root)).GetRealPath()) {} |
31 |
|
|
#endif |
32 |
douglas |
688 |
}; |
33 |
douglas |
686 |
|
34 |
|
|
class CommandRunner |
35 |
|
|
{ |
36 |
|
|
protected: |
37 |
douglas |
696 |
const cse::String &sitemap, &base; |
38 |
douglas |
695 |
ext::Queue<Url> &queue; |
39 |
douglas |
686 |
api::ThreadMutex &queueLock; |
40 |
douglas |
698 |
Subversion::Client client; |
41 |
douglas |
695 |
CommandRunner(const cse::String &sitemap, const cse::String &base, ext::Queue<Url> &queue, api::ThreadMutex &queueLock) : sitemap(sitemap), base(base), queue(queue), queueLock(queueLock) {} |
42 |
douglas |
686 |
}; |
43 |
|
|
|
44 |
|
|
#endif//_Command_hpp_ |