📄 nsifile.h
字号:
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM nsIFile.idl */#ifndef __gen_nsIFile_h__#define __gen_nsIFile_h__#ifndef __gen_nsISupports_h__#include "nsISupports.h"#endif/* For IDL files that don't want to include root IDL files. */#ifndef NS_NO_VTABLE#define NS_NO_VTABLE#endifclass nsISimpleEnumerator; /* forward declaration *//* starting interface: nsIFile */#define NS_IFILE_IID_STR "c8c0a080-0868-11d3-915f-d9d889d48e3c"#define NS_IFILE_IID \ {0xc8c0a080, 0x0868, 0x11d3, \ { 0x91, 0x5f, 0xd9, 0xd8, 0x89, 0xd4, 0x8e, 0x3c }}/** * This is the only correct cross-platform way to specify a file. * Strings are not such a way. If you grew up on windows or unix, you * may think they are. Welcome to reality. * * All methods with string parameters have two forms. The preferred * form operates on UCS-2 encoded characters strings. An alternate * form operates on characters strings encoded in the "native" charset. * * A string containing characters encoded in the native charset cannot * be safely passed to javascript via xpconnect. Therefore, the "native * methods" are not scriptable. * * @status FROZEN */class NS_NO_VTABLE nsIFile : public nsISupports { public: NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFILE_IID) /** * Create Types * * NORMAL_FILE_TYPE - A normal file. * DIRECTORY_TYPE - A directory/folder. */ enum { NORMAL_FILE_TYPE = 0U }; enum { DIRECTORY_TYPE = 1U }; /** * append[Native] * * This function is used for constructing a descendent of the * current nsIFile. * * @param node * A string which is intended to be a child node of the nsIFile. * For the |appendNative| method, the node must be in the native * filesystem charset. */ /* void append (in AString node); */ NS_IMETHOD Append(const nsAString & node) = 0; /* [noscript] void appendNative (in ACString node); */ NS_IMETHOD AppendNative(const nsACString & node) = 0; /** * Normalize the pathName (e.g. removing .. and . components on Unix). */ /* void normalize (); */ NS_IMETHOD Normalize(void) = 0; /** * create * * This function will create a new file or directory in the * file system. Any nodes that have not been created or * resolved, will be. If the file or directory already * exists create() will return NS_ERROR_FILE_ALREADY_EXISTS. * * @param type * This specifies the type of file system object * to be made. The only two types at this time * are file and directory which are defined above. * If the type is unrecongnized, we will return an * error (NS_ERROR_FILE_UNKNOWN_TYPE). * * @param permissions * The unix style octal permissions. This may * be ignored on systems that do not need to do * permissions. */ /* void create (in unsigned long type, in unsigned long permissions); */ NS_IMETHOD Create(PRUint32 type, PRUint32 permissions) = 0; /** * Accessor to the leaf name of the file itself. * For the |nativeLeafName| method, the nativeLeafName must * be in the native filesystem charset. */ /* attribute AString leafName; */ NS_IMETHOD GetLeafName(nsAString & aLeafName) = 0; NS_IMETHOD SetLeafName(const nsAString & aLeafName) = 0; /* [noscript] attribute ACString nativeLeafName; */ NS_IMETHOD GetNativeLeafName(nsACString & aNativeLeafName) = 0; NS_IMETHOD SetNativeLeafName(const nsACString & aNativeLeafName) = 0; /** * copyTo[Native] * * This will copy this file to the specified newParentDir. * If a newName is specified, the file will be renamed. * If 'this' is not created we will return an error * (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST). * * copyTo may fail if the file already exists in the destination * directory. * * copyTo will NOT resolve aliases/shortcuts during the copy. * * @param newParentDir * This param is the destination directory. If the * newParentDir is null, copyTo() will use the parent * directory of this file. If the newParentDir is not * empty and is not a directory, an error will be * returned (NS_ERROR_FILE_DESTINATION_NOT_DIR). For the * |CopyToNative| method, the newName must be in the * native filesystem charset. * * @param newName * This param allows you to specify a new name for * the file to be copied. This param may be empty, in * which case the current leaf name will be used. */ /* void copyTo (in nsIFile newParentDir, in AString newName); */ NS_IMETHOD CopyTo(nsIFile *newParentDir, const nsAString & newName) = 0; /* [noscript] void CopyToNative (in nsIFile newParentDir, in ACString newName); */ NS_IMETHOD CopyToNative(nsIFile *newParentDir, const nsACString & newName) = 0; /** * copyToFollowingLinks[Native] * * This function is identical to copyTo with the exception that, * as the name implies, it follows symbolic links. The XP_UNIX * implementation always follow symbolic links when copying. For * the |CopyToFollowingLinks| method, the newName must be in the * native filesystem charset. */ /* void copyToFollowingLinks (in nsIFile newParentDir, in AString newName); */ NS_IMETHOD CopyToFollowingLinks(nsIFile *newParentDir, const nsAString & newName) = 0; /* [noscript] void copyToFollowingLinksNative (in nsIFile newParentDir, in ACString newName); */ NS_IMETHOD CopyToFollowingLinksNative(nsIFile *newParentDir, const nsACString & newName) = 0; /** * moveTo[Native] * * A method to move this file or directory to newParentDir. * If a newName is specified, the file or directory will be renamed. * If 'this' is not created we will return an error * (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST). * If 'this' is a file, and the destination file already exists, moveTo * will replace the old file. * * moveTo will NOT resolve aliases/shortcuts during the copy. * moveTo will do the right thing and allow copies across volumes. * moveTo will return an error (NS_ERROR_FILE_DIR_NOT_EMPTY) if 'this' is * a directory and the destination directory is not empty. * moveTo will return an error (NS_ERROR_FILE_ACCESS_DENIED) if 'this' is * a directory and the destination directory is not writable. * * @param newParentDir * This param is the destination directory. If the * newParentDir is empty, moveTo() will rename the file * within its current directory. If the newParentDir is * not empty and does not name a directory, an error will * be returned (NS_ERROR_FILE_DESTINATION_NOT_DIR). For * the |moveToNative| method, the newName must be in the * native filesystem charset. * * @param newName * This param allows you to specify a new name for * the file to be moved. This param may be empty, in * which case the current leaf name will be used. */ /* void moveTo (in nsIFile newParentDir, in AString newName); */ NS_IMETHOD MoveTo(nsIFile *newParentDir, const nsAString & newName) = 0; /* [noscript] void moveToNative (in nsIFile newParentDir, in ACString newName); */ NS_IMETHOD MoveToNative(nsIFile *newParentDir, const nsACString & newName) = 0; /** * This will try to delete this file. The 'recursive' flag * must be PR_TRUE to delete directories which are not empty. * * This will not resolve any symlinks. */ /* void remove (in boolean recursive); */ NS_IMETHOD Remove(PRBool recursive) = 0; /** * Attributes of nsIFile. */ /* attribute unsigned long permissions; */ NS_IMETHOD GetPermissions(PRUint32 *aPermissions) = 0; NS_IMETHOD SetPermissions(PRUint32 aPermissions) = 0; /* attribute unsigned long permissionsOfLink; */ NS_IMETHOD GetPermissionsOfLink(PRUint32 *aPermissionsOfLink) = 0; NS_IMETHOD SetPermissionsOfLink(PRUint32 aPermissionsOfLink) = 0; /** * File Times are to be in milliseconds from * midnight (00:00:00), January 1, 1970 Greenwich Mean * Time (GMT). */ /* attribute PRInt64 lastModifiedTime; */ NS_IMETHOD GetLastModifiedTime(PRInt64 *aLastModifiedTime) = 0; NS_IMETHOD SetLastModifiedTime(PRInt64 aLastModifiedTime) = 0; /* attribute PRInt64 lastModifiedTimeOfLink; */ NS_IMETHOD GetLastModifiedTimeOfLink(PRInt64 *aLastModifiedTimeOfLink) = 0; NS_IMETHOD SetLastModifiedTimeOfLink(PRInt64 aLastModifiedTimeOfLink) = 0; /** * WARNING! On the Mac, getting/setting the file size with nsIFile * only deals with the size of the data fork. If you need to * know the size of the combined data and resource forks use the * GetFileSizeWithResFork() method defined on nsILocalFileMac. */ /* attribute PRInt64 fileSize; */ NS_IMETHOD GetFileSize(PRInt64 *aFileSize) = 0; NS_IMETHOD SetFileSize(PRInt64 aFileSize) = 0; /* readonly attribute PRInt64 fileSizeOfLink; */ NS_IMETHOD GetFileSizeOfLink(PRInt64 *aFileSizeOfLink) = 0; /** * target & path * * Accessor to the string path. The native version of these * strings are not guaranteed to be a usable path to pass to * NSPR or the C stdlib. There are problems that affect * platforms on which a path does not fully specify a file * because two volumes can have the same name (e.g., XP_MAC). * This is solved by holding "private", native data in the * nsIFile implementation. This native data is lost when * you convert to a string. * * DO NOT PASS TO USE WITH NSPR OR STDLIB! * * target * Find out what the symlink points at. Will give error * (NS_ERROR_FILE_INVALID_PATH) if not a symlink. * * path * Find out what the nsIFile points at. * * Note that the ACString attributes are returned in the * native filesystem charset. * */ /* readonly attribute AString target; */ NS_IMETHOD GetTarget(nsAString & aTarget) = 0; /* [noscript] readonly attribute ACString nativeTarget; */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -