TableOfContents

class TableOfContents(tocReferences: MutableList<TOCReference> = mutableListOf())(source)

The table of contents of the book. The TableOfContents is a tree structure at the root it is a list of TOCReferences, each if which may have as children another list of TOCReferences.

The table of contents is used by epub as a quick index to chapters and sections within chapters. It may contain duplicate entries, may decide to point not to certain chapters, etc.

See the spine for the complete list of sections in the order in which they should be read.

Author

paul

See also

Constructors

Link copied to clipboard
constructor(tocReferences: MutableList<TOCReference> = mutableListOf())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun addSection(resource: Resource, pathElements: List<String>): TOCReference?
fun addSection(resource: Resource, pathElements: IntArray, sectionTitlePrefix: String, sectionNumberSeparator: String): TOCReference?

Adds the given Resources to the TableOfContents at the location specified by the pathElements.

fun addSection(resource: Resource, path: String, pathSeparator: String = DEFAULT_PATH_SEPARATOR): TOCReference?

Calls addTOCReferenceAtLocation after splitting the path using the DEFAULT_PATH_SEPARATOR.

Link copied to clipboard
Link copied to clipboard

The maximum depth of the reference tree

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun size(): Int

The total number of references in this table of contents.