KiCad PCB EDA Suite
richio.h File Reference
#include <vector>
#include <utf8.h>
#include <wx/wx.h>
#include <stdio.h>
#include <ki_exception.h>

Go to the source code of this file.

Classes

class  LINE_READER
 Class LINE_READER is an abstract class from which implementation specific LINE_READERs may be derived to read single lines of text and manage a line number counter. More...
 
class  FILE_LINE_READER
 Class FILE_LINE_READER is a LINE_READER that reads from an open file. More...
 
class  STRING_LINE_READER
 Class STRING_LINE_READER is a LINE_READER that reads from a multiline 8 bit wide std::string. More...
 
class  INPUTSTREAM_LINE_READER
 Class INPUTSTREAM_LINE_READER is a LINE_READER that reads from a wxInputStream object. More...
 
class  OUTPUTFORMATTER
 Class OUTPUTFORMATTER is an important interface (abstract class) used to output 8 bit text in a convenient way. More...
 
class  STRING_FORMATTER
 Class STRING_FORMATTER implements OUTPUTFORMATTER to a memory buffer. More...
 
class  FILE_OUTPUTFORMATTER
 Class FILE_OUTPUTFORMATTER may be used for text file output. More...
 
class  STREAM_OUTPUTFORMATTER
 Class STREAM_OUTPUTFORMATTER implements OUTPUTFORMATTER to a wxWidgets wxOutputStream. More...
 

Macros

#define LINE_READER_LINE_DEFAULT_MAX   100000
 
#define LINE_READER_LINE_INITIAL_SIZE   5000
 
#define OUTPUTFMTBUFZ   500
 default buffer size for any OUTPUT_FORMATTER More...
 
#define PRINTF_FUNC
 

Functions

int StrPrintf (std::string *aResult, const char *aFormat,...)
 Function StrPrintf is like sprintf() but the output is appended to a std::string instead of to a character array. More...
 
std::string StrPrintf (const char *format,...)
 Function StrPrintf is like sprintf() but the output is returned in a std::string instead of to a character array. More...
 

Macro Definition Documentation

#define LINE_READER_LINE_DEFAULT_MAX   100000

Definition at line 73 of file richio.h.

#define LINE_READER_LINE_INITIAL_SIZE   5000

Definition at line 74 of file richio.h.

Referenced by LINE_READER::LINE_READER().

#define OUTPUTFMTBUFZ   500

default buffer size for any OUTPUT_FORMATTER

Definition at line 309 of file richio.h.

#define PRINTF_FUNC

Definition at line 379 of file richio.h.

Function Documentation

int StrPrintf ( std::string *  aResult,
const char *  aFormat,
  ... 
)

Function StrPrintf is like sprintf() but the output is appended to a std::string instead of to a character array.

Parameters
aResultis the string to append to, previous text is not clear()ed.
aFormatis a printf() style format string.
Returns
int - the count of bytes appended to the result string, no terminating nul is included.

Definition at line 75 of file richio.cpp.

References vprint().

Referenced by PCB_BASE_FRAME::Build_Board_Ratsnest(), checkConnectedTo(), fmt_mask(), GITHUB_PLUGIN::FootprintDelete(), GITHUB_PLUGIN::FootprintSave(), PCB_IO::format(), FormatProbeItem(), GenCADLayerName(), GenCADLayerNameFlipped(), PCB_PARSER::init(), EXCELLON_WRITER::layerName(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), KICAD_CURL_EASY::Perform(), GITHUB_GETLIBLIST::remoteGetJSON(), GITHUB_PLUGIN::remoteGetZip(), ReplaceIllegalFileNameChars(), and CVPCB_MAINFRAME::SendMessageToEESCHEMA().

76 {
77  va_list args;
78 
79  va_start( args, format );
80  int ret = vprint( result, format, args );
81  va_end( args );
82 
83  return ret;
84 }
static int vprint(std::string *result, const char *format, va_list ap)
Definition: richio.cpp:38
std::string StrPrintf ( const char *  format,
  ... 
)

Function StrPrintf is like sprintf() but the output is returned in a std::string instead of to a character array.

Parameters
formatis a printf() style format string.
Returns
std::string - the result of the sprintf().

Definition at line 87 of file richio.cpp.

References vprint().

88 {
89  std::string ret;
90  va_list args;
91 
92  va_start( args, format );
93  int ignore = vprint( &ret, format, args );
94  (void) ignore;
95  va_end( args );
96 
97  return ret;
98 }
static int vprint(std::string *result, const char *format, va_list ap)
Definition: richio.cpp:38