Edit

edit/find

#include "dxfio/edit/find.hpp"

In DxfIO::Edit

Functions

auto Same(std::string_view one, std::string_view other) -> bool

Tells whether two DXF names are the same, as AutoCAD compares them: without case.

auto FindEntity(Document &drawing, Handle self) -> Entity *

Finds the entity of that handle in the ENTITIES section or in a block, or null. It looks at the entities of those lists only: the handle of a VERTEX, ATTRIB or SEQEND, which a POLYLINE or an INSERT carries in its Vertices or Attributes, finds null, and so does the null handle. The pointer holds until the list it points into changes, as Edit::Add and Audit::Repair change it.

auto FindEntity(const Document &drawing, Handle self) -> const Entity *

Finds the entity of that handle in the ENTITIES section or in a block, or null, as the other FindEntity does.

auto FindObject(Document &drawing, Handle self) -> Object *

Finds the object of that handle in the OBJECTS section, or null; the null handle finds null.

auto FindObject(const Document &drawing, Handle self) -> const Object *

Finds the object of that handle in the OBJECTS section, or null; the null handle finds null.

auto FindBlock(Document &drawing, std::string_view name) -> Blocks::Block *

Finds the block of that name, or null. The pointer holds until the list of blocks changes, as Edit::AddBlock changes it.

auto FindBlock(const Document &drawing, std::string_view name) -> const Blocks::Block *

Finds the block of that name, or null, as the other FindBlock does.

template <class RecordT> requires requires(const RecordT &record) { record.Record.Name; } auto Find(Tables::Table<RecordT> &table, std::string_view name) -> RecordT *

Finds the record of that name in a table, such as `Find(drawing.Layer, "Walls")`, or null. The pointer holds until the table's records change, as Edit::Add, Edit::AddBlock and Audit::Repair change them.

template <class RecordT> requires requires(const RecordT &record) { record.Record.Name; } auto Find(const Tables::Table<RecordT> &table, std::string_view name) -> const RecordT *

Finds the record of that name in a table, or null, as the other Find does.