ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/GoogleTron/GoogleTron.cpp
(Generate patch)

Comparing GoogleTron/GoogleTron.cpp (file contents):
Revision 679 by douglas, 2006-03-05T19:57:15-08:00 vs.
Revision 680 by douglas, 2006-03-06T00:40:40-08:00

# Line 10 | Line 10
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   {
# Line 41 | Line 42 | int Main(const app::Options &options)
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   }
# Line 52 | Line 53 | GoogleTron::~GoogleTron()
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines