本文整理汇总了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 );
}
示例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() );
}
示例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() );
}
示例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;
}
示例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 );
}
}
示例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
}
示例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() );
}
示例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() );
}