From b3deca975e49cd28d8bc50f04b5b4c002162461e Mon Sep 17 00:00:00 2001 From: "bsmedberg%covad.net" Date: Tue, 8 Nov 2005 14:16:16 +0000 Subject: [PATCH] Bug 315438 - Want nsTAString const char_type* BeginWriting() const; signature r=darin git-svn-id: svn://10.0.0.236/trunk@184295 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/string/public/nsTAString.h | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/mozilla/xpcom/string/public/nsTAString.h b/mozilla/xpcom/string/public/nsTAString.h index 5648840ea06..d60fad8a874 100644 --- a/mozilla/xpcom/string/public/nsTAString.h +++ b/mozilla/xpcom/string/public/nsTAString.h @@ -156,6 +156,20 @@ class nsTAString_CharT return iter; } + inline const char_type* BeginReading() const + { + const char_type *b; + GetReadableBuffer(&b); + return b; + } + + inline const char_type* EndReading() const + { + const char_type *b; + size_type len = GetReadableBuffer(&b); + return b + len; + } + /** * BeginWriting/EndWriting can be used to get mutable access to the @@ -180,6 +194,19 @@ class nsTAString_CharT return iter; } + inline char_type* BeginWriting() + { + char_type *b; + GetWritableBuffer(&b); + return b; + } + + inline char_type* EndWriting() + { + char_type *b; + size_type len = GetWritableBuffer(&b); + return b + len; + } /** * Length checking functions. IsEmpty is a helper function to avoid