You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by Hyrum Wright <hw...@apache.org> on 2010/10/04 22:54:15 UTC

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

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 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