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

#include <kicad_git_blob_reader.h>

Inheritance diagram for BLOB_READER:
LINE_READER

Public Member Functions

 BLOB_READER (git_blob *aBlob)
 
 ~BLOB_READER () override
 
char * ReadLine () override
 Read a line of text into the buffer and increments the line number counter.
 
virtual const wxString & GetSource () const
 Returns the name of the source of the lines in an abstract sense.
 
char * Line () const
 Return a pointer to the last line that was read in.
 
 operator char * () const
 A casting operator that returns a char* pointer to the start of the line buffer.
 
virtual unsigned LineNumber () const
 Return the line number of the last line read from this LINE_READER.
 
unsigned Length () const
 Return the number of bytes in the last line read from this LINE_READER.
 

Protected Member Functions

void expandCapacity (unsigned aNewsize)
 Will expand the capacity of line up to maxLineLength but not greater, so be careful about making assumptions of capacity after calling this.
 

Protected Attributes

unsigned m_length
 no. bytes in line before trailing nul.
 
unsigned m_lineNum
 
char * m_line
 the read line of UTF8 text
 
unsigned m_capacity
 no. bytes allocated for line.
 
unsigned m_maxLineLength
 maximum allowed capacity using resizing.
 
wxString m_source
 origin of text lines, e.g. filename or "clipboard"
 

Private Attributes

git_blob * m_blob
 
BLOB_BUFFER_STREAMm_stream
 
std::istream * m_istream
 
std::string m_buffer
 

Detailed Description

Definition at line 59 of file kicad_git_blob_reader.h.

Constructor & Destructor Documentation

◆ BLOB_READER()

BLOB_READER::BLOB_READER ( git_blob *  aBlob)
inline

◆ ~BLOB_READER()

BLOB_READER::~BLOB_READER ( )
inlineoverride

Definition at line 70 of file kicad_git_blob_reader.h.

References m_istream, and m_stream.

Member Function Documentation

◆ expandCapacity()

void LINE_READER::expandCapacity ( unsigned  aNewsize)
protectedinherited

Will expand the capacity of line up to maxLineLength but not greater, so be careful about making assumptions of capacity after calling this.

Definition at line 165 of file richio.cpp.

References LINE_READER::m_capacity, LINE_READER::m_length, LINE_READER::m_line, and LINE_READER::m_maxLineLength.

Referenced by FILE_LINE_READER::ReadLine(), STRING_LINE_READER::ReadLine(), and INPUTSTREAM_LINE_READER::ReadLine().

◆ GetSource()

virtual const wxString & LINE_READER::GetSource ( ) const
inlinevirtualinherited

◆ Length()

unsigned LINE_READER::Length ( ) const
inlineinherited

◆ Line()

char * LINE_READER::Line ( ) const
inlineinherited

Return a pointer to the last line that was read in.

Definition at line 129 of file richio.h.

Referenced by bench_string_lr(), bench_string_lr_reuse(), bench_wxbis(), bench_wxbis_reuse(), bench_wxis(), bench_wxis_reuse(), PCB_IO_KICAD_LEGACY::biuParse(), PCB_IO_KICAD_LEGACY::CanReadFootprint(), PCB_IO_KICAD_LEGACY::degParse(), PCB_IO_KICAD_LEGACY::getVersion(), NETLIST_READER::GuessNetlistFileType(), PCB_IO_GEDA::ImportFootprint(), SCH_IO_KICAD_LEGACY_LIB_CACHE::Load(), CMP_READER::Load(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadAliases(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadArc(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadBezier(), SCH_IO_KICAD_LEGACY::loadBitmap(), SCH_IO_KICAD_LEGACY::loadBusAlias(), SCH_IO_KICAD_LEGACY::loadBusEntry(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadCircle(), SCH_IO_KICAD_LEGACY::LoadContent(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadDocs(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadDrawEntries(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadField(), SCH_IO_KICAD_LEGACY::loadFile(), EXCELLON_IMAGE::LoadFile(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadFootprintFilters(), PCB_IO_KICAD_LEGACY::loadFP_SHAPE(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadHeader(), SCH_IO_KICAD_LEGACY::loadHeader(), SCH_IO_KICAD_LEGACY::loadJunction(), BITMAP_BASE::LoadLegacyData(), PCB_IO_KICAD_LEGACY::loadMODULE_TEXT(), LP_CACHE::LoadModules(), LEGACY_NETLIST_READER::LoadNetlist(), SCH_IO_KICAD_LEGACY::loadNoConnect(), SCH_IO_KICAD_LEGACY::loadPageSettings(), SCH_IO_KICAD_LEGACY_LIB_CACHE::LoadPart(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadPin(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadPolyLine(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadRect(), SCH_IO_KICAD_LEGACY::loadSymbol(), SCH_IO_KICAD_LEGACY::loadText(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadText(), PCB_IO_KICAD_LEGACY::loadTrackList(), SCH_IO_KICAD_LEGACY::loadWire(), GPCB_FPL_CACHE::parseParameters(), DSNLEXER::PopReader(), SCH_EDITOR_CONTROL::processCmpToFootprintLinkFile(), MWAVE_POLYGONAL_SHAPE_DLG::ReadDataShapeDescr(), FILTER_READER::ReadLine(), SafeReadFile(), LP_CACHE::SkipIndex(), EXCELLON_IMAGE::TestFileIsExcellon(), and GERBER_FILE_IMAGE::TestFileIsRS274().

◆ LineNumber()

◆ operator char *()

LINE_READER::operator char * ( ) const
inlineinherited

A casting operator that returns a char* pointer to the start of the line buffer.

Definition at line 137 of file richio.h.

◆ ReadLine()

char * BLOB_READER::ReadLine ( )
inlineoverridevirtual

Read a line of text into the buffer and increments the line number counter.

If the line is larger than the maximum length passed to the constructor, then an exception is thrown. The line is nul terminated.

Returns
The beginning of the read line, or NULL if EOF.
Exceptions
IO_ERRORwhen a line is too long.

Implements LINE_READER.

Definition at line 76 of file kicad_git_blob_reader.h.

References m_buffer, m_istream, LINE_READER::m_length, LINE_READER::m_line, and LINE_READER::m_lineNum.

Member Data Documentation

◆ m_blob

git_blob* BLOB_READER::m_blob
private

Definition at line 93 of file kicad_git_blob_reader.h.

Referenced by BLOB_READER().

◆ m_buffer

std::string BLOB_READER::m_buffer
private

Definition at line 96 of file kicad_git_blob_reader.h.

Referenced by ReadLine().

◆ m_capacity

unsigned LINE_READER::m_capacity
protectedinherited

◆ m_istream

std::istream* BLOB_READER::m_istream
private

Definition at line 95 of file kicad_git_blob_reader.h.

Referenced by BLOB_READER(), ReadLine(), and ~BLOB_READER().

◆ m_length

◆ m_line

◆ m_lineNum

◆ m_maxLineLength

unsigned LINE_READER::m_maxLineLength
protectedinherited

maximum allowed capacity using resizing.

Definition at line 173 of file richio.h.

Referenced by LINE_READER::expandCapacity(), FILE_LINE_READER::ReadLine(), STRING_LINE_READER::ReadLine(), and INPUTSTREAM_LINE_READER::ReadLine().

◆ m_source

wxString LINE_READER::m_source
protectedinherited

◆ m_stream

BLOB_BUFFER_STREAM* BLOB_READER::m_stream
private

Definition at line 94 of file kicad_git_blob_reader.h.

Referenced by BLOB_READER(), and ~BLOB_READER().


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