// check if a symbol is in the archive
Expected<Optional<Child>> findSym(StringRef name) const;
+ bool isEmpty() const;
bool hasSymbolTable() const;
StringRef getSymbolTable() const { return SymbolTable; }
StringRef getStringTable() const { return StringTable; }
Archive::child_iterator Archive::child_begin(Error &Err,
bool SkipInternal) const {
- if (Data.getBufferSize() == 8) // empty archive.
+ if (isEmpty())
return child_end();
if (SkipInternal)
return Optional<Child>();
}
+// Returns true if archive file contains no member file.
+bool Archive::isEmpty() const { return Data.getBufferSize() == 8; }
+
bool Archive::hasSymbolTable() const { return !SymbolTable.empty(); }