Пример #1
0
CPLString CPLOvPrintf( const char *pszFormat, va_list args )

{
    CPLString osTarget;
    osTarget.vPrintf( pszFormat, args);
    return osTarget;
}
Пример #2
0
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);
}
Пример #3
0
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 );
}
Пример #4
0
CPLString CPLOPrintf( const char *pszFormat, ... )

{
    va_list args;
    va_start( args, pszFormat );

    CPLString osTarget;
    osTarget.vPrintf( pszFormat, args );

    va_end( args );

    return osTarget;
}
Пример #5
0
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);
}
Пример #6
0
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);
    }
}
Пример #7
0
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;
}