net_instaweb::SharedString Class Reference

Reference-counted string. This class just adds the StringPiece constructor. More...

#include "shared_string.h"

Inheritance diagram for net_instaweb::SharedString:
net_instaweb::RefCountedObj< GoogleString >

List of all members.

Public Member Functions

 SharedString (const StringPiece &str)
 SharedString (const GoogleString &str)
 SharedString (const char *str)

Detailed Description

Reference-counted string. This class just adds the StringPiece constructor.


Constructor & Destructor Documentation

net_instaweb::SharedString::SharedString ( const GoogleString str  )  [inline, explicit]

When constructing with a GoogleString, we going through the StringPiece ctor above causes an extra copy compared with string implementations that use copy-on-write.

net_instaweb::SharedString::SharedString ( const char *  str  )  [inline, explicit]

Given the two constructors above, it is ambiguous which one gets called when passed a string-literal, so making an explicit const char* constructor eliminates the ambiguity. This is likely beneficial mostly for tests.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Tue May 29 16:34:18 2012 for Page Speed Optimization Libraries by  doxygen 1.6.3