KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SHAPE_FILE_IO Class Reference

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 ()
 
SHAPERead ()
 
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
 

Detailed Description

Helper class for saving/loading shapes from a file.

Definition at line 39 of file shape_file_io.h.

Member Enumeration Documentation

◆ IO_MODE

Enumerator
IOM_READ 
IOM_APPEND 
IOM_WRITE 

Definition at line 42 of file shape_file_io.h.

Constructor & Destructor Documentation

◆ SHAPE_FILE_IO() [1/2]

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() [2/2]

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::~SHAPE_FILE_IO ( )

Definition at line 67 of file shape_file_io.cpp.

References IOM_READ, m_file, m_groupActive, and m_mode.

Member Function Documentation

◆ BeginGroup()

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.

◆ EndGroup()

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.

◆ Read()

SHAPE * SHAPE_FILE_IO::Read ( )

Definition at line 82 of file shape_file_io.cpp.

◆ Write() [1/2]

void SHAPE_FILE_IO::Write ( const SHAPE aShape,
const std::string &  aName = "<noname>" 
)
inline

Definition at line 60 of file shape_file_io.h.

References Write().

◆ Write() [2/2]

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().

Referenced by process(), and Write().

Member Data Documentation

◆ m_file

FILE* SHAPE_FILE_IO::m_file
private

Definition at line 66 of file shape_file_io.h.

Referenced by BeginGroup(), EndGroup(), SHAPE_FILE_IO(), Write(), and ~SHAPE_FILE_IO().

◆ m_groupActive

bool SHAPE_FILE_IO::m_groupActive
private

Definition at line 67 of file shape_file_io.h.

Referenced by BeginGroup(), EndGroup(), SHAPE_FILE_IO(), Write(), and ~SHAPE_FILE_IO().

◆ m_mode

IO_MODE SHAPE_FILE_IO::m_mode
private

Definition at line 68 of file shape_file_io.h.

Referenced by BeginGroup(), EndGroup(), SHAPE_FILE_IO(), Write(), and ~SHAPE_FILE_IO().


The documentation for this class was generated from the following files: