mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 13:45:46 +00:00
Bug 956646 - Add renameTo to nsIFile interface. r=bsmedberg
This commit is contained in:
parent
1450a0f93a
commit
41a99188eb
@ -557,6 +557,12 @@ RemoteOpenFileChild::MoveToNative(nsIFile *newParent, const nsACString &newName)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
RemoteOpenFileChild::RenameTo(nsIFile *newParentDir, const nsAString &newName)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
RemoteOpenFileChild::Remove(bool recursive)
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ interface nsISimpleEnumerator;
|
||||
* be safely passed to javascript via xpconnect. Therefore, the "native
|
||||
* methods" are not scriptable.
|
||||
*/
|
||||
[scriptable, uuid(272a5020-64f5-485c-a8c4-44b2882ae0a2), builtinclass]
|
||||
[scriptable, uuid(a99a6a06-f90d-4659-8fce-c2f87feb1167), builtinclass]
|
||||
interface nsIFile : nsISupports
|
||||
{
|
||||
/**
|
||||
@ -180,6 +180,16 @@ interface nsIFile : nsISupports
|
||||
void moveTo(in nsIFile newParentDir, in AString newName);
|
||||
[noscript] void moveToNative(in nsIFile newParentDir, in ACString newName);
|
||||
|
||||
/**
|
||||
* renameTo
|
||||
*
|
||||
* This method is identical to moveTo except that if this file or directory
|
||||
* is moved to a a different volume, it fails and returns an error
|
||||
* (NS_ERROR_FILE_ACCESS_DENIED).
|
||||
* This object will still point to the old location after renaming.
|
||||
*/
|
||||
void renameTo(in nsIFile newParentDir, in AString newName);
|
||||
|
||||
/**
|
||||
* This will try to delete this file. The 'recursive' flag
|
||||
* must be PR_TRUE to delete directories which are not empty.
|
||||
|
@ -2000,6 +2000,13 @@ nsLocalFile::MoveTo(nsIFile *newParentDir, const nsAString &newName)
|
||||
{
|
||||
SET_UCS_2ARGS_2(MoveToNative, newParentDir, newName);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocalFile::RenameTo(nsIFile *newParentDir, const nsAString &newName)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsLocalFile::GetTarget(nsAString &_retval)
|
||||
{
|
||||
|
@ -2150,6 +2150,11 @@ nsLocalFile::MoveTo(nsIFile *newParentDir, const nsAString &newName)
|
||||
return CopyMove(newParentDir, newName, false, true);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocalFile::RenameTo(nsIFile *newParentDir, const nsAString & newName)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocalFile::Load(PRLibrary * *_retval)
|
||||
|
Loading…
x
Reference in New Issue
Block a user