当前位置: 首页>>代码示例>>C++>>正文


C++ AStackString::VFormat方法代码示例

本文整理汇总了C++中AStackString::VFormat方法的典型用法代码示例。如果您正苦于以下问题:C++ AStackString::VFormat方法的具体用法?C++ AStackString::VFormat怎么用?C++ AStackString::VFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AStackString的用法示例。


在下文中一共展示了AStackString::VFormat方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AppendFormat

// AppendFormat
//------------------------------------------------------------------------------
void AString::AppendFormat( const char * fmtString, ... )
{
    AStackString< 1024 > buffer;
	va_list args;
	va_start(args, fmtString);
	buffer.VFormat( fmtString, args );
	va_end( args );

    Append( buffer );
}
开发者ID:JeremieA,项目名称:fastbuild,代码行数:12,代码来源:AString.cpp

示例2:

// Build
//------------------------------------------------------------------------------
/*static*/ void FLog::Build( const char * formatString, ... )
{
    AStackString< 8192 > buffer;

    va_list args;
    va_start(args, formatString);
    buffer.VFormat( formatString, args );
    va_end( args );

    Tracing::Output( buffer.Get() );
}
开发者ID:dontnod,项目名称:fastbuild,代码行数:13,代码来源:FLog.cpp

示例3: Output

// Info
//------------------------------------------------------------------------------
/*static*/ void FLog::Info( const char * formatString, ... )
{
    AStackString< 8192 > buffer;

    va_list args;
    va_start(args, formatString);
    buffer.VFormat( formatString, args );
    va_end( args );

    Output( "Info:", buffer.Get() );
}
开发者ID:dontnod,项目名称:fastbuild,代码行数:13,代码来源:FLog.cpp

示例4: Write

// Write
//------------------------------------------------------------------------------
void VSProjectGenerator::Write( const char * fmtString, ... )
{
    AStackString< 1024 > tmp;

    va_list args;
    va_start(args, fmtString);
    tmp.VFormat( fmtString, args );
    va_end( args );

    // resize output buffer in large chunks to prevent re-sizing
    if ( m_Tmp.GetLength() + tmp.GetLength() > m_Tmp.GetReserved() )
    {
        m_Tmp.SetReserved( m_Tmp.GetReserved() + MEGABYTE );
    }

    m_Tmp += tmp;
}
开发者ID:dontnod,项目名称:fastbuild,代码行数:19,代码来源:VSProjectGenerator.cpp

示例5: Error

// Error
//------------------------------------------------------------------------------
void Job::Error( const char * format, ... )
{
	AStackString< 8192 > buffer;

	va_list args;
	va_start(args, format);
	buffer.VFormat( format, args );
	va_end( args );

	if ( IsLocal() )
	{
		FLOG_ERROR( buffer.Get() );
	}
	else
	{
		m_Messages.Append( buffer );
	}
}
开发者ID:ClxS,项目名称:fastbuild,代码行数:20,代码来源:Job.cpp

示例6: defined

// ShowMessageBox
//------------------------------------------------------------------------------
/*static*/ void Worker::ShowMessageBox( const char * fmtString, ... )
{
	AStackString<> buffer;

	va_list args;
	va_start(args, fmtString);
	buffer.VFormat( fmtString, args );
	va_end( args );

	#if defined( __WINDOWS__ )
		::MessageBox( nullptr, buffer.Get(), "FBuild Worker", MB_OK );
	#elif defined( __APPLE__ )
		// TODO:MAC Implement ShowMessageBox
	#elif defined( __LINUX__ )
		// TODO:LINUX Implement ShowMessageBox
	#else
		#error Unknown Platform
	#endif
}
开发者ID:jujis008,项目名称:fastbuild,代码行数:21,代码来源:Worker.cpp

示例7: lock

// Monitor
//------------------------------------------------------------------------------
/*static*/ void FLog::Monitor( const char * formatString, ... )
{
    // Is monitoring enabled?
    if ( g_MonitorFileStream == nullptr )
    {
        return; // No - nothing to do
    }

    PROFILE_SECTION( "FLog::Monitor" )

    AStackString< 1024 > buffer;
    va_list args;
    va_start( args, formatString );
    buffer.VFormat( formatString, args );
    va_end( args );

    AStackString< 1024 > finalBuffer;
    finalBuffer.Format( "%llu %s", Time::GetCurrentFileTime(), buffer.Get() );

    MutexHolder lock( g_MonitorMutex );
    g_MonitorFileStream->WriteBuffer( finalBuffer.Get(), finalBuffer.GetLength() );
}
开发者ID:dontnod,项目名称:fastbuild,代码行数:24,代码来源:FLog.cpp

示例8: FormatError

// FormatError
//------------------------------------------------------------------------------
void Error::FormatError( const BFFIterator & iter,
                         uint32_t errNum,
                         const Function * function,
                         const char * message, ... )
{
    ASSERT( message );
    AStackString< 4096 > buffer;

    va_list args;
    va_start(args, message);
    buffer.VFormat( message, args );
    va_end( args );

    // get human readable info about the position of the error
    uint32_t line = 0;
    uint32_t column = 0;
    const char * lineStart = nullptr;
    iter.GetPosInfo( line, column, lineStart );

    // convert to full path and '/'->'\' cleanup
    const AStackString<> fileName( iter.GetFileName() );
    AStackString<> fullPath;
    NodeGraph::CleanPath( fileName, fullPath );

    // deliberately using OUTPUT here to avoid "Error:" in front
    OUTPUT( "%s(%u,%u): FASTBuild Error #%04u - %s%s%s\n",
            fullPath.Get(),
            line,
            column,
            errNum,
            function ? function->GetName().Get() : "",
            function ? "() - " : "",
            buffer.Get() );

    // find the line end
    BFFIterator lineEnd( iter );
    while ( !lineEnd.IsAtEnd() )
    {
        if (( *lineEnd != '\r' ) && ( *lineEnd != '\n' ))
        {
            lineEnd++;
            continue;
        }
        break;
    }

    // if line is too crazy to be useful, don't print anything more
    size_t lineLength = lineEnd.GetCurrent() - lineStart;
    if ( lineLength >= 256 )
    {
        return;
    }

    // print the problematic line
    AString::Copy( lineStart, buffer.Get(), lineLength );
    FLOG_ERROR( "%s", buffer.Get() );

    // point to the specific pos where parsing broke
    // (taking into account tabs)
    char * c = buffer.Get();
    const char * end = c + column - 1;
    for ( ; c < end; ++c )
    {
        if ( *c != '\t' )
        {
            *c = ' ';
        }
    }

    AString::Copy( "^", c, 1 );
    FLOG_ERROR( buffer.Get() );
    AString::Copy( "\\--here", c, 8 );
    FLOG_ERROR( buffer.Get() );
}
开发者ID:dontnod,项目名称:fastbuild,代码行数:76,代码来源:Error.cpp


注:本文中的AStackString::VFormat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。