CampfireImport.h header

#include <ew/app/CampfireImport.h>

Namespace ew::app

Functions

ImportedManuscript ew::app::import::buildCampfireDocuments(const QJsonObject &root, const QString &exportName)

Turns a Campfire project export into an importable manuscript rooted at exportName.

Shape-discovering rather than schema-bound, for the same reason the World Anvil importer is header-driven: Campfire's export nests its content under names that vary with the modules a project uses, and a hard-coded path would import one project perfectly and silently miss most of another. So this walks the JSON, treats any object carrying a name-like field as an entry, and files it under a container named after whatever held it.

Every scalar field on an entry is kept, written into the body as a labelled field, because a key this code does not recognise is still something the author wrote. Nesting becomes nesting: an object under an object becomes a child document, so a project's structure survives even where its vocabulary is unfamiliar.

Pure and deterministic given root. Documents are returned by pointer (content objects are non-copyable), root first, parents before children.

ImportedManuscript ew::app::import::importCampfireJson(const QString &jsonPath)

Reads the Campfire JSON export at jsonPath and imports it via buildCampfireDocuments(), naming the root after the file.

Returns an empty result if the file is not readable or is not a JSON object.