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/24 23:25:45 UTC
svn commit: r1001084 -
/subversion/branches/object-model/subversion/bindings/c++/include/Types.h
Author: hwright
Date: Fri Sep 24 21:25:44 2010
New Revision: 1001084
URL: http://svn.apache.org/viewvc?rev=1001084&view=rev
Log:
On the object-model branch:
* subversion/bindings/c++/include/Types.h:
(Lock): New wrapper for svn_lock_t.
Modified:
subversion/branches/object-model/subversion/bindings/c++/include/Types.h
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=1001084&r1=1001083&r2=1001084&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/c++/include/Types.h (original)
+++ subversion/branches/object-model/subversion/bindings/c++/include/Types.h Fri Sep 24 21:25:44 2010
@@ -172,6 +172,67 @@ class CommitInfo
}
};
+class Lock
+{
+ private:
+ Private::CStructWrapper<Lock, const svn_lock_t> m_lock;
+
+ public:
+ inline static svn_lock_t *
+ dup(const svn_lock_t *lock, Pool &pool)
+ {
+ return svn_lock_dup(lock, pool.pool());
+ }
+
+ explicit inline
+ Lock(const svn_lock_t *lock)
+ : m_lock(lock)
+ {
+ }
+
+ inline const std::string
+ getPath() const
+ {
+ return std::string(m_lock->path);
+ }
+
+ inline const std::string
+ getToken() const
+ {
+ return std::string(m_lock->token);
+ }
+
+ inline const std::string
+ getOwner() const
+ {
+ return std::string(m_lock->owner);
+ }
+
+ inline const std::string
+ getComment() const
+ {
+ return std::string(m_lock->comment);
+ }
+
+ inline bool
+ isDavComment() const
+ {
+ return m_lock->is_dav_comment;
+ }
+
+ inline apr_time_t
+ getCreationDate() const
+ {
+ return m_lock->creation_date;
+ }
+
+ inline apr_time_t
+ getExpirationDate() const
+ {
+ return m_lock->expiration_date;
+ }
+};
+
class ClientNotifyInfo
{
private:
Re: svn commit: r1001084 - /subversion/branches/object-model/subversion/bindings/c++/include/Types.h
Posted by Blair Zajac <bl...@orcaware.com>.
On 10/04/2010 01:54 PM, Hyrum Wright wrote:
> On Fri, Sep 24, 2010 at 4:30 PM, Blair Zajac<bl...@orcaware.com> wrote:
>> On 9/24/10 2:25 PM, hwright@apache.org wrote:
>>>
>>> Author: hwright
>>> Date: Fri Sep 24 21:25:44 2010
>>> New Revision: 1001084
>>>
>> All the methods that return a const std::string can return a non-const
>> std::string since the caller will get a copy of the string. This would also
>> prevent callers from modifying the returned string, which is odd.
>
> Thanks for the review. I've addressed these two items in r1004422 and
> r1004423, respectively.
Thanks!
Blair
Re: svn commit: r1001084 - /subversion/branches/object-model/subversion/bindings/c++/include/Types.h
Posted by Hyrum Wright <hw...@apache.org>.
On Fri, Sep 24, 2010 at 4:30 PM, Blair Zajac <bl...@orcaware.com> wrote:
> On 9/24/10 2:25 PM, hwright@apache.org wrote:
>>
>> Author: hwright
>> Date: Fri Sep 24 21:25:44 2010
>> New Revision: 1001084
>>
>> URL: http://svn.apache.org/viewvc?rev=1001084&view=rev
>> Log:
>> On the object-model branch:
>> * subversion/bindings/c++/include/Types.h:
>> (Lock): New wrapper for svn_lock_t.
>>
>> Modified:
>>
>> subversion/branches/object-model/subversion/bindings/c++/include/Types.h
>>
>> 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=1001084&r1=1001083&r2=1001084&view=diff
>>
>> ==============================================================================
>> ---
>> subversion/branches/object-model/subversion/bindings/c++/include/Types.h
>> (original)
>> +++
>> subversion/branches/object-model/subversion/bindings/c++/include/Types.h Fri
>> Sep 24 21:25:44 2010
>> @@ -172,6 +172,67 @@ class CommitInfo
>> }
>> };
>>
>> +class Lock
>> +{
>> + private:
>> + Private::CStructWrapper<Lock, const svn_lock_t> m_lock;
>
> Hi Hryum,
>
> The Google C++ code style has private sections at the end of the file:
>
> http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Declaration_Order
>
>> + inline const std::string
>> + getPath() const
>> + {
>> + return std::string(m_lock->path);
>> + }
>
> All the methods that return a const std::string can return a non-const
> std::string since the caller will get a copy of the string. This would also
> prevent callers from modifying the returned string, which is odd.
Thanks for the review. I've addressed these two items in r1004422 and
r1004423, respectively.
-Hyrum
Re: svn commit: r1001084 - /subversion/branches/object-model/subversion/bindings/c++/include/Types.h
Posted by Hyrum Wright <hw...@apache.org>.
On Fri, Sep 24, 2010 at 4:30 PM, Blair Zajac <bl...@orcaware.com> wrote:
> On 9/24/10 2:25 PM, hwright@apache.org wrote:
>>
>> Author: hwright
>> Date: Fri Sep 24 21:25:44 2010
>> New Revision: 1001084
>>
>> URL: http://svn.apache.org/viewvc?rev=1001084&view=rev
>> Log:
>> On the object-model branch:
>> * subversion/bindings/c++/include/Types.h:
>> (Lock): New wrapper for svn_lock_t.
>>
>> Modified:
>>
>> subversion/branches/object-model/subversion/bindings/c++/include/Types.h
>>
>> 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=1001084&r1=1001083&r2=1001084&view=diff
>>
>> ==============================================================================
>> ---
>> subversion/branches/object-model/subversion/bindings/c++/include/Types.h
>> (original)
>> +++
>> subversion/branches/object-model/subversion/bindings/c++/include/Types.h Fri
>> Sep 24 21:25:44 2010
>> @@ -172,6 +172,67 @@ class CommitInfo
>> }
>> };
>>
>> +class Lock
>> +{
>> + private:
>> + Private::CStructWrapper<Lock, const svn_lock_t> m_lock;
>
> Hi Hryum,
>
> The Google C++ code style has private sections at the end of the file:
>
> http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Declaration_Order
>
>> + inline const std::string
>> + getPath() const
>> + {
>> + return std::string(m_lock->path);
>> + }
>
> All the methods that return a const std::string can return a non-const
> std::string since the caller will get a copy of the string. This would also
> prevent callers from modifying the returned string, which is odd.
Thanks for the review. I've addressed these two items in r1004422 and
r1004423, respectively.
-Hyrum
Re: svn commit: r1001084 - /subversion/branches/object-model/subversion/bindings/c++/include/Types.h
Posted by Blair Zajac <bl...@orcaware.com>.
On 9/24/10 2:25 PM, hwright@apache.org wrote:
> Author: hwright
> Date: Fri Sep 24 21:25:44 2010
> New Revision: 1001084
>
> URL: http://svn.apache.org/viewvc?rev=1001084&view=rev
> Log:
> On the object-model branch:
> * subversion/bindings/c++/include/Types.h:
> (Lock): New wrapper for svn_lock_t.
>
> Modified:
> subversion/branches/object-model/subversion/bindings/c++/include/Types.h
>
> 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=1001084&r1=1001083&r2=1001084&view=diff
> ==============================================================================
> --- subversion/branches/object-model/subversion/bindings/c++/include/Types.h (original)
> +++ subversion/branches/object-model/subversion/bindings/c++/include/Types.h Fri Sep 24 21:25:44 2010
> @@ -172,6 +172,67 @@ class CommitInfo
> }
> };
>
> +class Lock
> +{
> + private:
> + Private::CStructWrapper<Lock, const svn_lock_t> m_lock;
Hi Hryum,
The Google C++ code style has private sections at the end of the file:
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Declaration_Order
> + inline const std::string
> + getPath() const
> + {
> + return std::string(m_lock->path);
> + }
All the methods that return a const std::string can return a non-const
std::string since the caller will get a copy of the string. This would also
prevent callers from modifying the returned string, which is odd.
Blair
Re: svn commit: r1001084 - /subversion/branches/object-model/subversion/bindings/c++/include/Types.h
Posted by Blair Zajac <bl...@orcaware.com>.
On 9/24/10 2:25 PM, hwright@apache.org wrote:
> Author: hwright
> Date: Fri Sep 24 21:25:44 2010
> New Revision: 1001084
>
> URL: http://svn.apache.org/viewvc?rev=1001084&view=rev
> Log:
> On the object-model branch:
> * subversion/bindings/c++/include/Types.h:
> (Lock): New wrapper for svn_lock_t.
>
> Modified:
> subversion/branches/object-model/subversion/bindings/c++/include/Types.h
>
> 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=1001084&r1=1001083&r2=1001084&view=diff
> ==============================================================================
> --- subversion/branches/object-model/subversion/bindings/c++/include/Types.h (original)
> +++ subversion/branches/object-model/subversion/bindings/c++/include/Types.h Fri Sep 24 21:25:44 2010
> @@ -172,6 +172,67 @@ class CommitInfo
> }
> };
>
> +class Lock
> +{
> + private:
> + Private::CStructWrapper<Lock, const svn_lock_t> m_lock;
Hi Hryum,
The Google C++ code style has private sections at the end of the file:
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Declaration_Order
> + inline const std::string
> + getPath() const
> + {
> + return std::string(m_lock->path);
> + }
All the methods that return a const std::string can return a non-const
std::string since the caller will get a copy of the string. This would also
prevent callers from modifying the returned string, which is odd.
Blair