ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/GoogleTron/Subversion/Client.cpp
Revision: 701
Committed: 2006-03-13T03:54:44-08:00 (19 years, 3 months ago) by douglas
File size: 1626 byte(s)
Log Message:
Grr! So, I need to set up authentication bullshit, lovely... well, time for ice cream.

File Contents

# Content
1 // Subversion Client
2 //
3 // Douglas Thrift
4 //
5 // $Id$
6
7 #include <cxx/standard.hh>
8
9 #include "Client.hpp"
10
11 namespace Subversion
12 {
13
14 Client::Client()
15 {
16 CheckError(::svn_client_create_context(&context, pool));
17 }
18
19 cse::String Client::GetProperty(const cse::String &property, const cse::String &target) const
20 {
21 ::apr_hash_t *hash;
22 ::svn_opt_revision_t revision = { ::svn_opt_revision_unspecified };
23
24 CheckError(::svn_client_propget2(&hash, property.NullTerminate(), target.NullTerminate(), &revision, &revision, false, context, pool));
25
26 if (::apr_hash_index_t *index = ::apr_hash_first(pool, hash))
27 {
28 ::svn_string_t *string;
29
30 ::apr_hash_this(index, NULL, NULL, reinterpret_cast<void **>(&string));
31
32 return cse::String(string->data, string->len);
33 }
34 else
35 return cse::EmptyString;
36 }
37
38 _L<Entry> Client::GetEntries(const cse::String &target) const
39 {
40 ::apr_hash_t *hash;
41 ::svn_opt_revision_t revision = { ::svn_opt_revision_unspecified };
42
43 //#if (SVN_VER_MAJOR == 1) && (SVN_VER_MINOR == 2)
44 CheckError(::svn_client_ls2(&hash, target.NullTerminate(), &revision, &revision, false, context, pool));
45 /*#else
46 CheckError(::svn_client_ls3(&hash, NULL, target.NullTerminate(), &revision, &revision, false, context, pool));
47 #endif*/
48
49 _L<Entry> entries;
50
51 for (::apr_hash_index_t *index(::apr_hash_first(pool, hash)); index; index = apr_hash_next(index))
52 {
53 const char *string;
54 ::apr_ssize_t size;
55 ::svn_dirent_t *entry;
56
57 ::apr_hash_this(index, reinterpret_cast<const void **>(&string), &size, reinterpret_cast<void **>(&entry));
58
59 entries.InsertLast(Entry(cse::String(string, size), entry));
60 }
61
62 return entries;
63 }
64
65 }

Properties

Name Value
svn:eol-style native
svn:keywords Id