MountedLibraries.h header

#include <ew/app/MountedLibraries.h>

Namespace ew::app

MountedLibraries class

class ew::app::MountedLibraries

Holds the shared libraries a project mounts and resolves content across them, so the working graph spans the project plus every mounted library (for linking, search, previews, maps, and timelines). Each library is a separate loaded content repo; ids resolve in the project first, then through the libraries in mount order.

Members

ew::app::MountedLibraries::MountedLibraries()

Constructs an empty set with no libraries loaded.

ew::app::MountedLibraries::~MountedLibraries()

Destroys the set, releasing every loaded library.

ew::app::MountedLibraries::MountedLibraries(const MountedLibraries &)=delete

Not copyable.

ew::app::MountedLibraries::MountedLibraries(MountedLibraries &&)=delete

Not movable.

MountedLibraries & ew::app::MountedLibraries::operator=(const MountedLibraries &)=delete

Not copy-assignable.

MountedLibraries & ew::app::MountedLibraries::operator=(MountedLibraries &&)=delete

Not move-assignable.

void ew::app::MountedLibraries::reload(const ew::core::Project &project, const QString &projectDir)

Loads the libraries project mounts (its mounts()), each from disk with its path resolved against projectDir (absolute paths are used as-is); mounts that fail to load are skipped. Replaces the currently loaded set.

void ew::app::MountedLibraries::add(std::unique_ptr< ew::core::Project > library, QString name, QString path, bool writable)

Adds an already-loaded library under name (from path) with the given writable permission, taking ownership. A null library is ignored. Used to compose libraries in memory.

void ew::app::MountedLibraries::clear()

Drops all loaded libraries.

const std::vector< MountedLibrary > & ew::app::MountedLibraries::libraries() const

The loaded libraries, in mount order.

ew::core::ContentObject * ew::app::MountedLibraries::find(const ew::core::Project &mainProject, ew::core::ContentId id) const

Resolves id in mainProject first, then each loaded library; null if not found.

const ew::core::Project * ew::app::MountedLibraries::ownerOf(const ew::core::Project &mainProject, ew::core::ContentId id) const

The project that owns id: mainProject if it contains id, otherwise the mounted library that does, or null if none owns it. Lets a consumer reach the object's own taxonomy (its category schema lives in its owning repo).

std::vector< ew::core::ContentId > ew::app::MountedLibraries::ids(const ew::core::Project &mainProject) const

The ids of every object across mainProject and all loaded libraries, deduplicated and in ascending order – the working graph a search or relationship view spans.

bool ew::app::MountedLibraries::isWritable(const ew::core::Project &mainProject, ew::core::ContentId id) const

Whether id may be edited: it lives in mainProject, or in a read/write library. An id found only in a read-only library is not writable.

MountedLibrary struct

struct ew::app::MountedLibrary

One library a project has mounted and loaded: the loaded content repo, its display name and source path, and whether the project may write into it.

Members

std::unique_ptr<ew::core::Project> ew::app::MountedLibrary::project

The loaded library content repo.

QString ew::app::MountedLibrary::name

The library's display name.

QString ew::app::MountedLibrary::path

The library's source path (as recorded on the mount).

bool ew::app::MountedLibrary::writable = false

Whether the project may write into this library (read/write); false means read-only.