KiCad PCB EDA Suite
Loading...
Searching...
No Matches
easypc_archive.h File Reference

Reader for the serialized streams of Easy-PC and DesignSpark PCB. More...

#include <coroutine>
#include <cstdint>
#include <exception>
#include <functional>
#include <initializer_list>
#include <map>
#include <memory>
#include <span>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include <wx/string.h>

Go to the source code of this file.

Classes

class  EASYPC::LOAD_TASK
 A loader coroutine. Awaiting one queues it on its archive's frame stack instead of nesting the call. More...
 
struct  EASYPC::LOAD_TASK::promise_type
 
struct  EASYPC::OBJECT
 Root of every deserialized object. More...
 
class  EASYPC::ARCHIVE
 One archive load stream; it owns every object it creates. More...
 
class  EASYPC::ARCHIVE::OBJECT_AWAITER
 The next object tag for a loader to co_await: null, a back reference, or a new object fully loaded. More...
 
class  EASYPC::ARCHIVE::TYPED_AWAITER< T >
 Object that must be a T or null. More...
 
class  EASYPC::ARCHIVE::EMBEDDED_AWAITER
 An embedded member for a loader to co_await: no tag and no load-array slot. More...
 
struct  EASYPC::ARCHIVE::FRAME
 
struct  EASYPC::ARCHIVE::SLOT
 
struct  EASYPC::FIELD_ROW
 A run of fields present from version since to until inclusive. More...
 
struct  EASYPC::SKIPPED< BASE >
 A class no importer reads: its base's fields, then a field program on its format. More...
 

Namespaces

namespace  EASYPC
 

Typedefs

using EASYPC::REGISTRY = std::map<std::string, std::function<std::unique_ptr<OBJECT>()>, std::less<>>
 

Enumerations

enum class  EASYPC::DOC_KIND {
  EASYPC::PCB , EASYPC::SCHEMATIC , EASYPC::PCB_SYMBOL , EASYPC::SCH_SYMBOL ,
  EASYPC::COMPONENT , EASYPC::PROJECT
}
 Document kind, from the FileType stream or the file extension for projects. More...
 
enum  EASYPC::PRODUCT_KEY : int32_t {
  EASYPC::PRODUCT_EASYPC = 1 , EASYPC::PRODUCT_DESIGNSPARK = 0x943e3 , EASYPC::PRODUCT_DESIGNSPARK_CREATOR = 0xcf153 , EASYPC::PRODUCT_DESIGNSPARK_PRO = 0xe002e ,
  EASYPC::PRODUCT_PROTOPCB = 0x311f3
}
 Product keys, the design header's or the library LibFormat's. More...
 

Functions

template<typename T>
void EASYPC::Register (REGISTRY &aReg, std::initializer_list< const char * > aNames)
 Register the class names whose objects load as a T.
 
void EASYPC::RegisterRootClasses (REGISTRY &aReg)
 
void EASYPC::RegisterStyleClasses (REGISTRY &aReg)
 
void EASYPC::RegisterGeometryClasses (REGISTRY &aReg)
 
void EASYPC::RegisterLibraryClasses (REGISTRY &aReg)
 
void EASYPC::RegisterConnectivityClasses (REGISTRY &aReg)
 
LOAD_TASK EASYPC::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 a format-dependent boolean, 1 a byte, i an int32, f a double, s a string, o an object, a a counted int32 array.
 
LOAD_TASK EASYPC::SkipRows (ARCHIVE &aAr, int aVersion, std::span< const FIELD_ROW > aRows)
 SkipFields for every row aVersion falls in, in order.
 
template<typename BASE>
void EASYPC::RegisterSkipped (REGISTRY &aReg, const char *aName, std::span< const FIELD_ROW > aRows)
 

Detailed Description

Reader for the serialized streams of Easy-PC and DesignSpark PCB.

The format has no lengths: classes and objects share one load array that back references index, so every byte must be consumed in stream order. Loaders are coroutines run from an explicit frame stack, because the cyclic net, node and pad graph of a real design nests objects hundreds deep at their first reference.

Definition in file easypc_archive.h.