diff --git a/include/zim/writer/creator.h b/include/zim/writer/creator.h index 60d1c546f..a104e52e3 100644 --- a/include/zim/writer/creator.h +++ b/include/zim/writer/creator.h @@ -197,28 +197,28 @@ namespace zim /** - * Add a clone of a existing entry. + * Add a alias of a existing entry. * * The existing entry pointed by `targetPath` is cloned and updated with * `path` and `title`. * - * The clone entry will shared the same type (redirection or item) + * The alias entry will shared the same type (redirection or item) * and namespace than `targetPath`. * * If the `targetPath` is a item, the new entry will be item pointing * to the same data than `targetPath` item. (Not a redirection to `targetPath`). - * However, the cloned entry is not counted in the media type counter + * However, the alias entry is not counted in the media type counter * and it is not fulltext indexed (only title indexed). * * Hints can be given to influence creator handling (front article, ...) * as it is done for redirection. * - * @param path the path of the clone - * @param title the title of the clone - * @param targetPath the path of the cloned entry. - * @param hints hints associated to the clone. + * @param path the path of the alias + * @param title the title of the alias + * @param targetPath the path of the aliased entry. + * @param hints hints associated to the alias. */ - void addClone( + void addAlias( const std::string& path, const std::string& title, const std::string& targetPath, diff --git a/src/writer/creator.cpp b/src/writer/creator.cpp index d38621624..fd842a851 100644 --- a/src/writer/creator.cpp +++ b/src/writer/creator.cpp @@ -206,7 +206,7 @@ namespace zim data->handle(dirent, hints); } - void Creator::addClone(const std::string& path, const std::string& title, const std::string& targetPath, const Hints& hints) + void Creator::addAlias(const std::string& path, const std::string& title, const std::string& targetPath, const Hints& hints) { checkError(); Dirent tmpDirent(NS::C, targetPath); @@ -214,12 +214,12 @@ namespace zim if (existing_dirent_it == data->dirents.end()) { std::ostringstream ss; - ss << "Impossible to clone C/" << targetPath << " to C/" << path << std::endl; + ss << "Impossible to alias C/" << targetPath << " as C/" << path << std::endl; ss << "C/" << targetPath << " doesn't exist." << std::endl; throw InvalidEntry(ss.str()); } - auto dirent = data->createCloneDirent(path, title, **existing_dirent_it); + auto dirent = data->createAliasDirent(path, title, **existing_dirent_it); data->handle(dirent, hints); } @@ -615,7 +615,7 @@ namespace zim return dirent; } - Dirent* CreatorData::createCloneDirent(const std::string& path, const std::string& title, const Dirent& target) + Dirent* CreatorData::createAliasDirent(const std::string& path, const std::string& title, const Dirent& target) { auto dirent = pool.getCloneDirent(path, title, target); addDirent(dirent); diff --git a/src/writer/creatordata.h b/src/writer/creatordata.h index 5f83ffb55..7ff8cbcd3 100644 --- a/src/writer/creatordata.h +++ b/src/writer/creatordata.h @@ -74,7 +74,7 @@ namespace zim Dirent* createDirent(NS ns, const std::string& path, const std::string& mimetype, const std::string& title); Dirent* createItemDirent(const Item* item); Dirent* createRedirectDirent(NS ns, const std::string& path, const std::string& title, NS targetNs, const std::string& targetPath); - Dirent* createCloneDirent(const std::string& path, const std::string& title, const Dirent& target); + Dirent* createAliasDirent(const std::string& path, const std::string& title, const Dirent& target); Cluster* closeCluster(bool compressed); void setEntryIndexes(); diff --git a/test/creator.cpp b/test/creator.cpp index d64990b33..db13e8c12 100644 --- a/test/creator.cpp +++ b/test/creator.cpp @@ -185,13 +185,13 @@ TEST(ZimCreator, createZim) // Be sure that title order is not the same that url order item = std::make_shared("foo2", "AFoo", "Foo2Content"); creator.addItem(item); - creator.addClone("foo_bis", "The same Foo", "foo2"); + creator.addAlias("foo_bis", "The same Foo", "foo2"); creator.addMetadata("Title", "This is a title"); creator.addIllustration(48, "PNGBinaryContent48"); creator.addIllustration(96, "PNGBinaryContent96"); creator.setMainPath("foo"); creator.addRedirection("foo3", "FooRedirection", "foo"); // Not a front article. - creator.addClone("foo_ter", "The same redirection", "foo3", {{ zim::writer::FRONT_ARTICLE, true}}); // a clone of the previous redirect, but as a front article. + creator.addAlias("foo_ter", "The same redirection", "foo3", {{ zim::writer::FRONT_ARTICLE, true}}); // a clone of the previous redirect, but as a front article. creator.addRedirection("foo4", "FooRedirection", "NoExistant", {{zim::writer::FRONT_ARTICLE, true}}); // Invalid redirection, must be removed by creator creator.finishZimCreation();