TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
board_reader.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: GPL-3.0-or-later
2
#pragma once
3
// Reads .kicad_pcb files (KiCad 9 and 10 formats) into the board model, keeping the s-expression document
4
// for lossless writing.
5
#include <string>
6
7
#include "
model/board.hpp
"
8
#include "
sexpr/sexpr.hpp
"
9
10
namespace
tmk::io
{
11
12
struct
LoadedBoard
{
13
sexpr::Document
doc
;
14
model::Board
board
;
15
};
16
17
// Throws sexpr::ParseError or std::runtime_error on malformed files.
18
LoadedBoard
read_board_file
(
const
std::string& path);
19
// Reads the board as the document would be written: pending edits are applied first (the returned board's node
20
// ids then refer to the re-parsed text, so do not use them to edit `doc` further).
21
model::Board
read_board
(
const
sexpr::Document
& doc);
22
23
}
// namespace tmk::io
board.hpp
The board model (design doc 02 §3): every object TraceMaker reads from a .kicad_pcb,...
tmk::sexpr::Document
Definition
sexpr.hpp:45
tmk::io
Definition
board_editor.hpp:12
tmk::io::read_board
model::Board read_board(const sexpr::Document &doc)
Reads the board as the document would be written: pending edits are applied first (the returned board...
tmk::io::read_board_file
LoadedBoard read_board_file(const std::string &path)
Throws sexpr::ParseError or std::runtime_error on malformed files.
sexpr.hpp
Lossless s-expression documents for KiCad files (design doc 08 §3).
tmk::io::LoadedBoard
Definition
board_reader.hpp:12
tmk::io::LoadedBoard::doc
sexpr::Document doc
Definition
board_reader.hpp:13
tmk::io::LoadedBoard::board
model::Board board
Definition
board_reader.hpp:14
tmk::model::Board
Definition
board.hpp:186
io
kicad
board_reader.hpp
Generated by
1.15.0