BacklinkIndex.h header
#include <ew/app/BacklinkIndex.h>
Namespace ew::app
Backlink struct
struct ew::app::Backlink
One place a target entity is mentioned: the source object (a document or another entity) and where in the source text the mention occurs.
Members
ew::core::ContentId ew::app::Backlink::source
The object whose text mentions the target.
qsizetype ew::app::Backlink::offset = 0
Code-unit offset of the mention within the source text.
qsizetype ew::app::Backlink::length = 0
Length of the mention in code units.
bool operator==(const Backlink &, const Backlink &)=default
Backlinks compare equal when every field matches.
BacklinkIndex class
class ew::app::BacklinkIndex
A reverse index of entity mentions: for any entity, which objects mention it. It is built by scanning every document body and every entity's field values with an EntityLinker, so it captures both prose references and derived links (e.g. an entity whose "homeland" field names another entity). Call rebuild() after content changes.
Members
ew::app::BacklinkIndex::BacklinkIndex(const ew::core::Project &project)
Builds a project-only index over project (no mounted libraries).
ew::app::BacklinkIndex::BacklinkIndex(const ew::core::Project &project, const MountedLibraries &libraries)
Spanning constructor: indexes the project plus every mounted library, so a mention of a shared-library entity (or a reference from a library object) registers as a backlink too – keeping backlinks consistent with the mount-spanning auto-linker and relationship graph.
void ew::app::BacklinkIndex::rebuild()
Rebuilds the index from the current project (and mounted-library) state.
std::vector< Backlink > ew::app::BacklinkIndex::backlinksTo(ew::core::ContentId target) const
Returns every mention of target across the span, ordered by source id.