11 #pragma warning( disable : 4996 ) 29 char *next, *tmp1, *tmp2;
30 for ( LPTSTR cmd = ::GetCommandLine(); *cmd; cmd = next ) {
31 ::memset( exe, 0,
sizeof( exe ) );
32 while ( *cmd ==
' ' ) cmd++;
33 next = ::strchr( cmd,
' ' );
34 if ( !next ) next = cmd + ::strlen( cmd );
35 if ( ( tmp1 = ::strchr( cmd,
'\"' ) ) > 0 && tmp1 < next ) {
36 tmp2 = ::strchr( ++tmp1,
'\"' );
39 if ( cmd < tmp1 ) ::strncpy( exe, cmd, tmp1 - cmd - 1 );
40 ::strncpy( &exe[strlen( exe )], tmp1, tmp2 - tmp1 - 1 );
46 ::strncpy( exe, cmd, next - cmd );
61 if (::strncmp( class_name,
"class ", 6 ) == 0 ) {
65 if (::strncmp( class_name,
"struct ", 7 ) == 0 ) {
72 while ( ( loc = tmp.
find(
"class " ) ) > 0 ) {
76 while ( ( loc = tmp.
find(
"struct " ) ) > 0 ) {
84 while ( ( off = result.
find(
" *" ) ) != std::string::npos ) {
88 while ( ( off = result.
find(
" &" ) ) != std::string::npos ) {
98 static const size_t STRING_SIZE = 512;
99 char hname[STRING_SIZE];
100 size_t strlen = STRING_SIZE;
101 if ( !::GetComputerName( hname, &strlen ) ) {
113 ut.dwOSVersionInfoSize =
sizeof( OSVERSIONINFO );
114 if ( !::GetVersionEx( &ut ) ) {
118 ver << ut.dwMajorVersion <<
'.' << ut.dwMinorVersion;
126 ::GetSystemInfo( &ut );
128 arch << ut.wProcessorArchitecture;
135 static const size_t STRING_SIZE = 512;
136 char uname[STRING_SIZE];
137 size_t strlen = STRING_SIZE;
138 if ( !::GetUserName( uname, &strlen ) ) {
std::string hostName()
Get the system's host name.
Note: OS specific details for environment resolution.
std::string typeinfoName(const char *class_name)
Get the human readable type name from a typeinfo name.
std::string machineType()
Get the runner machine's type.
std::string osName()
Get the operating system's name.
std::string accountName()
Get the account name of the current user.
std::string osVersion()
Get the operating system's version.
std::vector< std::string > cmdLineArgs()
Get the command line arguments of the process.