- /// @brief Write one ArchiveMember to an ofstream.
- void writeMember(const ArchiveMember& member, std::ofstream& ARFile,
- bool CreateSymbolTable, bool TruncateNames, bool ShouldCompress);
+ /// Writes one ArchiveMember to an ofstream. If an error occurs, returns
+ /// false, otherwise true. If an error occurs and error is non-null then
+ /// it will be set to an error message.
+ /// @returns true Writing member succeeded
+ /// @returns false Writing member failed, \p error set to error message
+ bool writeMember(
+ const ArchiveMember& member, ///< The member to be written
+ std::ofstream& ARFile, ///< The file to write member onto
+ bool CreateSymbolTable, ///< Should symbol table be created?
+ bool TruncateNames, ///< Should names be truncated to 11 chars?
+ bool ShouldCompress, ///< Should the member be compressed?
+ std::string* error = 0 ///< If non-null, place were error msg is set
+ );