KiCad PCB EDA Suite
|
#include <cstdarg>
#include <config.h>
#include <kiplatform/io.h>
#include <core/ignore.h>
#include <richio.h>
#include <errno.h>
#include <wx/file.h>
#include <wx/translation.h>
Go to the source code of this file.
Macros | |
#define | getc_unlocked getc |
#define | NESTWIDTH 2 |
Functions | |
static int | vprint (std::string *result, const char *format, va_list ap) |
int | StrPrintf (std::string *result, const char *format,...) |
This 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,...) |
This is like sprintf() but the output is returned in a std::string instead of to a character array. More... | |
wxString | SafeReadFile (const wxString &aFilePath, const wxString &aReadType) |
Nominally opens a file and reads it into a string. More... | |
#define getc_unlocked getc |
Definition at line 44 of file richio.cpp.
#define NESTWIDTH 2 |
wxString SafeReadFile | ( | const wxString & | aFilePath, |
const wxString & | aReadType | ||
) |
Nominally opens a file and reads it into a string.
But unlike other facilities, this handles mis-encded Wine-written files on macOS.
aFilePath | |
aReadType |
IO_ERROR | if the file can't be opened |
Definition at line 110 of file richio.cpp.
References _, LINE_READER::Line(), FILE_LINE_READER::ReadLine(), and THROW_IO_ERROR.
Referenced by LTSPICE_SCHEMATIC::Load(), SPICE_LIBRARY_PARSER::parseFile(), LTSPICE_SCHEMATIC::ReadAsyFiles(), and SPICE_LIBRARY_PARSER::readFallbacks().
std::string StrPrintf | ( | const char * | format, |
... | |||
) |
This is like sprintf() but the output is returned in a std::string instead of to a character array.
format | is a printf() style format string. |
Definition at line 97 of file richio.cpp.
References ignore_unused(), and vprint().
int StrPrintf | ( | std::string * | aResult, |
const char * | aFormat, | ||
... | |||
) |
This is like sprintf() but the output is appended to a std::string instead of to a character array.
aResult | is the string to append to, previous text is not clear()ed. |
aFormat | is a printf() style format string. |
Definition at line 85 of file richio.cpp.
References vprint().
Referenced by fmt_mask(), PCB_PLUGIN::format(), FormatProbeItem(), GenCADLayerName(), GenCADLayerNameFlipped(), IMPORT_PROJ_HELPER::ImportIndividualFile(), PCB_PARSER::init(), GENDRILL_WRITER_BASE::layerName(), PCB_EDIT_FRAME::OpenProjectFiles(), ReplaceIllegalFileNameChars(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), and SCH_EDIT_FRAME::SetCrossProbeConnection().
|
static |
Definition at line 49 of file richio.cpp.
Referenced by StrPrintf().