mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 07:54:36 +00:00
Add file and diff printers.
This commit is contained in:
parent
5a442f123e
commit
205930fd2c
@ -160,6 +160,31 @@ static std::vector<std::string> SplitLines( const char* data, size_t sz )
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void PrintFile( const char* data, size_t sz, uint32_t color )
|
||||
{
|
||||
auto lines = SplitLines( data, sz );
|
||||
for( auto& v : lines )
|
||||
{
|
||||
TextColoredUnformatted( color, v.c_str() );
|
||||
}
|
||||
}
|
||||
|
||||
static void PrintDiff( const std::string& diff )
|
||||
{
|
||||
auto lines = SplitLines( diff.data(), diff.size() );
|
||||
for( auto& v : lines )
|
||||
{
|
||||
assert( !v.empty() );
|
||||
switch( v[0] )
|
||||
{
|
||||
case '@': TextColoredUnformatted( 0xFFFFAAAA, v.c_str() ); break;
|
||||
case '-': TextColoredUnformatted( 0xFF6666FF, v.c_str() ); break;
|
||||
case '+': TextColoredUnformatted( 0xFF66DD66, v.c_str() ); break;
|
||||
default: TextDisabledUnformatted( v.c_str() ); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void View::DrawCompare()
|
||||
{
|
||||
const auto scale = GetScale();
|
||||
|
Loading…
Reference in New Issue
Block a user