10 |
|
#include <api/pcre/regex.hpp> |
11 |
|
#include <api/process.hpp> |
12 |
|
#include <app/simple.hpp> |
13 |
+ |
#include <hop/bind.hpp> |
14 |
|
#include <xml/textwriter.hpp> |
15 |
|
|
16 |
|
#include "GoogleTron.hpp" |
16 |
– |
#include "GzipWriter.hpp" |
17 |
|
#include "Sleep.hpp" |
18 |
+ |
#include "Zlib/GzipWriter.hpp" |
19 |
|
|
20 |
|
int Main(const app::Options &options) |
21 |
|
{ |
42 |
|
return 0; |
43 |
|
} |
44 |
|
|
45 |
< |
GoogleTron::GoogleTron(const cse::String &sitemap) : working(true), sitemap(sitemap) |
45 |
> |
GoogleTron::GoogleTron(const cse::String &sitemap) : working(true), sitemap(sitemap), output(new _H<api::Thread>(hop::BindAll(&GoogleTron::Output, this))) |
46 |
|
{ |
47 |
|
// XXX: start some threads |
48 |
|
} |
53 |
|
|
54 |
|
working = false; |
55 |
|
|
56 |
< |
// XXX: wait on output thread |
56 |
> |
output->Join(); |
57 |
|
} |
58 |
|
|
59 |
|
int GoogleTron::Output() |
60 |
|
{ |
61 |
< |
_S<GzipWriter> gzip(sitemap); |
61 |
> |
_S<Zlib::GzipWriter> gzip(sitemap); |
62 |
|
_S<xml::TextWriter> writer(gzip); |
63 |
|
xml::ScopeElement urlset(writer, _B("urlset")); |
64 |
|
|