34 while(
OBJECT* obj =
co_await aAr.Object() )
35 aItems.push_back( obj );
41 while(
co_await aAr.Object() )
47 bool isDesignItem(
const OBJECT* aObject )
54 constexpr FIELD_ROW FREE_PAD_ARRAY[] = { { 0, INT_MAX,
"b2 i" } };
55 constexpr FIELD_ROW RULER_STOP_SET[] = { { 0, INT_MAX,
"s o2" } };
56 constexpr FIELD_ROW ERROR_MARK[] = { { 0, INT_MAX,
"i o i4" }, { 8002, INT_MAX,
"s" }, { 13000, INT_MAX,
"1" } };
59 constexpr FIELD_ROW DIMENSION[] = { { 0, INT_MAX,
"o i13" },
60 { 14003, INT_MAX,
"s 12" },
61 { 18000, INT_MAX,
"i5 1 i s2 i b2 i8 1" },
62 { 29000, INT_MAX,
"i4" },
63 { 29002, INT_MAX,
"o i o i f2 1 f" } };
116 for( uint32_t i = aAr.
Count(); i > 0; --i )
145 if(
Closed && prev && first )
163 return last && last->
Next;
169 const bool early =
Schema > 1;
175 if( isDesignItem(
Parent ) )
177 int v =
Parent->ItemFormat( aAr );
178 fmt = v >= 27001 ? 3 : ( v >= 2106 ? 2 : 1 );
190 return isDesignItem(
Parent ) ?
Parent->ItemFormat( aAr ) : 0;
198 if( isDesignItem(
Parent ) &&
Parent->ItemFormat( aAr ) > 12001 )
199 co_await readUntilNull( aAr,
Cutouts );
236 if( v >= 4000 && v < 8000 )
303 const uint32_t v =
static_cast<uint32_t
>(
ItemFormat( aAr ) );
319 if( v >= 6000 && v <= 8002 )
323 if( v > 8999 && v < 11000 )
398 const uint32_t v =
static_cast<uint32_t
>(
ItemFormat( aAr ) );
407 if( v >= 19000 && v <= 20999 &&
Types == ~uint64_t( 0 ) )
431 co_await aAr.
Embedded( list,
"CDesignList" );
438 co_await readUntilNull( aAr,
Members );
442 co_await skipUntilNull( aAr );
443 co_await skipUntilNull( aAr );
487 "CTextInstanceArray",
"CValuePositionArray",
"CRulerStopArray",
488 "CRulerStopSetArray",
"COriginList",
"CErrorArray",
"CGroupList" } );
One archive load stream; it owns every object it creates.
void SetShapeFormat(int aFormat)
EMBEDDED_AWAITER Embedded(OBJECT &aObject, const char *aClass)
wxString ReadString()
ANSI (windows-1252) or the 0xFF 0xFFFE UTF-16 form.
TYPED_AWAITER< T > ObjectAs()
bool InBool()
one or four bytes, depending on the active format
uint32_t Count()
a 16-bit count, 0xFFFF escaping to 32 bits
A loader coroutine. Awaiting one queues it on its archive's frame stack instead of nesting the call.
Shapes, vertices and the free-standing drawn items.
Free pads, apart because they derive from a connectivity class.
std::map< std::string, std::function< std::unique_ptr< OBJECT >()>, std::less<> > REGISTRY
void RegisterGeometryClasses(REGISTRY &aReg)
LOAD_TASK SkipFields(ARCHIVE &aAr, std::string_view aOps)
Read and drop a run of fields described by aOps, each letter optionally followed by a repeat count: b...
constexpr char THERMAL_RULE_SET[]
A thermal rule set as SkipFields ops: owner, four thermal rules (owner and an int array),...
void RegisterSkipped(REGISTRY &aReg, const char *aName, std::span< const FIELD_ROW > aRows)
void Register(REGISTRY &aReg, std::initializer_list< const char * > aNames)
Register the class names whose objects load as a T.
POINT32 ReadPoint(ARCHIVE &aAr)
A run of fields present from version since to until inclusive.
Root of every deserialized object.
uint16_t Schema
object schema from the class tag, 0 for an embedded member
virtual int ItemFormat(const ARCHIVE &aAr) const
The version this object gates on; the base is the archive's current read format.
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
OBJECT * Copper
design list of the stored pour
int ItemFormat(const ARCHIVE &aAr) const override
The owning shape's parent's format, 0 without one.
LOAD_TASK LoadTail(ARCHIVE &aAr) override
The fields a subclass reads after the next vertex.
int ItemFormat(const ARCHIVE &aAr) const override
The version this object gates on; the base is the archive's current read format.
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
The base of nearly every class.
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
int ItemFormat(const ARCHIVE &aAr) const override
The version this object gates on; the base is the archive's current read format.
A list: owner tag, then the items.
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
std::vector< OBJECT * > Cutouts
int32_t Type
0 shape, 1 poured, 2 teardrop, 5 to 7 dimension parts
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
OBJECT * OldPinNumber
version below 10003
OBJECT * OldPinName
version below 10003
OBJECT * ValuePositions
version 10003 on
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
std::vector< OBJECT * > Members
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
int32_t Flags
bit 0 tight, bit 1 local
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
bool HasNextRef
the stream carried a next vertex (shape format below 3)
virtual LOAD_TASK LoadTail(ARCHIVE &aAr)
The fields a subclass reads after the next vertex.
int32_t ArcAngle
swept angle, 0 for a straight span
SOURCE_SEGMENT * Next
null on an open shape's terminator
LOAD_TASK Load(ARCHIVE &aAr) final
Read this object's fields.
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
OBJECT * Shape
design shape
bool IsClosed() const
The last vertex links back to the first (formats 1 and 2) or the closed byte is set (format 3)
LOAD_TASK LoadShape(ARCHIVE &aAr, int aFormat)
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
std::vector< OBJECT * > Segments
the vertex list as read
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
LOAD_TASK LoadRemainder(ARCHIVE &aAr)
The text position fields that follow the item fields.
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.