Save/load host info.

This commit is contained in:
Bartosz Taudul 2018-08-19 18:28:48 +02:00
parent 71bfd15d9e
commit e0a4b9c56a
2 changed files with 14 additions and 1 deletions

View File

@ -7,7 +7,7 @@ namespace Version
{
enum { Major = 0 };
enum { Minor = 3 };
enum { Patch = 202 };
enum { Patch = 203 };
}
}

View File

@ -276,6 +276,15 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
m_captureName = std::string( tmp, tmp+sz );
}
if( fileVer >= FileVersion( 0, 3, 203 ) )
{
f.Read( sz );
assert( sz < 1024 );
char tmp[1024];
f.Read( tmp, sz );
m_hostInfo = std::string( tmp, tmp+sz );
}
if( fileVer >= FileVersion( 0, 3, 202 ) )
{
f.Read( sz );
@ -2937,6 +2946,10 @@ void Worker::Write( FileWrite& f )
f.Write( &sz, sizeof( sz ) );
f.Write( m_captureName.c_str(), sz );
sz = m_hostInfo.size();
f.Write( &sz, sizeof( sz ) );
f.Write( m_hostInfo.c_str(), sz );
sz = m_data.frames.Data().size();
f.Write( &sz, sizeof( sz ) );
for( auto& fd : m_data.frames.Data() )