KiCad PCB EDA Suite
|
Helper class for saving/loading shapes from a file. More...
#include <shape_file_io.h>
Public Types | |
enum | IO_MODE { IOM_READ = 0 , IOM_APPEND , IOM_WRITE } |
Public Member Functions | |
SHAPE_FILE_IO () | |
SHAPE_FILE_IO (const std::string &aFilename, IO_MODE aMode=IOM_READ) | |
~SHAPE_FILE_IO () | |
void | BeginGroup (const std::string &aName="<noname>") |
void | EndGroup () |
SHAPE * | Read () |
void | Write (const SHAPE *aShape, const std::string &aName="<noname>") |
void | Write (const SHAPE &aShape, const std::string &aName="<noname>") |
Private Attributes | |
FILE * | m_file |
bool | m_groupActive |
IO_MODE | m_mode |
Helper class for saving/loading shapes from a file.
Definition at line 39 of file shape_file_io.h.
Enumerator | |
---|---|
IOM_READ | |
IOM_APPEND | |
IOM_WRITE |
Definition at line 42 of file shape_file_io.h.
SHAPE_FILE_IO::SHAPE_FILE_IO | ( | ) |
Definition at line 34 of file shape_file_io.cpp.
References IOM_WRITE, m_file, m_groupActive, and m_mode.
SHAPE_FILE_IO::SHAPE_FILE_IO | ( | const std::string & | aFilename, |
SHAPE_FILE_IO::IO_MODE | aMode = IOM_READ |
||
) |
Definition at line 42 of file shape_file_io.cpp.
References IOM_APPEND, IOM_READ, IOM_WRITE, m_file, m_groupActive, and m_mode.
SHAPE_FILE_IO::~SHAPE_FILE_IO | ( | ) |
Definition at line 67 of file shape_file_io.cpp.
References IOM_READ, m_file, m_groupActive, and m_mode.
void SHAPE_FILE_IO::BeginGroup | ( | const std::string & | aName = "<noname>" | ) |
Definition at line 120 of file shape_file_io.cpp.
References IOM_READ, m_file, m_groupActive, and m_mode.
void SHAPE_FILE_IO::EndGroup | ( | ) |
Definition at line 132 of file shape_file_io.cpp.
References IOM_READ, m_file, m_groupActive, and m_mode.
SHAPE * SHAPE_FILE_IO::Read | ( | ) |
Definition at line 82 of file shape_file_io.cpp.
|
inline |
Definition at line 60 of file shape_file_io.h.
References Write().
void SHAPE_FILE_IO::Write | ( | const SHAPE * | aShape, |
const std::string & | aName = "<noname>" |
||
) |
Definition at line 144 of file shape_file_io.cpp.
References SHAPE::Format(), IOM_READ, m_file, m_groupActive, m_mode, and SHAPE_BASE::Type().
|
private |
Definition at line 66 of file shape_file_io.h.
Referenced by BeginGroup(), EndGroup(), SHAPE_FILE_IO(), Write(), and ~SHAPE_FILE_IO().
|
private |
Definition at line 67 of file shape_file_io.h.
Referenced by BeginGroup(), EndGroup(), SHAPE_FILE_IO(), Write(), and ~SHAPE_FILE_IO().
|
private |
Definition at line 68 of file shape_file_io.h.
Referenced by BeginGroup(), EndGroup(), SHAPE_FILE_IO(), Write(), and ~SHAPE_FILE_IO().