From 3ec01ebea0124f6da1d8295402a7404d25a16f05 Mon Sep 17 00:00:00 2001 From: "scc%mozilla.org" Date: Wed, 23 May 2001 03:29:48 +0000 Subject: [PATCH] bug #78398: sr=waterson, adding a new abstract type (this here's the new file it comes in) |nsAC?StringGenerator| git-svn-id: svn://10.0.0.236/trunk@95782 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/string/public/nsAStringGenerator.h | 60 +++++++++++++++++++ .../xpcom/string/public/nsAStringGenerator.h | 60 +++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 mozilla/string/public/nsAStringGenerator.h create mode 100644 mozilla/xpcom/string/public/nsAStringGenerator.h diff --git a/mozilla/string/public/nsAStringGenerator.h b/mozilla/string/public/nsAStringGenerator.h new file mode 100644 index 00000000000..4e432707a8e --- /dev/null +++ b/mozilla/string/public/nsAStringGenerator.h @@ -0,0 +1,60 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla. + * + * The Initial Developer of the Original Code is Netscape + * Communications. Portions created by Netscape Communications are + * Copyright (C) 2001 by Netscape Communications. All + * Rights Reserved. + * + * Contributor(s): + * Scott Collins (original author) + */ + +/* nsAStringGenerator.h --- generators produce strings into a callers buffer, avoiding temporaries */ + +#ifndef nsAStringGenerator_h___ +#define nsAStringGenerator_h___ + +#include "nscore.h" + // for |PRUnichar| + +#include "prtypes.h" + // for |PRBool|, |PRUint32| + + +class nsAString; +class nsACString; + +class nsAStringGenerator + { + public: + virtual ~nsAStringGenerator() { } + + virtual PRUnichar* operator()( PRUnichar* aDestBuffer ) const = 0; + virtual PRUint32 Length() const = 0; + virtual PRUint32 MaxLength() const = 0; + virtual PRBool IsDependentOn( const nsAString& ) const = 0; + }; + +class nsACStringGenerator + { + public: + virtual ~nsACStringGenerator() { } + + virtual PRUnichar* operator()( char* aDestBuffer ) const = 0; + virtual PRUint32 Length() const = 0; + virtual PRUint32 MaxLength() const = 0; + virtual PRBool IsDependentOn( const nsACString& ) const = 0; + }; + +#endif // !defined(nsAStringGenerator_h___) diff --git a/mozilla/xpcom/string/public/nsAStringGenerator.h b/mozilla/xpcom/string/public/nsAStringGenerator.h new file mode 100644 index 00000000000..4e432707a8e --- /dev/null +++ b/mozilla/xpcom/string/public/nsAStringGenerator.h @@ -0,0 +1,60 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla. + * + * The Initial Developer of the Original Code is Netscape + * Communications. Portions created by Netscape Communications are + * Copyright (C) 2001 by Netscape Communications. All + * Rights Reserved. + * + * Contributor(s): + * Scott Collins (original author) + */ + +/* nsAStringGenerator.h --- generators produce strings into a callers buffer, avoiding temporaries */ + +#ifndef nsAStringGenerator_h___ +#define nsAStringGenerator_h___ + +#include "nscore.h" + // for |PRUnichar| + +#include "prtypes.h" + // for |PRBool|, |PRUint32| + + +class nsAString; +class nsACString; + +class nsAStringGenerator + { + public: + virtual ~nsAStringGenerator() { } + + virtual PRUnichar* operator()( PRUnichar* aDestBuffer ) const = 0; + virtual PRUint32 Length() const = 0; + virtual PRUint32 MaxLength() const = 0; + virtual PRBool IsDependentOn( const nsAString& ) const = 0; + }; + +class nsACStringGenerator + { + public: + virtual ~nsACStringGenerator() { } + + virtual PRUnichar* operator()( char* aDestBuffer ) const = 0; + virtual PRUint32 Length() const = 0; + virtual PRUint32 MaxLength() const = 0; + virtual PRBool IsDependentOn( const nsACString& ) const = 0; + }; + +#endif // !defined(nsAStringGenerator_h___)