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
10namespace tmk::io {
11
16
17// Throws sexpr::ParseError or std::runtime_error on malformed files.
18LoadedBoard 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).
22
23} // namespace tmk::io
The board model (design doc 02 §3): every object TraceMaker reads from a .kicad_pcb,...
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...
LoadedBoard read_board_file(const std::string &path)
Throws sexpr::ParseError or std::runtime_error on malformed files.
Lossless s-expression documents for KiCad files (design doc 08 §3).
sexpr::Document doc