зеркало из https://github.com/mozilla/pjs.git
123 строки
3.3 KiB
Plaintext
123 строки
3.3 KiB
Plaintext
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
*
|
|
* The contents of this file are subject to the Netscape Public License
|
|
* Version 1.0 (the "NPL"); you may not use this file except in
|
|
* compliance with the NPL. You may obtain a copy of the NPL at
|
|
* http://www.mozilla.org/NPL/
|
|
*
|
|
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
|
* for the specific language governing rights and limitations under the
|
|
* NPL.
|
|
*
|
|
* The Initial Developer of this code under the NPL is Netscape
|
|
* Communications Corporation. Portions created by Netscape are
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
|
* Reserved.
|
|
*/
|
|
|
|
#include "nsIChannel.idl"
|
|
|
|
interface nsISimpleEnumerator;
|
|
|
|
[scriptable, uuid(73025830-0ce2-11d3-9331-00104ba0fd40)]
|
|
interface nsIFileChannel : nsIChannel
|
|
{
|
|
/**
|
|
* Returns the creation date of the URL.
|
|
*/
|
|
readonly attribute PRTime CreationDate;
|
|
|
|
/**
|
|
* Returns the last modification date of the URL.
|
|
*/
|
|
readonly attribute PRTime ModDate;
|
|
|
|
/**
|
|
* Returns the size of the file referred to by the URL.
|
|
* @return NS_ERROR_FAILURE if the URL refers to a directory.
|
|
*/
|
|
readonly attribute unsigned long FileSize;
|
|
|
|
/**
|
|
* Returns the parent directory of a URL.
|
|
*/
|
|
readonly attribute nsIFileChannel Parent;
|
|
|
|
/**
|
|
* Returns an enumeration of the elements in a directory. Each
|
|
* element in the enumeration is an nsIFileChannel.
|
|
* @return NS_ERROR_FAILURE if the current nsIFileChannel does
|
|
* not specify a directory.
|
|
*/
|
|
readonly attribute nsISimpleEnumerator Children;
|
|
|
|
/**
|
|
* Returns a native path string suitable to be passes to native platform
|
|
* routines.
|
|
*/
|
|
readonly attribute string NativePath;
|
|
|
|
/**
|
|
* Returns true if the file exists.
|
|
*/
|
|
boolean Exists();
|
|
|
|
/**
|
|
* Creates an empty file if the file does not exist.
|
|
*/
|
|
void Create();
|
|
|
|
/**
|
|
* Returns true if the file exists.
|
|
*/
|
|
void Delete();
|
|
|
|
/**
|
|
* Move or rename a file.
|
|
*/
|
|
void MoveFrom(in nsIURI src);
|
|
|
|
/**
|
|
* Copies the contents of a file to a new destination. Creates the
|
|
* destination file if it doesn't already exist, otherwise overwrites
|
|
* it.
|
|
*/
|
|
void CopyFrom(in nsIURI src);
|
|
|
|
/**
|
|
* Returns true if the file URL specifies a directory. Note that this
|
|
* may be the case even if the file URL does not terminate with a slash.
|
|
*/
|
|
boolean IsDirectory();
|
|
|
|
/**
|
|
* Returns true if the file URL specifies a file and not a directory.
|
|
*/
|
|
boolean IsFile();
|
|
|
|
/**
|
|
* Returns true if the specified file is a symbolic link (on unix),
|
|
* alias (on Mac) or shortcut (on Windows).
|
|
*/
|
|
boolean IsLink();
|
|
|
|
/**
|
|
* Returns a file URL to the destination of a link (alias or shortcut).
|
|
*/
|
|
nsIFileChannel ResolveLink();
|
|
|
|
/**
|
|
* Returns a unique file name for the directory of the current URL.
|
|
*/
|
|
string MakeUniqueFileName(in string baseName);
|
|
|
|
/**
|
|
* Executes a program specified by the file channel.
|
|
* @param args - The program arguments to run with. If not specified,
|
|
* the Query portion of the URI is used as the argument string.
|
|
*/
|
|
void Execute(in string args);
|
|
};
|
|
|