MCPcopy Create free account
hub / github.com/MaxBelkov/visualsyslog / WriteHex

Method WriteHex

sourcecommon/File.cpp:366–398  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

364}
365//---------------------------------------------------------------------------
366bool TFile::WriteHex(char * title, void * data, DWORD size)
367{
368 if( !data || size >= 200 ) return false;
369 //
370 char str[800];
371 char tmp[201];
372 DWORD i;
373
374 strcpy(str, title);
375 strcat(str, " ");
376 for(i=0; i<size; i++)
377 {
378 BYTE c = *((BYTE *)data+i);
379 wsprintf(tmp, "%02X", c);
380 strcat(str, tmp);
381 }
382 strcat(str, " ");
383 for(i=0; i<size; i++)
384 {
385 char c = *((char *)data+i);
386 tmp[i] = (c>31) ? c : '.';
387 }
388 tmp[i] = 0;
389 strcat(str, tmp);
390
391 Error = !WriteString(str);
392 if( Error )
393 {
394 if( Exceptions ) throw 0;
395 return ! Error;
396 }
397 return true;
398}
399//---------------------------------------------------------------------------
400bool IsPath(char * szName)
401{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected