KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pads_sch_binary_reader.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your option)
9 * any later version.
10 */
11
12#pragma once
13
16
17#include <cstdint>
18#include <optional>
19#include <vector>
20
21#include <wx/string.h>
22
23class SCHEMATIC;
24class SCH_SHEET;
25
26namespace PADS_SCH_BINARY
27{
28
30{
31public:
32 static bool IsBinaryFamily( const std::vector<uint8_t>& aData );
33 static bool IsSupportedVersion( uint16_t aVersion );
34 static bool IsBinarySch( const std::vector<uint8_t>& aData );
35 static bool ReadFile( const wxString& aFileName, std::vector<uint8_t>& aData );
36
37 bool Parse( const std::vector<uint8_t>& aData, const wxString& aSourceName = {} );
38
39 const PADS_SCH_MODEL& GetModel() const;
40
41 BUILD_RESULT BuildSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aAppendToMe, const wxString& aSourcePath ) const;
42
43private:
44 std::optional<PADS_SCH_MODEL> m_model;
45};
46
47} // namespace PADS_SCH_BINARY
static bool ReadFile(const wxString &aFileName, std::vector< uint8_t > &aData)
static bool IsBinarySch(const std::vector< uint8_t > &aData)
bool Parse(const std::vector< uint8_t > &aData, const wxString &aSourceName={})
static bool IsSupportedVersion(uint16_t aVersion)
static bool IsBinaryFamily(const std::vector< uint8_t > &aData)
BUILD_RESULT BuildSchematic(SCHEMATIC *aSchematic, SCH_SHEET *aAppendToMe, const wxString &aSourcePath) const
std::optional< PADS_SCH_MODEL > m_model
Holds all the data relating to one schematic.
Definition schematic.h:148
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:48