Struct xpcom::interfaces::nsIZipWriter
[−]
[src]
#[repr(C)]pub struct nsIZipWriter { /* fields omitted */ }
interface nsIZipWriter : nsISupports
/**
* nsIZipWriter
*
* An interface for a zip archiver that can be used from script.
*
* The interface supports both a synchronous method of archiving data and a
* queueing system to allow operations to be prepared then run in sequence
* with notification after completion.
*
* Operations added to the queue do not get performed until performQueue is
* called at which point they will be performed in the order that they were
* added to the queue.
*
* Operations performed on the queue will throw any errors out to the
* observer.
*
* An attempt to perform a synchronous operation while the background queue
* is in progress will throw NS_ERROR_IN_PROGRESS.
*
* Entry names should use /'s as path separators and should not start with
* a /.
*
* It is not generally necessary to add directory entries in order to add file
* entries within them, however it is possible that some zip programs may
* experience problems what that.
*/
Methods
impl nsIZipWriter
[src]
pub fn coerce<T: nsIZipWriterCoerce>(&self) -> &T
[src]
Cast this nsIZipWriter
to one of its base interfaces.
impl nsIZipWriter
[src]
pub const COMPRESSION_NONE: i64
COMPRESSION_NONE: i64 = 0
/**
* Some predefined compression levels
*/
pub const COMPRESSION_FASTEST: i64
COMPRESSION_FASTEST: i64 = 1
pub const COMPRESSION_DEFAULT: i64
COMPRESSION_DEFAULT: i64 = 6
pub const COMPRESSION_BEST: i64
COMPRESSION_BEST: i64 = 9
pub unsafe fn GetComment(&self, aComment: &mut nsACString) -> nsresult
[src]
/**
* Gets or sets the comment associated with the open zip file.
*
* @throws NS_ERROR_NOT_INITIALIZED if no zip file has been opened
*/
attribute ACString comment;
pub unsafe fn SetComment(&self, aComment: &nsACString) -> nsresult
[src]
/**
* Gets or sets the comment associated with the open zip file.
*
* @throws NS_ERROR_NOT_INITIALIZED if no zip file has been opened
*/
attribute ACString comment;
pub unsafe fn GetInQueue(&self, aInQueue: *mut bool) -> nsresult
[src]
/**
* Indicates that operations on the background queue are being performed.
*/
readonly attribute boolean inQueue;
pub unsafe fn GetFile(&self, aFile: *mut *const nsIFile) -> nsresult
[src]
/**
* The file that the zipwriter is writing to.
*/
readonly attribute nsIFile file;
pub unsafe fn Open(&self, aFile: *const nsIFile, aIoFlags: int32_t) -> nsresult
[src]
/**
* Opens a zip file.
*
* @param aFile the zip file to open
* @param aIoFlags the open flags for the zip file from prio.h
*
* @throws NS_ERROR_ALREADY_INITIALIZED if a zip file is already open
* @throws NS_ERROR_INVALID_ARG if aFile is null
* @throws NS_ERROR_FILE_NOT_FOUND if aFile does not exist and flags did
* not allow for creation
* @throws NS_ERROR_FILE_CORRUPTED if the file does not contain zip markers
* @throws <other-error> on failure to open zip file (most likely corrupt
* or unsupported form)
*/
void open (in nsIFile aFile, in int32_t aIoFlags);
pub unsafe fn GetEntry(
&self,
aZipEntry: &nsACString,
_retval: *mut *const nsIZipEntry
) -> nsresult
[src]
&self,
aZipEntry: &nsACString,
_retval: *mut *const nsIZipEntry
) -> nsresult
/**
* Returns a nsIZipEntry describing a specified zip entry or null if there
* is no such entry in the zip file
*
* @param aZipEntry the path of the entry
*/
nsIZipEntry getEntry (in AUTF8String aZipEntry);
pub unsafe fn HasEntry(
&self,
aZipEntry: &nsACString,
_retval: *mut bool
) -> nsresult
[src]
&self,
aZipEntry: &nsACString,
_retval: *mut bool
) -> nsresult
/**
* Checks whether the zipfile contains an entry specified by zipEntry.
*
* @param aZipEntry the path of the entry
*/
boolean hasEntry (in AUTF8String aZipEntry);
pub unsafe fn AddEntryDirectory(
&self,
aZipEntry: &nsACString,
aModTime: PRTime,
aQueue: bool
) -> nsresult
[src]
&self,
aZipEntry: &nsACString,
aModTime: PRTime,
aQueue: bool
) -> nsresult
/**
* Adds a new directory entry to the zip file. If aZipEntry does not end with
* "/" then it will be added.
*
* @param aZipEntry the path of the directory entry
* @param aModTime the modification time of the entry in microseconds
* @param aQueue adds the operation to the background queue. Will be
* performed when processQueue is called.
*
* @throws NS_ERROR_NOT_INITIALIZED if no zip file has been opened
* @throws NS_ERROR_FILE_ALREADY_EXISTS if the path already exists in the
* file
* @throws NS_ERROR_IN_PROGRESS if another operation is currently in progress
*/
void addEntryDirectory (in AUTF8String aZipEntry, in PRTime aModTime, in boolean aQueue);
pub unsafe fn AddEntryFile(
&self,
aZipEntry: &nsACString,
aCompression: int32_t,
aFile: *const nsIFile,
aQueue: bool
) -> nsresult
[src]
&self,
aZipEntry: &nsACString,
aCompression: int32_t,
aFile: *const nsIFile,
aQueue: bool
) -> nsresult
/**
* Adds a new file or directory to the zip file. If the specified file is
* a directory then this will be equivalent to a call to
* addEntryDirectory(aZipEntry, aFile.lastModifiedTime, aQueue)
*
* @param aZipEntry the path of the file entry
* @param aCompression the compression level, 0 is no compression, 9 is best
* @param aFile the file to get the data and modification time from
* @param aQueue adds the operation to the background queue. Will be
* performed when processQueue is called.
*
* @throws NS_ERROR_NOT_INITIALIZED if no zip file has been opened
* @throws NS_ERROR_FILE_ALREADY_EXISTS if the path already exists in the zip
* @throws NS_ERROR_IN_PROGRESS if another operation is currently in progress
* @throws NS_ERROR_FILE_NOT_FOUND if file does not exist
*/
void addEntryFile (in AUTF8String aZipEntry, in int32_t aCompression, in nsIFile aFile, in boolean aQueue);
pub unsafe fn AddEntryChannel(
&self,
aZipEntry: &nsACString,
aModTime: PRTime,
aCompression: int32_t,
aChannel: *const nsIChannel,
aQueue: bool
) -> nsresult
[src]
&self,
aZipEntry: &nsACString,
aModTime: PRTime,
aCompression: int32_t,
aChannel: *const nsIChannel,
aQueue: bool
) -> nsresult
/**
* Adds data from a channel to the zip file. If the operation is performed
* on the queue then the channel will be opened asynchronously, otherwise
* the channel must support being opened synchronously.
*
* @param aZipEntry the path of the file entry
* @param aModTime the modification time of the entry in microseconds
* @param aCompression the compression level, 0 is no compression, 9 is best
* @param aChannel the channel to get the data from
* @param aQueue adds the operation to the background queue. Will be
* performed when processQueue is called.
*
* @throws NS_ERROR_NOT_INITIALIZED if no zip file has been opened
* @throws NS_ERROR_FILE_ALREADY_EXISTS if the path already exists in the zip
* @throws NS_ERROR_IN_PROGRESS if another operation is currently in progress
*/
void addEntryChannel (in AUTF8String aZipEntry, in PRTime aModTime, in int32_t aCompression, in nsIChannel aChannel, in boolean aQueue);
pub unsafe fn AddEntryStream(
&self,
aZipEntry: &nsACString,
aModTime: PRTime,
aCompression: int32_t,
aStream: *const nsIInputStream,
aQueue: bool
) -> nsresult
[src]
&self,
aZipEntry: &nsACString,
aModTime: PRTime,
aCompression: int32_t,
aStream: *const nsIInputStream,
aQueue: bool
) -> nsresult
/**
* Adds data from an input stream to the zip file.
*
* @param aZipEntry the path of the file entry
* @param aModTime the modification time of the entry in microseconds
* @param aCompression the compression level, 0 is no compression, 9 is best
* @param aStream the input stream to get the data from
* @param aQueue adds the operation to the background queue. Will be
* performed when processQueue is called.
*
* @throws NS_ERROR_NOT_INITIALIZED if no zip file has been opened
* @throws NS_ERROR_FILE_ALREADY_EXISTS if the path already exists in the zip
* @throws NS_ERROR_IN_PROGRESS if another operation is currently in progress
*/
void addEntryStream (in AUTF8String aZipEntry, in PRTime aModTime, in int32_t aCompression, in nsIInputStream aStream, in boolean aQueue);
pub unsafe fn RemoveEntry(
&self,
aZipEntry: &nsACString,
aQueue: bool
) -> nsresult
[src]
&self,
aZipEntry: &nsACString,
aQueue: bool
) -> nsresult
/**
* Removes an existing entry from the zip file.
*
* @param aZipEntry the path of the entry to be removed
* @param aQueue adds the operation to the background queue. Will be
* performed when processQueue is called.
*
* @throws NS_ERROR_NOT_INITIALIZED if no zip file has been opened
* @throws NS_ERROR_IN_PROGRESS if another operation is currently in progress
* @throws NS_ERROR_FILE_NOT_FOUND if no entry with the given path exists
* @throws <other-error> on failure to update the zip file
*/
void removeEntry (in AUTF8String aZipEntry, in boolean aQueue);
pub unsafe fn ProcessQueue(
&self,
aObserver: *const nsIRequestObserver,
aContext: *const nsISupports
) -> nsresult
[src]
&self,
aObserver: *const nsIRequestObserver,
aContext: *const nsISupports
) -> nsresult
/**
* Processes all queued items until complete or some error occurs. The
* observer will be notified when the first operation starts and when the
* last operation completes. Any failures will be passed to the observer.
* The zip writer will be busy until the queue is complete or some error
* halted processing of the queue early. In the event of an early failure,
* remaining items will stay in the queue and calling processQueue will
* continue.
*
* @throws NS_ERROR_NOT_INITIALIZED if no zip file has been opened
* @throws NS_ERROR_IN_PROGRESS if the queue is already in progress
*/
void processQueue (in nsIRequestObserver aObserver, in nsISupports aContext);
pub unsafe fn Close(&self) -> nsresult
[src]
/**
* Closes the zip file.
*
* @throws NS_ERROR_NOT_INITIALIZED if no zip file has been opened
* @throws NS_ERROR_IN_PROGRESS if another operation is currently in progress
* @throws <other-error> on failure to complete the zip file
*/
void close ();
pub unsafe fn AlignStoredFiles(&self, aAlignSize: uint16_t) -> nsresult
[src]
/**
* Make all stored(uncompressed) files align to given alignment size.
*
* @param aAlignSize is the alignment size, valid values from 2 to 32768, and
must be power of 2.
*
* @throws NS_ERROR_INVALID_ARG if aAlignSize is invalid
* @throws <other-error> on failure to update the zip file
*/
void alignStoredFiles (in uint16_t aAlignSize);
Methods from Deref<Target = nsISupports>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsIZipWriter
[src]
const IID: nsIID
IID: nsIID = nsID(1017186128, 31102, 18978, [188, 254, 102, 23, 11, 94, 150, 221])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[src]
Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more
impl RefCounted for nsIZipWriter
[src]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsIZipWriter
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.