EntitySplit.h header

#include <ew/app/EntitySplit.h>

Namespace ew::app

Functions

std::unique_ptr< ew::core::Command > ew::app::buildSplitEntityCommand(ew::core::Project &project, ew::core::ContentId sourceId, ew::core::ContentId newId, const QString &newName, const std::vector< QString > &fieldKeysToCopy, bool copyLifespan)

Builds an undoable command that splits a new entity off sourceId within project: it creates a fresh entity with identity newId and display name newName in the source's category, copying the field values named in fieldKeysToCopy (those the source actually has) and, when copyLifespan is set, the source's birth/death instants. The source entity is left untouched – a split duplicates the shared parts into a second entity so the writer can then divide the references and prose between the two by hand (which reference belongs to which is a judgement the tool cannot make). Applying adds the new entity; undo removes it.

Returns null when the split is not well-formed: sourceId does not identify an entity in project, newId is null or already in use, or newName is blank.