# HG changeset patch # User David Demelier # Date 1416054570 -3600 # Node ID ddd704ac6e2110917b2d2b3da061a3cb6e91c421 # Parent bae4af872cdefe56062227f0356e281dd3a6673e# Parent 4cff6aa6f271a267fe3c2b71187bc2d932ce7308 MFS diff -r bae4af872cde -r ddd704ac6e21 C++/ZipArchive.h --- a/C++/ZipArchive.h Sat Nov 15 13:19:30 2014 +0100 +++ b/C++/ZipArchive.h Sat Nov 15 13:29:30 2014 +0100 @@ -59,6 +59,7 @@ * instead. * * @return a zip_source ready to be used + * @throw std::runtime_error on errors * @post must not return null */ virtual struct zip_source *source(struct zip *zip) const = 0; @@ -91,7 +92,7 @@ * * @param other the other ZipFile */ - ZipFile(ZipFile &&other) = default; + ZipFile(ZipFile &&other) noexcept = default; /** * Move operator defaulted. @@ -99,7 +100,7 @@ * @param other the other ZipFile * @return *this */ - ZipFile &operator=(ZipFile &&) = default; + ZipFile &operator=(ZipFile &&) noexcept = default; /** * Read some data. @@ -220,6 +221,7 @@ * * @param path the path * @param flags the optional flags + * @throw std::runtime_error on errors */ ZipArchive(const std::string &path, ZipFlags flags = 0); @@ -244,6 +246,7 @@ * @param index the file index in the archive * @param text the text or empty to remove the comment * @param flags the optional flags + * @throw std::runtime_error on errors */ void setFileComment(ZipUint64 index, const std::string &text = "", ZipFlags flags = 0); @@ -253,6 +256,7 @@ * @param index the file index in the archive * @param flags the optional flags * @return the comment + * @throw std::runtime_error on errors */ std::string getFileComment(ZipUint64 index, ZipFlags flags = 0) const; @@ -260,6 +264,7 @@ * Set the archive comment. * * @param comment the comment + * @throw std::runtime_error on errors */ void setComment(const std::string &comment); @@ -268,6 +273,7 @@ * * @param flags the optional flags * @return the comment + * @throw std::runtime_error on errors */ std::string getComment(ZipFlags flags = 0) const; @@ -277,6 +283,7 @@ * @param name the name * @param flags the optional flags * @return the index + * @throw std::runtime_error on errors */ ZipInt64 find(const std::string &name, ZipFlags flags = 0); @@ -286,6 +293,7 @@ * @param name the name * @param flags the optional flags * @return the structure + * @throw std::runtime_error on errors */ ZipStat stat(const std::string &name, ZipFlags flags = 0); @@ -295,6 +303,7 @@ * @param index the file index in the archive * @param flags the optional flags * @return the structure + * @throw std::runtime_error on errors */ ZipStat stat(ZipUint64 index, ZipFlags flags = 0); @@ -305,6 +314,7 @@ * @param name the name entry in the archive * @param flags the optional flags * @return the new index in the archive + * @throw std::runtime_error on errors * @see source::File * @see source::Buffer */ @@ -316,6 +326,7 @@ * @param directory the directory name * @param flags the optional flags * @return the new index in the archive + * @throw std::runtime_error on errors */ ZipInt64 addDirectory(const std::string &directory, ZipFlags flags = 0); @@ -325,6 +336,7 @@ * @param source the source * @param index the file index in the archiev * @param flags the optional flags + * @throw std::runtime_error on errors */ void replace(const ZipSource &source, ZipUint64 index, ZipFlags flags = 0); @@ -335,6 +347,7 @@ * @param flags the optional flags * @param password the optional password * @return the opened file + * @throw std::runtime_error on errors */ ZipFile open(const std::string &name, ZipFlags flags = 0, const std::string &password = ""); @@ -345,6 +358,7 @@ * @param flags the optional flags * @param password the optional password * @return the opened file + * @throw std::runtime_error on errors */ ZipFile open(ZipUint64 index, ZipFlags flags = 0, const std::string &password = ""); @@ -354,6 +368,7 @@ * @param index the file index in the archive * @param name the new name * @param flags the optional flags + * @throw std::runtime_error on errors */ void rename(ZipUint64 index, const std::string &name, ZipFlags flags = 0); @@ -363,6 +378,7 @@ * @param index the file index in the archive * @param comp the compression * @param flags the optional flags + * @throw std::runtime_error on errors */ void setFileCompression(ZipUint64 index, ZipInt32 comp, ZipUint32 flags = 0); @@ -370,6 +386,7 @@ * Delete a file from the archive. * * @param index the file index in the archive + * @throw std::runtime_error on errors */ void remove(ZipUint64 index); @@ -378,6 +395,7 @@ * * @param flags the optional flags * @return the number of entries + * @throw std::runtime_error on errors */ ZipInt64 numEntries(ZipFlags flags = 0) const; @@ -385,16 +403,21 @@ * Revert changes on the file. * * @param index the index + * @throw std::runtime_error on errors */ void unchange(ZipUint64 index); /** * Revert all changes. + * + * @throw std::runtime_error on errors */ void unchangeAll(); /** * Revert changes to archive. + * + * @throw std::runtime_error on errors */ void unchangeArchive(); @@ -402,6 +425,7 @@ * Set the defaut password. * * @param password the password or empty to unset it + * @throw std::runtime_error on errors */ void setDefaultPassword(const std::string &password = ""); @@ -410,6 +434,7 @@ * * @param flag the flag to set * @param value the value + * @throw std::runtime_error on errors */ void setFlag(ZipFlags flag, int value); @@ -419,6 +444,7 @@ * @param which which flag * @param flags the optional flags * @return the value + * @throw std::runtime_error on errors */ int getFlag(ZipFlags which, ZipFlags flags = 0) const;