#include "llvm/ADT/ilist.h"
#include "llvm/ADT/ilist_node.h"
#include "llvm/Support/Path.h"
+#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/TimeValue.h"
#include <map>
#include <set>
enum Flags {
SVR4SymbolTableFlag = 1, ///< Member is a SVR4 symbol table
BSD4SymbolTableFlag = 2, ///< Member is a BSD4 symbol table
- BitcodeFlag = 4, ///< Member is bitcode
- HasPathFlag = 8, ///< Member has a full or partial path
- HasLongFilenameFlag = 16, ///< Member uses the long filename syntax
- StringTableFlag = 32 ///< Member is an ar(1) format string table
+ HasLongFilenameFlag = 8, ///< Member uses the long filename syntax
+ StringTableFlag = 16 ///< Member is an ar(1) format string table
};
/// @}
/// @brief Determine if this member is the ar(1) string table.
bool isStringTable() const { return flags&StringTableFlag; }
- /// @returns true iff the archive member is a bitcode file.
- /// @brief Determine if this member is a bitcode file.
- bool isBitcode() const { return flags&BitcodeFlag; }
-
- /// @returns true iff the file name contains a path (directory) component.
- /// @brief Determine if the member has a path
- bool hasPath() const { return flags&HasPathFlag; }
-
/// Long filenames are an artifact of the ar(1) file format which allows
/// up to sixteen characters in its header and doesn't allow a path
/// separator character (/). To avoid this, a "long format" member name is
/// returns false if the writing succeeded.
/// @brief Write (possibly modified) archive contents to disk
bool writeToDisk(
- bool TruncateNames=false, ///< Truncate the filename to 15 chars
std::string* ErrMessage=0 ///< If non-null, where error msg is set
);
/// returns true if 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 TruncateNames, ///< Should names be truncated to 11 chars?
+ raw_fd_ostream& ARFile, ///< The file to write member onto
std::string* ErrMessage ///< If non-null, place were error msg is set
);
/// @brief Fill in an ArchiveMemberHeader from ArchiveMember.
bool fillHeader(const ArchiveMember&mbr,
- ArchiveMemberHeader& hdr,int sz, bool TruncateNames) const;
+ ArchiveMemberHeader& hdr,int sz) const;
/// @brief Maps archive into memory
bool mapToMemory(std::string* ErrMsg);