Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys.

This commit is contained in:
Colin Finck 2017-10-03 07:45:34 +00:00
parent b94e2d8ca0
commit c2c66aff7d
24198 changed files with 0 additions and 37285 deletions

View file

@ -0,0 +1,49 @@
// binary2cstr.cpp
#ifdef _MSC_VER
#pragma warning ( disable : 4786 )
#endif//_MSC_VER
#include "binary2cstr.h"
using std::string;
string binary2cstr ( const string& src )
{
string dst;
for ( int i = 0; i < src.size(); i++ )
{
char c = src[i];
switch ( c )
{
case '\n':
dst += "\\n";
break;
case '\r':
dst += "\\r";
break;
case '\t':
dst += "\\t";
break;
case '\v':
dst += "\\v";
break;
case '\"':
dst += "\x22";
break;
default:
if ( isprint ( c ) )
dst += c;
else
{
dst += "\\x";
char tmp[16];
_snprintf ( tmp, sizeof(tmp)-1, "%02X", (unsigned)(unsigned char)c );
tmp[sizeof(tmp)-1] = '\0';
dst += tmp;
}
break;
}
}
return dst;
}