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::library::MountedLibraries::MountedLibraries()

Constructs an empty set with no libraries loaded.

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

Destroys the set, releasing every loaded library.

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

Not copyable.

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

Not movable.

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

Not copy-assignable.

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

Not move-assignable.

void ew::app::library::MountedLibraries::reload(const ew::core::project::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). Replaces the currently loaded set.

A mount that fails to load is skipped rather than aborting the others – one moved folder must not stop a project opening – but it is recorded in unresolvedMounts so the failure can be reported. Skipping silently is not an option: a mount whose folder has moved leaves its content simply absent, which reads to the writer as corrupted data rather than a broken path, and mounts are the shared-universe feature whose paths legitimately differ between machines.

const std::vector< ew::core::project::LibraryMount > & ew::app::library::MountedLibraries::unresolvedMounts() const

The mounts from the last reload whose library could not be loaded, in mount order, each carrying the path as configured. Empty when every mount resolved. Callers surface these to the writer; libraries holds only the ones that did load.

void ew::app::library::MountedLibraries::add(std::unique_ptr< ew::core::project::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::library::MountedLibraries::clear()

Drops all loaded libraries.

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

The loaded libraries, in mount order.

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

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

const ew::core::project::Project * ew::app::library::MountedLibraries::ownerOf(const ew::core::project::Project &mainProject, ew::core::foundation::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::foundation::ContentId > ew::app::library::MountedLibraries::ids(const ew::core::project::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::library::MountedLibraries::isWritable(const ew::core::project::Project &mainProject, ew::core::foundation::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::Project> ew::app::library::MountedLibrary::project

The loaded library content repo.

QString ew::app::library::MountedLibrary::name

The library's display name.

QString ew::app::library::MountedLibrary::path

The library's source path (as recorded on the mount), which may be relative.

QString ew::app::library::MountedLibrary::directory

The absolute directory the library was loaded from. A relative path is resolved once, by reload(), against the base the caller supplies – for a single-file .ewriter project that base is the folder holding the .ewriter FILE, which is NOT the working copy the project's own assets live in. Consumers that need a library-relative file (a cover image, a media asset, a write-back) must use this rather than re-deriving it from a project directory, which silently resolves against the wrong base for a bundle project. For a library handed to add() directly there is no base, so its recorded path is taken as its directory.

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

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