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

Comparing GoogleTron/Blog.cpp (file contents):
Revision 716 by douglas, 2006-03-28T04:49:27-08:00 vs.
Revision 717 by douglas, 2006-03-28T22:49:24-08:00

# Line 8 | Line 8
8  
9   #include <dbi/connection.hpp>
10   #include <dbi/driver.hpp>
11 + #include <dbi/resultset.hpp>
12  
13   #include "Blog.hpp"
14  
# Line 20 | Line 21 | Blog::Blog(const cse::String &sitemap, c
21  
22   void Blog::Entries(const api::Path &directory, const cse::String &base)
23   {
24 +        {
25 +                cse::String blog(client.GetProperty(_B("GoogleTron:Blog"), directory.GetPath()));
26 +
27 +                if (blog != _B("MovableType"))
28 +                        throw ext::NotImplementedException(_S<ios::String>(_B("unknown blog ")) << blog);
29 +        }
30 +
31          _R<dbi::Driver> driver(dbi::GetDriver(client.GetProperty(_B("GoogleTron:Driver"), directory.GetPath())));
32          _R<dbi::Connection> connection(driver->Connect(client.GetProperty(_B("GoogleTron:Host"), directory.GetPath()), client.GetProperty(_B("GoogleTron:User"), directory.GetPath()), GetPassword(directory), client.GetProperty(_B("GoogleTron:Database"), directory.GetPath())));
33 +        int32_t id;
34 +
35 +        {
36 +                _R<dbi::ResultSet> set(connection->Parse(_B("SELECT blog_id FROM mt_blog WHERE blog_site_url = ?"))->Execute(base));
37 +
38 +                if (set->MoveNext())
39 +                        id = set->Get<int32_t>(0);
40 +                else
41 +                        throw ext::StringException(_S<ios::String>("no blog ") << base);
42 +        }
43   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines