X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c913512a4c9f36e11e07ea707002fab1608d324..d36dbec9c6b6559a597f10794617c21a344e5575:/interface/zipstrm.h?ds=sidebyside diff --git a/interface/zipstrm.h b/interface/zipstrm.h index 00725371f0..db06ccb07c 100644 --- a/interface/zipstrm.h +++ b/interface/zipstrm.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: zipstrm.h -// Purpose: documentation for wxZipNotifier class +// Purpose: interface of wxZipNotifier // Author: wxWidgets team // RCS-ID: $Id$ // Licence: wxWindows license @@ -25,8 +25,7 @@ @library{wxbase} @category{FIXME} - @seealso - @ref overview_wxarcnoseek "Archives on non-seekable streams", wxZipEntry, + @see @ref overview_wxarcnoseek "Archives on non-seekable streams", wxZipEntry, wxZipInputStream, wxZipOutputStream */ class wxZipNotifier @@ -40,6 +39,7 @@ public: }; + /** @class wxZipEntry @wxheader{zipstrm.h} @@ -49,8 +49,7 @@ public: @library{wxbase} @category{FIXME} - @seealso - @ref overview_wxarc "Archive formats such as zip", wxZipInputStream, + @see @ref overview_wxarc "Archive formats such as zip", wxZipInputStream, wxZipOutputStream, wxZipNotifier */ class wxZipEntry : public wxArchiveEntry @@ -67,14 +66,14 @@ public: /** Make a copy of this entry. */ - wxZipEntry* Clone(); + wxZipEntry* Clone() const; //@{ /** A short comment for this entry. */ wxString GetComment(); - void SetComment(const wxString& comment); + const void SetComment(const wxString& comment); //@} //@{ @@ -82,15 +81,12 @@ public: The low 8 bits are always the DOS/Windows file attributes for this entry. The values of these attributes are given in the enumeration @c wxZipAttributes. - The remaining bits can store platform specific permission bits or attributes, and their meaning depends on the value of @ref systemmadeby() SetSystemMadeBy. If IsMadeByUnix() is @true then the high 16 bits are unix mode bits. - The following other accessors access these bits: - @ref wxArchiveEntry::isreadonly IsReadOnly/SetIsReadOnly @ref wxArchiveEntry::isdir IsDir/SetIsDir @@ -98,44 +94,41 @@ public: @ref mode() Get/SetMode */ wxUint32 GetExternalAttributes(); - void SetExternalAttributes(wxUint32 attr); + const void SetExternalAttributes(wxUint32 attr); //@} //@{ /** The extra field from the entry's central directory record. - The extra field is used to store platform or application specific data. See Pkware's document 'appnote.txt' for information on its format. */ const char* GetExtra(); - size_t GetExtraLen(); - void SetExtra(const char* extra, size_t len); + const size_t GetExtraLen(); + const void SetExtra(const char* extra, size_t len); //@} //@{ /** The extra field from the entry's local record. - The extra field is used to store platform or application specific data. See Pkware's document 'appnote.txt' for information on its format. */ const char* GetLocalExtra(); - size_t GetLocalExtraLen(); - void SetLocalExtra(const char* extra, size_t len); + const size_t GetLocalExtraLen(); + const void SetLocalExtra(const char* extra, size_t len); //@} //@{ /** The compression method. The enumeration @c wxZipMethod lists the possible values. - The default constructor sets this to wxZIP_METHOD_DEFAULT, which allows wxZipOutputStream to choose the method when writing the entry. */ int GetMethod(); - void SetMethod(int method); + const void SetMethod(int method); //@} //@{ @@ -143,17 +136,15 @@ public: Sets the DOS attributes in @ref externalattributes() GetExternalAttributes to be consistent with the @c mode given. - If IsMadeByUnix() is @true then also stores @c mode in GetExternalAttributes(). - Note that the default constructor sets @ref systemmadeby() GetSystemMadeBy to wxZIP_SYSTEM_MSDOS by default. So to be able to store unix permissions when creating zips, call SetSystemMadeBy(wxZIP_SYSTEM_UNIX). */ int GetMode(); - void SetMode(int mode); + const void SetMode(int mode); //@} //@{ @@ -163,23 +154,23 @@ public: able to store unix permissions using @ref mode() SetMode. */ int GetSystemMadeBy(); - void SetSystemMadeBy(int system); + const void SetSystemMadeBy(int system); //@} /** The compressed size of this entry in bytes. */ - off_t GetCompressedSize(); + off_t GetCompressedSize() const; /** CRC32 for this entry's data. */ - wxUint32 GetCrc(); + wxUint32 GetCrc() const; /** Returns a combination of the bits flags in the enumeration @c wxZipFlags. */ - int GetFlags(); + int GetFlags() const; //@{ /** @@ -188,41 +179,40 @@ public: to is set to indicate whether the name looks like a directory name (i.e. has a trailing path separator). - @sa @ref overview_wxarcbyname "Looking up an archive entry by name" + @see @ref overview_wxarcbyname "Looking up an archive entry by name" */ wxString GetInternalName(); - wxString GetInternalName(const wxString& name, - wxPathFormat format = wxPATH_NATIVE, - bool* pIsDir = @NULL); + const wxString GetInternalName(const wxString& name, + wxPathFormat format = wxPATH_NATIVE, + bool* pIsDir = NULL); //@} /** Returns @true if @ref systemmadeby() GetSystemMadeBy is a flavour of unix. */ - bool IsMadeByUnix(); + bool IsMadeByUnix() const; //@{ /** Indicates that this entry's data is text in an 8-bit encoding. */ bool IsText(); - void SetIsText(bool isText = @true); + const void SetIsText(bool isText = true); //@} //@{ /** - Sets the notifier for this entry. + Sets the notifier() for this entry. Whenever the wxZipInputStream updates this entry, it will then invoke the associated notifier's wxZipNotifier::OnEntryUpdated method. - Setting a notifier is not usually necessary. It is used to handle certain cases when modifying an zip in a pipeline (i.e. between non-seekable streams). - @sa @ref overview_wxarcnoseek "Archives on non-seekable streams", wxZipNotifier + @see @ref overview_wxarcnoseek "Archives on non-seekable streams", wxZipNotifier */ void SetNotifier(wxZipNotifier& notifier); void UnsetNotifier(); @@ -235,6 +225,7 @@ public: }; + /** @class wxZipInputStream @wxheader{zipstrm.h} @@ -254,8 +245,8 @@ public: @library{wxbase} @category{streams} - @seealso - @ref overview_wxarc "Archive formats such as zip", wxZipEntry, wxZipOutputStream + @see @ref overview_wxarc "Archive formats such as zip", wxZipEntry, + wxZipOutputStream */ class wxZipInputStream : public wxArchiveInputStream { @@ -263,7 +254,6 @@ public: //@{ /** Compatibility constructor (requires WXWIN_COMPATIBILITY_2_6). - When this constructor is used, an emulation of seeking is switched on for compatibility with previous versions. Note however, that it is deprecated. @@ -284,7 +274,6 @@ public: /** Returns the zip comment. - This is stored at the end of the zip, therefore when reading a zip from a non-seekable stream, it returns the empty string until the end of the zip has been reached, i.e. when GetNextEntry() returns @@ -308,15 +297,15 @@ public: /** Closes the current entry if one is open, then opens the entry specified - by the @e entry object. - - @e entry should be from the same zip file, and the zip should + by the @a entry object. + @a entry should be from the same zip file, and the zip should be on a seekable stream. */ bool OpenEntry(wxZipEntry& entry); }; + /** @class wxZipClassFactory @wxheader{zipstrm.h} @@ -327,9 +316,8 @@ public: @library{wxbase} @category{FIXME} - @seealso - @ref overview_wxarc "Archive formats such as zip", @ref overview_wxarcgeneric - "Generic archive programming", wxZipEntry, wxZipInputStream, wxZipOutputStream + @see @ref overview_wxarc "Archive formats such as zip", @ref + overview_wxarcgeneric "Generic archive programming", wxZipEntry, wxZipInputStream, wxZipOutputStream */ class wxZipClassFactory : public wxArchiveClassFactory { @@ -338,6 +326,7 @@ public: }; + /** @class wxZipOutputStream @wxheader{zipstrm.h} @@ -352,8 +341,8 @@ public: @library{wxbase} @category{streams} - @seealso - @ref overview_wxarc "Archive formats such as zip", wxZipEntry, wxZipInputStream + @see @ref overview_wxarc "Archive formats such as zip", wxZipEntry, + wxZipInputStream */ class wxZipOutputStream : public wxArchiveOutputStream { @@ -363,10 +352,8 @@ public: Constructor. @c level is the compression level to use. It can be a value between 0 and 9 or -1 to use the default value which currently is equivalent to 6. - If the parent stream is passed as a pointer then the new filter stream takes ownership of it. If it is passed by reference then it does not. - In a Unicode build the third parameter @c conv is used to translate the filename and comment fields to an 8-bit encoding. It has no effect on the stream's data. @@ -407,11 +394,9 @@ public: Takes ownership of @c entry and uses it to create a new entry in the zip. @c entry is then opened in @c inputStream and its contents copied to this stream. - CopyEntry() is much more efficient than transferring the data using Read() and Write() since it will copy them without decompressing and recompressing them. - For zips on seekable streams, @c entry must be from the same zip file as @c stream. For non-seekable streams, @c entry must also be the last thing read from @c inputStream. @@ -425,16 +410,14 @@ public: which currently is equivalent to 6. */ int GetLevel(); - void SetLevel(int level); + const void SetLevel(int level); //@} /** ) - Create a new directory entry (see wxArchiveEntry::IsDir) with the given name and timestamp. - PutNextEntry() can also be used to create directory entries, by supplying a name with a trailing path separator. @@ -444,7 +427,6 @@ public: //@{ /** , @b off_t@e size = wxInvalidOffset) - Create a new entry with the given name, timestamp and size. */ bool PutNextEntry(wxZipEntry* entry); @@ -457,3 +439,4 @@ public: */ void SetComment(const wxString& comment); }; +