Convert users of nsAReadable[C]String and nsAWritable[C]String typedefs to [const] nsA[C]String. b=131899 r=scc sr=jag a=asa

This commit is contained in:
dbaron%fas.harvard.edu 2002-03-23 21:03:32 +00:00
Родитель 5024940d53
Коммит b95312c405
18 изменённых файлов: 56 добавлений и 57 удалений

Просмотреть файл

@ -59,7 +59,7 @@ NS_IMPL_ISUPPORTS1(inBitmapDepot, inIBitmapDepot);
// inIBitmapDepot
NS_IMETHODIMP
inBitmapDepot::Put(inIBitmap* aBitmap, const nsAReadableString& aName)
inBitmapDepot::Put(inIBitmap* aBitmap, const nsAString& aName)
{
nsStringKey key(aName);
nsCOMPtr<inIBitmap> bitmap(aBitmap);
@ -70,7 +70,7 @@ inBitmapDepot::Put(inIBitmap* aBitmap, const nsAReadableString& aName)
}
NS_IMETHODIMP
inBitmapDepot::Get(const nsAReadableString& aName, inIBitmap** _retval)
inBitmapDepot::Get(const nsAString& aName, inIBitmap** _retval)
{
nsStringKey key(aName);
nsCOMPtr<nsISupports> supports = mHash.Get(&key);
@ -82,7 +82,7 @@ inBitmapDepot::Get(const nsAReadableString& aName, inIBitmap** _retval)
}
NS_IMETHODIMP
inBitmapDepot::Remove(const nsAReadableString& aName, inIBitmap** _retval)
inBitmapDepot::Remove(const nsAString& aName, inIBitmap** _retval)
{
nsStringKey key(aName);
nsCOMPtr<nsISupports> supports;

Просмотреть файл

@ -501,7 +501,7 @@ nsresult nsAutoConfig::writeFailoverFile()
return rv;
}
nsresult nsAutoConfig::getEmailAddr(nsAWritableCString & emailAddr)
nsresult nsAutoConfig::getEmailAddr(nsACString & emailAddr)
{
nsresult rv;

Просмотреть файл

@ -71,7 +71,7 @@ class nsAutoConfig : public nsIAutoConfig,
nsresult readOfflineFile();
nsresult evaluateLocalFile(nsIFile *file);
nsresult writeFailoverFile();
nsresult getEmailAddr(nsAWritableCString & emailAddr);
nsresult getEmailAddr(nsACString & emailAddr);
nsCString mBuf, mCurrProfile;
nsCOMPtr<nsIPrefBranch> mPrefBranch;
PRBool mLoaded;

Просмотреть файл

@ -29,22 +29,21 @@
#include "PyXPCOM_std.h"
#include <nsIInterfaceInfoManager.h>
#include <nsAReadableString.h>
#include <nsAWritableString.h>
#include <nsAString.h>
#include <nsString.h>
#include <nsReadableUtils.h>
// one day we may know what they look like.
inline
PRBool
IsNullDOMString( const nsAReadableString& aString )
IsNullDOMString( const nsAString& aString )
{
return PR_FALSE;
}
inline
PRBool
IsNULLDOMString( const nsAReadableCString& aString )
IsNULLDOMString( const nsACString& aString )
{
return PR_FALSE;
}
@ -522,7 +521,7 @@ PyXPCOM_InterfaceVariantHelper::~PyXPCOM_InterfaceVariantHelper()
if (ns_v.IsValDOMString() && ns_v.val.p) {
PythonTypeDescriptor &ptd = m_python_type_desc_array[i];
if (XPT_PD_IS_OUT(ptd.param_flags) || XPT_PD_IS_DIPPER(ptd.param_flags))
delete (nsAReadableString *)ns_v.val.p;
delete (const nsAString *)ns_v.val.p;
}
if (ns_v.IsValArray()) {
nsXPTCVariant &ns_v = m_var_array[i];
@ -1132,7 +1131,7 @@ PyObject *PyXPCOM_InterfaceVariantHelper::MakeSinglePythonResult(int index)
ret = Py_nsIID::PyObjectFromIID( **((nsIID **)ns_v.ptr) );
break;
case nsXPTType::T_DOMSTRING: {
nsAWritableString *rs = (nsAWritableString *)ns_v.ptr;
nsAString *rs = (nsAString *)ns_v.ptr;
if (rs == NULL || IsNullDOMString(*rs)) {
ret = Py_None;
Py_INCREF(Py_None);
@ -1484,7 +1483,7 @@ PyObject *PyXPCOM_GatewayVariantHelper::MakeSingleParam(int index, PythonTypeDes
}
case nsXPTType::T_DOMSTRING: {
NS_ABORT_IF_FALSE(is_out || !XPT_PD_IS_DIPPER(td.param_flags), "DOMStrings can't be inout");
nsAReadableString *rs = (nsAReadableString *)ns_v.val.p;
const nsAString *rs = (const nsAString *)ns_v.val.p;
if (rs==NULL || IsNullDOMString(*rs)) {
ret = Py_None;
Py_INCREF(Py_None);
@ -1745,7 +1744,7 @@ nsresult PyXPCOM_GatewayVariantHelper::BackFillVariant( PyObject *val, int index
}
case nsXPTType::T_DOMSTRING: {
nsAWritableString *ws = (nsAWritableString *)ns_v.val.p;
nsAString *ws = (nsAString *)ns_v.val.p;
NS_ABORT_IF_FALSE(ws->Length() == 0, "Why does this writable string already have chars??");
if (val == Py_None) {
(*ws) = (PRUnichar *)nsnull;

Просмотреть файл

@ -64,7 +64,7 @@ nsXPathEvaluator::~nsXPathEvaluator()
}
NS_IMETHODIMP
nsXPathEvaluator::CreateExpression(const nsAReadableString & aExpression,
nsXPathEvaluator::CreateExpression(const nsAString & aExpression,
nsIDOMXPathNSResolver *aResolver,
nsIDOMXPathExpression **aResult)
{

Просмотреть файл

@ -565,7 +565,7 @@ void txMozillaXMLOutput::endHTMLElement(nsIDOMElement* aElement,
}
}
void txMozillaXMLOutput::processHTTPEquiv(nsIAtom* aHeader, nsAReadableString& aValue)
void txMozillaXMLOutput::processHTTPEquiv(nsIAtom* aHeader, const nsAString& aValue)
{
// For now we only handle "refresh". There's a longer list in
// HTMLContentSink::ProcessHeaderData

Просмотреть файл

@ -45,7 +45,7 @@
#include "nsIDOMHTMLTextAreaElement.h"
#include "nsINameSpaceManager.h"
#include "nsIStyleSheetLinkingElement.h"
#include "nsString2.h"
#include "nsString.h"
#include "nsSupportsArray.h"
#include "txOutputFormat.h"
@ -162,7 +162,7 @@ private:
void closePrevious(PRInt8 aAction);
void startHTMLElement(nsIDOMElement* aElement);
void endHTMLElement(nsIDOMElement* aElement, PRBool aXHTML);
void processHTTPEquiv(nsIAtom* aHeader, nsAReadableString& aValue);
void processHTTPEquiv(nsIAtom* aHeader, const nsAString& aValue);
void wrapChildren(nsIDOMNode* aCurrentNode, nsIDOMElement* aWrapper);
nsCOMPtr<nsIDOMDocument> mDocument;

Просмотреть файл

@ -2529,7 +2529,7 @@ SI_InSequence(const nsString& sequence, PRInt32 number)
}
PUBLIC void
SI_FindValueInArgs(const nsAReadableString& results, const nsAReadableString& name, nsAWritableString& value)
SI_FindValueInArgs(const nsAString& results, const nsAString& name, nsAString& value)
{
/* note: name must start and end with a vertical bar */
nsReadingIterator<PRUnichar> start, end, barPos;

Просмотреть файл

@ -141,7 +141,7 @@ extern PRBool
SI_InSequence(const nsString& sequence, int number);
extern void
SI_FindValueInArgs(const nsAReadableString& results, const nsAReadableString& name, nsAWritableString& value);
SI_FindValueInArgs(const nsAString& results, const nsAString& name, nsAString& value);
extern void
SI_DeleteAll();

Просмотреть файл

@ -432,9 +432,9 @@ nsAbLDAPAutoCompFormatter::GetAttributes(PRUint32 *aCount, char ** *aAttrs)
// generate an nsIAutoCompleteItem from this.
//
nsresult
nsAbLDAPAutoCompFormatter::ProcessFormat(const nsAReadableString & aFormat,
nsAbLDAPAutoCompFormatter::ProcessFormat(const nsAString & aFormat,
nsILDAPMessage *aMessage,
nsAWritableCString *aValue,
nsACString *aValue,
nsCStringArray *aAttrs)
{
nsresult rv; // temp for return values
@ -570,7 +570,7 @@ nsAbLDAPAutoCompFormatter::ParseAttrName(
nsReadingIterator<PRUnichar> &aIterEnd,
PRBool aAttrRequired, // required? or just optional?
nsCOMPtr<nsIConsoleService> &aConsoleSvc, // no need to reacquire this
nsAWritableCString &aAttrName) // attribute token
nsACString &aAttrName) // attribute token
{
// reset attrname, and move past the opening brace
//
@ -620,10 +620,10 @@ nsAbLDAPAutoCompFormatter::ParseAttrName(
nsresult
nsAbLDAPAutoCompFormatter::AppendFirstAttrValue(
nsAReadableCString &aAttrName, // attr to get
const nsACString &aAttrName, // attr to get
nsILDAPMessage *aMessage, // msg to get values from
PRBool aAttrRequired, // is this a required value?
nsAWritableCString &aValue)
nsACString &aValue)
{
// get the attribute values for the field which will be used
// to fill in nsIAutoCompleteItem::value
@ -683,13 +683,13 @@ nsAbLDAPAutoCompFormatter::AppendFirstAttrValue(
// attribute AString nameFormat;
NS_IMETHODIMP
nsAbLDAPAutoCompFormatter::GetNameFormat(nsAWritableString & aNameFormat)
nsAbLDAPAutoCompFormatter::GetNameFormat(nsAString & aNameFormat)
{
aNameFormat = mNameFormat;
return NS_OK;
}
NS_IMETHODIMP
nsAbLDAPAutoCompFormatter::SetNameFormat(const nsAReadableString & aNameFormat)
nsAbLDAPAutoCompFormatter::SetNameFormat(const nsAString & aNameFormat)
{
mNameFormat = aNameFormat;
return NS_OK;
@ -697,13 +697,13 @@ nsAbLDAPAutoCompFormatter::SetNameFormat(const nsAReadableString & aNameFormat)
// attribute AString addressFormat;
NS_IMETHODIMP
nsAbLDAPAutoCompFormatter::GetAddressFormat(nsAWritableString & aAddressFormat)
nsAbLDAPAutoCompFormatter::GetAddressFormat(nsAString & aAddressFormat)
{
aAddressFormat = mAddressFormat;
return NS_OK;
}
NS_IMETHODIMP
nsAbLDAPAutoCompFormatter::SetAddressFormat(const nsAReadableString &
nsAbLDAPAutoCompFormatter::SetAddressFormat(const nsAString &
aAddressFormat)
{
mAddressFormat = aAddressFormat;
@ -712,13 +712,13 @@ nsAbLDAPAutoCompFormatter::SetAddressFormat(const nsAReadableString &
// attribute AString commentFormat;
NS_IMETHODIMP
nsAbLDAPAutoCompFormatter::GetCommentFormat(nsAWritableString & aCommentFormat)
nsAbLDAPAutoCompFormatter::GetCommentFormat(nsAString & aCommentFormat)
{
aCommentFormat = mCommentFormat;
return NS_OK;
}
NS_IMETHODIMP
nsAbLDAPAutoCompFormatter::SetCommentFormat(const nsAReadableString &
nsAbLDAPAutoCompFormatter::SetCommentFormat(const nsAString &
aCommentFormat)
{
mCommentFormat = aCommentFormat;

Просмотреть файл

@ -43,9 +43,9 @@ class nsAbLDAPAutoCompFormatter : public nsIAbLDAPAutoCompFormatter
nsString mCommentFormat;
// parse and process format
nsresult ProcessFormat(const nsAReadableString & aFormat,
nsresult ProcessFormat(const nsAString & aFormat,
nsILDAPMessage *aMessage,
nsAWritableCString *aValue,
nsACString *aValue,
nsCStringArray *aAttrs);
// process a single attribute while parsing format
@ -53,12 +53,12 @@ class nsAbLDAPAutoCompFormatter : public nsIAbLDAPAutoCompFormatter
nsReadingIterator<PRUnichar> & aIterEnd,
PRBool aAttrRequired,
nsCOMPtr<nsIConsoleService> & aConsoleSvc,
nsAWritableCString & aAttrName);
nsACString & aAttrName);
// append the first value associated with aAttrName in aMessage to aValue
nsresult AppendFirstAttrValue(nsAReadableCString &aAttrName,
nsresult AppendFirstAttrValue(const nsACString &aAttrName,
nsILDAPMessage *aMessage,
PRBool aAttrRequired,
nsAWritableCString &aValue);
nsACString &aValue);
};

Просмотреть файл

@ -1029,13 +1029,13 @@ NS_IMETHODIMP nsAbView::SelectAll()
return NS_OK;
}
NS_IMETHODIMP nsAbView::GetSortDirection(nsAWritableString & aDirection)
NS_IMETHODIMP nsAbView::GetSortDirection(nsAString & aDirection)
{
aDirection = mSortDirection;
return NS_OK;
}
NS_IMETHODIMP nsAbView::GetSortColumn(nsAWritableString & aColumn)
NS_IMETHODIMP nsAbView::GetSortColumn(nsAString & aColumn)
{
aColumn = mSortColumn;
return NS_OK;

Просмотреть файл

@ -78,7 +78,7 @@ public:
// Decode routine (also converts output to unicode)
// On success, decodedString is never null
NS_IMETHOD DecodeMimeHeader(const char *header,
nsAWritableString& decodedString,
nsAString& decodedString,
const char *default_charset = nsnull,
PRBool override_charset = PR_FALSE,
PRBool eatContinuations = PR_TRUE) = 0;

Просмотреть файл

@ -111,7 +111,7 @@ nsMimeConverter::DecodeMimeHeader(const char *header,
// Decode routine (also converts output to unicode)
nsresult
nsMimeConverter::DecodeMimeHeader(const char *header,
nsAWritableString& decodedString,
nsAString& decodedString,
const char *default_charset,
PRBool override_charset,
PRBool eatContinuations)

Просмотреть файл

@ -71,7 +71,7 @@ public:
// Decode routine (also converts output to unicode)
// On success, decodedString is never null
NS_IMETHOD DecodeMimeHeader(const char *header,
nsAWritableString& decodedString,
nsAString& decodedString,
const char *default_charset = nsnull,
PRBool override_charset = PR_FALSE,
PRBool eatContinuations = PR_TRUE);

Просмотреть файл

@ -412,7 +412,7 @@ ns_can_escrow(nsKeyGenType keyGenType)
//Retrieve crypto.version so that callers know what
//version of PSM this is.
NS_IMETHODIMP
nsCrypto::GetVersion(nsAWritableString& aVersion)
nsCrypto::GetVersion(nsAString& aVersion)
{
aVersion.Assign(NS_LITERAL_STRING(PSM_VERSION_STRING).get());
return NS_OK;
@ -1827,10 +1827,10 @@ nsCertListCount(CERTCertList *certList)
//Import user certificates that arrive as a CMMF base64 encoded
//string.
NS_IMETHODIMP
nsCrypto::ImportUserCertificates(const nsAReadableString& aNickname,
const nsAReadableString& aCmmfResponse,
nsCrypto::ImportUserCertificates(const nsAString& aNickname,
const nsAString& aCmmfResponse,
PRBool aDoForcedBackup,
nsAWritableString& aReturn)
nsAString& aReturn)
{
char *nickname=nsnull, *cmmfResponse=nsnull;
char *retString=nsnull;
@ -2041,20 +2041,20 @@ nsCrypto::ImportUserCertificates(const nsAReadableString& aNickname,
}
NS_IMETHODIMP
nsCrypto::PopChallengeResponse(const nsAReadableString& aChallenge,
nsAWritableString& aReturn)
nsCrypto::PopChallengeResponse(const nsAString& aChallenge,
nsAString& aReturn)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsCrypto::Random(PRInt32 aNumBytes, nsAWritableString& aReturn)
nsCrypto::Random(PRInt32 aNumBytes, nsAString& aReturn)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsCrypto::SignText(nsAWritableString& aReturn)
nsCrypto::SignText(nsAString& aReturn)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
@ -2062,7 +2062,7 @@ nsCrypto::SignText(nsAWritableString& aReturn)
NS_IMETHODIMP
nsCrypto::Alert(const nsAReadableString& aMessage)
nsCrypto::Alert(const nsAString& aMessage)
{
PRUnichar *message = ToNewUnicode(aMessage);
alertUser(message);
@ -2102,7 +2102,7 @@ nsCRMFObject::init()
}
NS_IMETHODIMP
nsCRMFObject::GetRequest(nsAWritableString& aRequest)
nsCRMFObject::GetRequest(nsAString& aRequest)
{
aRequest.Assign(mBase64Request);
return NS_OK;
@ -2143,7 +2143,7 @@ confirm_user(const PRUnichar *message)
//Delete a PKCS11 module from the user's profile.
NS_IMETHODIMP
nsPkcs11::Deletemodule(const nsAReadableString& aModuleName, PRInt32* aReturn)
nsPkcs11::Deletemodule(const nsAString& aModuleName, PRInt32* aReturn)
{
nsresult rv;
nsString errorMessage;
@ -2198,8 +2198,8 @@ nsPkcs11::Deletemodule(const nsAReadableString& aModuleName, PRInt32* aReturn)
//Add a new PKCS11 module to the user's profile.
NS_IMETHODIMP
nsPkcs11::Addmodule(const nsAReadableString& aModuleName,
const nsAReadableString& aLibraryFullPath,
nsPkcs11::Addmodule(const nsAString& aModuleName,
const nsAString& aLibraryFullPath,
PRInt32 aCryptoMechanismFlags,
PRInt32 aCipherFlags, PRInt32* aReturn)
{

Просмотреть файл

@ -261,7 +261,7 @@ nsInstallProgressDialog::GetCancelStatus(PRBool *_retval)
// Utility to set element attribute.
nsresult nsInstallProgressDialog::setDlgAttribute( const char *id,
const char *name,
const nsAReadableString &value )
const nsAString &value )
{
nsresult rv = NS_OK;
@ -299,7 +299,7 @@ nsresult nsInstallProgressDialog::setDlgAttribute( const char *id,
// Utility to get element attribute.
nsresult nsInstallProgressDialog::getDlgAttribute( const char *id,
const char *name,
nsAWritableString &value )
nsAString &value )
{
nsresult rv = NS_OK;

Просмотреть файл

@ -59,8 +59,8 @@ class nsInstallProgressDialog : public nsIXPIListener,
// void SetWindow(nsISupports* aWindow);
protected:
nsresult setDlgAttribute(const char *id, const char *name, const nsAReadableString &value);
nsresult getDlgAttribute(const char *id, const char *name, nsAWritableString &value);
nsresult setDlgAttribute(const char *id, const char *name, const nsAString &value);
nsresult getDlgAttribute(const char *id, const char *name, nsAString &value);
private:
nsPIXPIManagerCallbacks* mManager;