[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: Julien Cugnière <julien.cugniere_at_gmail.com>
Date: Wed, 13 Oct 2010 18:44:37 +0200

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

-- 
Julien Cugnière
Received on 2010-10-13 18:45:13 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.