add new accessor for message member

This commit is contained in:
alecf%netscape.com 1999-02-04 04:26:29 +00:00
Родитель 604be293c2
Коммит 081346c526
2 изменённых файлов: 30 добавлений и 5 удалений

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

@ -51,6 +51,7 @@ nsNntpUrl::nsNntpUrl(nsISupports* aContainer, nsIURLGroup* aGroup)
// nsINetLibUrl specific state
m_URL_s = nsnull;
m_messageToPost = nsnull;
// nsIURL specific state
m_protocol = nsnull;
@ -74,6 +75,7 @@ nsNntpUrl::~nsNntpUrl()
NS_IF_RELEASE(m_newsgroup);
NS_IF_RELEASE(m_offlineNews);
NS_IF_RELEASE(m_newsgroupList);
PR_FREEIF(m_messageToPost);
PR_FREEIF(m_errorMessage);
PR_FREEIF(m_spec);
@ -898,6 +900,25 @@ nsresult nsNntpUrl::ToString(PRUnichar* *aString) const
return NS_OK;
}
nsresult nsNntpUrl::SetMessageToPost(char *aString)
{
NS_LOCK_INSTANCE();
PR_FREEIF(m_messageToPost);
m_messageToPost = PL_strdup(aString);
NS_UNLOCK_INSTANCE();
return NS_OK;
}
nsresult nsNntpUrl::GetMessageToPost(char **aString)
{
NS_LOCK_INSTANCE();
char *result;
if (!aString) return NS_ERROR_NULL_POINTER;
*aString = PL_strdup(m_messageToPost);
NS_UNLOCK_INSTANCE();
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////////
// End of functions which should be made obsolete after modifying nsIURL
////////////////////////////////////////////////////////////////////////////////////

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

@ -81,6 +81,8 @@ public:
// caller must free using PR_FREE
NS_IMETHOD GetErrorMessage (char ** errorMessage) const;
NS_IMETHOD SetMessageToPost(char *messageToPost);
NS_IMETHOD GetMessageToPost(char **messageToPost);
// nsNntpUrl
nsNntpUrl(nsISupports* aContainer, nsIURLGroup* aGroup);
@ -103,7 +105,9 @@ protected:
char *m_ref;
char *m_search;
char *m_errorMessage;
char *m_messageToPost; // temp char buffer of message to post
// (eventually probably a message
// instance of some kind)
PRInt32 m_port;
nsISupports* m_container;