CPLString CPLOvPrintf( const char *pszFormat, va_list args ) { CPLString osTarget; osTarget.vPrintf( pszFormat, args); return osTarget; }
void OGRGPXDataSource::PrintLine(const char *fmt, ...) { CPLString osWork; va_list args; va_start( args, fmt ); osWork.vPrintf( fmt, args ); va_end( args ); VSIFPrintfL(fpOutput, "%s%s", osWork.c_str(), pszEOL); }
int VSIFPrintfL( VSILFILE *fp, const char *pszFormat, ... ) { va_list args; CPLString osResult; va_start( args, pszFormat ); osResult.vPrintf( pszFormat, args ); va_end( args ); return VSIFWriteL( osResult.c_str(), 1, osResult.length(), fp ); }
CPLString CPLOPrintf( const char *pszFormat, ... ) { va_list args; va_start( args, pszFormat ); CPLString osTarget; osTarget.vPrintf( pszFormat, args ); va_end( args ); return osTarget; }
int URLSearchAndReplace (CPLString *base, const char *search, const char *fmt, ...) { CPLString tmp; va_list args; size_t start = base->find(search); if (start == std::string::npos) { return -1; } va_start(args, fmt); tmp.vPrintf(fmt, args); va_end(args); base->replace(start, strlen(search), tmp); return static_cast<int>(start); }
void MIDDATAFile::WriteLine(const char *pszFormat,...) { va_list args; if (m_eAccessMode == TABWrite && m_fp) { va_start(args, pszFormat); CPLString osStr; osStr.vPrintf( pszFormat, args ); VSIFWriteL( osStr.c_str(), 1, osStr.size(), m_fp); va_end(args); } else { CPLAssert(FALSE); } }
bool Progress::onProgress(ngsCode status, double complete, const char *format, ...) const { if(nullptr == m_progressFunc) { return true; // No cancel from user } va_list args; CPLString message; va_start( args, format ); message.vPrintf( format, args ); va_end( args ); double newComplete = complete / m_totalSteps + 1.0 / m_totalSteps * m_step; if(status == COD_FINISHED && newComplete < 1.0) { status = COD_IN_PROCESS; } return m_progressFunc(status, newComplete, message, m_progressArguments) == 1; }