You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/09/22 22:52:22 UTC

svn commit: r1000218 - in /subversion/branches/object-model/subversion/bindings/c++: Types.cpp include/Types.h

Author: hwright
Date: Wed Sep 22 20:52:22 2010
New Revision: 1000218

URL: http://svn.apache.org/viewvc?rev=1000218&view=rev
Log:
On the object-model branch:
Change the way that the CommitInfo object wraps the underlying C object.

This is probably not the last time this will change, as my thoughts are not
finalized on the matter.  See: http://svn.haxx.se/dev/archive-2010-09/0497.shtml

* subversion/bindings/c++/include/Types.h
  (m_revision, m_date, m_author, m_post_commit_err, m_repos_root): Remove.
  (m_pool, m_info): New.
  (CommitInfo): Add a copy constructor.

* subversion/bindings/c++/Types.cpp
  (CommitInfo): Just duplicate the underlying C struct.
  (CommitInfo): New copy constructor.

Modified:
    subversion/branches/object-model/subversion/bindings/c++/Types.cpp
    subversion/branches/object-model/subversion/bindings/c++/include/Types.h

Modified: subversion/branches/object-model/subversion/bindings/c++/Types.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/c%2B%2B/Types.cpp?rev=1000218&r1=1000217&r2=1000218&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/c++/Types.cpp (original)
+++ subversion/branches/object-model/subversion/bindings/c++/Types.cpp Wed Sep 22 20:52:22 2010
@@ -31,15 +31,15 @@ namespace SVN
 {
 
 CommitInfo::CommitInfo(const svn_commit_info_t *info)
-  : m_author(info->author),
-    m_post_commit_err(info->post_commit_err == NULL ? ""
-                                                : info->post_commit_err),
-    m_repos_root(info->repos_root == NULL ? "" : info->repos_root),
-    m_revision(info->revision)
+  : m_pool()
 {
-  Pool pool;
+  m_info = svn_commit_info_dup(info, m_pool.pool());
+}
 
-  SVN_CPP_ERR(svn_time_from_cstring(&m_date, info->date, pool.pool()));
+CommitInfo::CommitInfo(const CommitInfo &that)
+  : m_pool()
+{
+  m_info = svn_commit_info_dup(that.m_info, m_pool.pool());
 }
 
 }

Modified: subversion/branches/object-model/subversion/bindings/c++/include/Types.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/c%2B%2B/include/Types.h?rev=1000218&r1=1000217&r2=1000218&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/c++/include/Types.h (original)
+++ subversion/branches/object-model/subversion/bindings/c++/include/Types.h Wed Sep 22 20:52:22 2010
@@ -27,8 +27,11 @@
 #ifndef TYPES_H
 #define TYPES_H
 
+#include "Pool.h"
 #include "Revision.h"
 
+#include "svn_types.h"
+
 #include <map>
 #include <string>
 
@@ -43,14 +46,12 @@ typedef std::map<std::string, std::strin
 class CommitInfo
 {
   private:
-    Revision m_revision;
-    apr_time_t m_date;
-    std::string m_author;
-    std::string m_post_commit_err;
-    std::string m_repos_root;
+    Pool m_pool;
+    svn_commit_info_t *m_info;
 
   public:
     CommitInfo(const svn_commit_info_t *info);
+    CommitInfo(const CommitInfo &);
 };
 
 }