Esempio n. 1
0
void ReadiumJSApi::getTOCList(TOCEntry &rOut)
{
	std::list<std::pair<std::string, std::string> > lst;
	if (!pkg)
		return;

	rOut = TOCEntry("TOC", "");

	shared_ptr<NavigationTable> toc = pkg->TableOfContents();
	const NavigationList& list = toc->Children();

	digInto(list, rOut);
}
Esempio n. 2
0
}

static void PrintNavTable(NavigationTablePtr nav)
{
    std::cerr << "Title: " << nav->Title() << std::endl;
    std::cerr << "Type:  " << nav->Type()  << std::endl;

    for (auto& child : nav->Children())
    {
        PrintNavElement(child, 1);
    }
}

TEST_CASE("ePub2 files should have a Table of Contents", "")
{
    PackagePtr pkg = GetEPUB2Container()->DefaultPackage();
    auto toc = pkg->TableOfContents();
    REQUIRE(bool(toc));

    //PrintNavTable(toc);
}

TEST_CASE("ePub3 files should have a Table of Contents", "")
{
    PackagePtr pkg = GetEPUB3Container()->DefaultPackage();
    auto toc = pkg->TableOfContents();
    REQUIRE(bool(toc));

    //PrintNavTable(toc);
}