[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1001084 - /subversion/branches/object-model/subversion/bindings/c++/include/Types.h

From: Blair Zajac <blair_at_orcaware.com>
Date: Fri, 24 Sep 2010 14:30:36 -0700

On 9/24/10 2:25 PM, hwright_at_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
Received on 2010-09-24 23:31:17 CEST

This is an archived mail posted to the Subversion Dev mailing list.