#include <cstdarg>
#include <config.h>
#include <ignore.h>
#include <richio.h>
#include <errno.h>
#include <wx/file.h>
#include <wx/translation.h>
Go to the source code of this file.
|
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...
|
|
◆ getc_unlocked
#define getc_unlocked getc |
◆ NESTWIDTH
◆ StrPrintf() [1/2]
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.
- Parameters
-
aResult | is the string to append to, previous text is not clear()ed. |
aFormat | is a printf() style format string. |
- Returns
- the count of bytes appended to the result string, no terminating nul is included.
Definition at line 79 of file richio.cpp.
83 va_start( args, format );
84 int ret =
vprint( result, format, args );
static int vprint(std::string *result, const char *format, va_list ap)
References vprint().
Referenced by fmt_mask(), PCB_PLUGIN::format(), FormatProbeItem(), GenCADLayerName(), GenCADLayerNameFlipped(), KICAD_MANAGER_FRAME::ImportNonKiCadProject(), 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().
◆ StrPrintf() [2/2]
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.
- Parameters
-
format | is a printf() style format string. |
- Returns
- std::string - the result of the sprintf().
Definition at line 91 of file richio.cpp.
96 va_start( args, format );
void ignore_unused(const T &)
static int vprint(std::string *result, const char *format, va_list ap)
References ignore_unused(), and vprint().
◆ vprint()
static int vprint |
( |
std::string * |
result, |
|
|
const char * |
format, |
|
|
va_list |
ap |
|
) |
| |
|
static |
Definition at line 43 of file richio.cpp.
54 size_t len = vsnprintf( msg,
sizeof(msg), format, ap );
56 if( len <
sizeof(msg) )
58 result->append( msg, msg + len );
65 std::vector<char> buf;
68 len = vsnprintf( &buf[0], len+1, format, tmp );
70 result->append( &buf[0], &buf[0] + len );
Referenced by StrPrintf().