mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-05 16:22:53 +00:00
Changed to reference parameters (to avoid copying of objects onto the stack)
This commit is contained in:
parent
dbb4e2b201
commit
b080114c02
@ -1,6 +1,5 @@
|
||||
nsEscape.h
|
||||
nsFileSpec.h
|
||||
nsFileSpecImpl.h
|
||||
nsFileSpecStreaming.h
|
||||
nsFileStream.h
|
||||
nsIByteBufferInputStream.h
|
||||
|
@ -55,7 +55,6 @@ CPPSRCS = \
|
||||
EXPORTS = \
|
||||
nsEscape.h \
|
||||
nsFileSpec.h \
|
||||
nsFileSpecImpl.h \
|
||||
nsFileSpecStreaming.h \
|
||||
nsFileStream.h \
|
||||
nsIFileStream.h \
|
||||
|
@ -26,7 +26,6 @@ MODULE = xpcom
|
||||
EXPORTS = \
|
||||
nsEscape.h \
|
||||
nsFileSpec.h \
|
||||
nsFileSpecImpl.h \
|
||||
nsFileSpecStreaming.h \
|
||||
nsFileStream.h \
|
||||
nsIFileStream.h \
|
||||
|
@ -475,6 +475,14 @@ NS_IMETHODIMP nsFileSpecImpl::GetFileSpec(nsFileSpec *aFileSpec)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsFileSpecImpl::setFromFileSpec(const nsFileSpec& aFileSpec)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
mFileSpec = aFileSpec;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsFileSpecImpl::eof(PRBool *_retval)
|
||||
//----------------------------------------------------------------------------------------
|
||||
@ -686,7 +694,7 @@ NS_METHOD nsFileSpecImpl::Create(nsISupports* outer, const nsIID& aIID, void* *a
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsresult NS_NewFileSpecWithSpec(nsFileSpec aSrcFileSpec, nsIFileSpec **result)
|
||||
nsresult NS_NewFileSpecWithSpec(const nsFileSpec& aSrcFileSpec, nsIFileSpec **result)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!result)
|
||||
|
@ -135,6 +135,7 @@ class NS_COM nsFileSpecImpl
|
||||
NS_IMETHOD SetFileContents(char*);
|
||||
|
||||
NS_IMETHOD GetFileSpec(nsFileSpec *aFileSpec);
|
||||
NS_IMETHOD setFromFileSpec(const nsFileSpec& aFileSpec);
|
||||
|
||||
/* boolean eof (); */
|
||||
NS_IMETHOD eof(PRBool *_retval);
|
||||
|
@ -42,7 +42,8 @@ interface nsIInputStream;
|
||||
|
||||
%}
|
||||
|
||||
native nsFileSpec(nsFileSpec);
|
||||
native nsFileSpec(nsFileSpec);
|
||||
[ref] native nsFileSpecRef(nsFileSpec);
|
||||
|
||||
[scriptable, uuid(d8c0a080-0868-11d3-915f-d9d889d48e3c)]
|
||||
interface nsIFileSpec : nsISupports
|
||||
@ -67,6 +68,7 @@ interface nsIFileSpec : nsISupports
|
||||
readonly attribute nsIInputStream InputStream;
|
||||
readonly attribute nsIOutputStream OutputStream;
|
||||
[nonscriptable] readonly attribute nsFileSpec FileSpec;
|
||||
[nonscriptable] void setFromFileSpec([const] in nsFileSpecRef spec);
|
||||
|
||||
attribute string FileContents;
|
||||
|
||||
@ -135,7 +137,7 @@ interface nsIDirectoryIterator : nsISupports
|
||||
|
||||
%{C++
|
||||
// Factory methods if you link with xpcom
|
||||
NS_COM nsresult NS_NewFileSpecWithSpec(nsFileSpec aSrcFileSpec, nsIFileSpec **result);
|
||||
NS_COM nsresult NS_NewFileSpecWithSpec(const nsFileSpec& aSrcFileSpec, nsIFileSpec **result);
|
||||
NS_COM nsresult NS_NewFileSpec(nsIFileSpec** result);
|
||||
NS_COM nsresult NS_NewDirectoryIterator(nsIDirectoryIterator** result);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user