25 #ifndef PAGESPEED_KERNEL_BASE_SHARED_STRING_H_
26 #define PAGESPEED_KERNEL_BASE_SHARED_STRING_H_
30 #include "base/logging.h"
35 namespace net_instaweb {
66 StringPiece
Value()
const;
104 void Extend(
int new_size);
125 int size()
const {
return size_; }
126 bool empty()
const {
return size_ == 0; }
127 const char* data()
const {
return ref_string_->data() + skip_; }
133 void WriteAt(
int dest_offset,
const char* source,
int count);
152 return size_ !=
static_cast<int>(ref_string_->size());
167 return ref_string_.get();
172 return ref_string_.get() == that.ref_string_.get();
176 void UniquifyIfTruncated();
177 char* mutable_data() {
return &(*ref_string_.get())[0] + skip_; }
178 void ClearIfShared() {
184 RefCountedObj<GoogleString> ref_string_;
void Assign(StringPiece str)
Definition: shared_string.h:75
void Append(StringPiece str)
Definition: shared_string.h:90
void SwapWithString(GoogleString *str)
void WriteAt(int dest_offset, const char *source, int count)
bool unique() const
Definition: shared_string.h:146
const GoogleString * StringValue() const
Definition: shared_string.h:166
StringPiece Value() const
bool unique() const
Definition: ref_counted_ptr.h:170
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
void DetachRetainingContent()
Definition: shared_string.h:137
bool trimmed() const
Definition: shared_string.h:151
bool SharesStorage(const SharedString &that) const
Determines whether this and that share the same storage.
Definition: shared_string.h:171
Definition: shared_string.h:40
void Extend(int new_size)
int size() const
Computes the size, taking into account any removed prefix or suffix.
Definition: shared_string.h:125