KiCad PCB EDA Suite
Loading...
Searching...
No Matches
shape_file_io.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 (C) 2015 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Tomasz Wlostowski <[email protected]>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
23
24#ifndef __SHAPE_FILE_IO_H
25#define __SHAPE_FILE_IO_H
26
27#include <cstdio>
28#include <string> // for string
29
30class SHAPE;
31
36{
37public:
44
46 SHAPE_FILE_IO( const std::string& aFilename, IO_MODE aMode = IOM_READ );
48
49 void BeginGroup( const std::string& aName = "<noname>");
50 void EndGroup();
51
52 SHAPE* Read();
53
54 void Write( const SHAPE* aShape, const std::string& aName = "<noname>" );
55
56 void Write( const SHAPE& aShape, const std::string& aName = "<noname>" )
57 {
58 Write( &aShape, aName );
59 }
60
61private:
62 FILE* m_file;
65};
66
67#endif // __SHAPE_FILE_IO_H
void Write(const SHAPE &aShape, const std::string &aName="<noname>")
void Write(const SHAPE *aShape, const std::string &aName="<noname>")
void BeginGroup(const std::string &aName="<noname>")
An abstract shape on 2D plane.
Definition shape.h:124