KiCad PCB EDA Suite
Loading...
Searching...
No Matches
kicad_io_utils.h File Reference
#include <optional>
#include <wx/buffer.h>
#include <wx/stream.h>
#include <wx/string.h>
#include <kicommon.h>

Go to the source code of this file.

Namespaces

namespace  KICAD_FORMAT
 

Functions

void KICAD_FORMAT::FormatBool (OUTPUTFORMATTER *aOut, const wxString &aKey, bool aValue)
 Writes a boolean to the formatter, in the style (aKey [yes|no])
 
void KICAD_FORMAT::FormatOptBool (OUTPUTFORMATTER *aOut, const wxString &aKey, std::optional< bool > aValue)
 Writes an optional boolean to the formatter.
 
void KICAD_FORMAT::FormatUuid (OUTPUTFORMATTER *aOut, const KIID &aUuid)
 
void KICAD_FORMAT::FormatCustomProperties (OUTPUTFORMATTER *aOut, const EDA_ITEM &aItem)
 Writes the item's custom properties as a series of (custom_property "key" "value")
 
void KICAD_FORMAT::FormatStreamData (OUTPUTFORMATTER &aOut, const wxStreamBuffer &aStream)
 Write binary data to the formatter as base 64 encoded string.
 
void KICAD_FORMAT::Prettify (std::string &aSource, FORMAT_MODE aMode=FORMAT_MODE::NORMAL)
 Pretty-prints s-expression text according to KiCad format rules.
 
KICOMMON_API bool LoadFileToMemory (const wxString &aFileName, wxMemoryBuffer &aBuffer)
 Load the contents of a file into a memory buffer.
 

Variables

 NORMAL
 Follows standard pretty-printing rules.
 
 COMPACT_TEXT_PROPERTIES
 Collapses certain text properties to single-line.
 

Function Documentation

◆ LoadFileToMemory()

KICOMMON_API bool LoadFileToMemory ( const wxString & aFileName,
wxMemoryBuffer & aBuffer )

Load the contents of a file into a memory buffer.

Parameters
aFileNameis the file to read.
aBufferreceives the file contents.
Returns
true when the file was read, false when the file cannot be read or is empty.

Definition at line 358 of file kicad_io_utils.cpp.

Variable Documentation

◆ COMPACT_TEXT_PROPERTIES

COMPACT_TEXT_PROPERTIES

Collapses certain text properties to single-line.

Definition at line 80 of file kicad_io_utils.h.

◆ NORMAL

NORMAL

Follows standard pretty-printing rules.

Definition at line 79 of file kicad_io_utils.h.

Referenced by PAD_TOOL::PAD_TOOL(), and PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS().