| 1632 | // ========================================================================= |
| 1633 | |
| 1634 | status_t AaptGroup::addFile(const sp<AaptFile>& file) |
| 1635 | { |
| 1636 | if (mFiles.indexOfKey(file->getGroupEntry()) < 0) { |
| 1637 | file->mPath = mPath; |
| 1638 | mFiles.add(file->getGroupEntry(), file); |
| 1639 | return NO_ERROR; |
| 1640 | } |
| 1641 | |
| 1642 | #if 0 |
| 1643 | printf("Error adding file %s: group %s already exists in leaf=%s path=%s\n", |
| 1644 | file->getSourceFile().string(), |
| 1645 | file->getGroupEntry().toDirName(String8()).string(), |
| 1646 | mLeaf.string(), mPath.string()); |
| 1647 | #endif |
| 1648 | |
| 1649 | SourcePos(file->getSourceFile(), -1).error("Duplicate file.\n%s: Original is here.", |
| 1650 | getPrintableSource().string()); |
| 1651 | return UNKNOWN_ERROR; |
| 1652 | } |
| 1653 | |
| 1654 | void AaptGroup::removeFile(size_t index) |
| 1655 | { |