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

Re: object-model: Return by value, reference or pointer? (or something else?)

From: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: Wed, 13 Oct 2010 14:21:27 -0500

On Wed, Oct 13, 2010 at 11:44 AM, Julien Cugnière
<julien.cugniere_at_gmail.com> wrote:
> 2010/10/13 Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
>> Another option is a custom SVN::String type which looks / smells /
>> acts like a string, but also allows wrapping the NULL value, in a
>> manner you suggest above.
>
> Sorry to intrude, but just an additional possibility : can the strings
> manipulated by SVN contain embedded NUL characters ( "\0" ) ?
>
> If they can't, then you could use an std::string containing a single
> NUL character to represent the NULL string :
>
>    #define SVN_NULL_STRING std::string(1, '\0')
>
>    inline std::string getAuthor() const { return ptr ?
> std::string(ptr) : SVN_NULL_STRING; }

Subversion "strings" can be arbitrary byte arrays. I haven't yet
thought about how this translates to C++, but I'm wary of using
something not-quite-standard like the above.

-Hyrum
Received on 2010-10-13 21:22:05 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.