PStack  2.0
Stack trace printer for MSVC and GCC binaries
process_info.cpp File Reference

Define functionality for a container object for process information. More...

#include "psystem/process_info.hpp"
#include <codecvt>
#include <psystem/thread_info.hpp>
Include dependency graph for process_info.cpp:

Namespaces

 psystem
 Contains the process examination "system" and basic frameworks.
 

Functions

static psystem::tstring utf16_to_tchar (wchar_t const *data)
 Convert UTF-16 text to "native" strings. More...
 
static psystem::tstring utf8_to_tchar (char const *data)
 Convert UTF-8 text to "native" strings. More...
 

Detailed Description

Define functionality for a container object for process information.

Author
Matt Bisson
Date
5 August, 2014
Since
PSystem 2.0
Version
PSystem 2.0

Function Documentation

static psystem::tstring utf16_to_tchar ( wchar_t const *  data)
static

Convert UTF-16 text to "native" strings.

The idea behind this function is that the TCHAR type varies based on the presence of the UNICODE preprocessor macro. This same macro selects which character type the various system API will use. The function converts from UTF-16 to the compile-time configured data type that is compatible with the selected set of system API. This may involve a conversion to UTF-8, or it may simply pass the data back unchanged.

Parameters
[in]dataA UTF-16 string of character data.
Returns
A new std::basic_string instance with data that is compatible with the current set of system API.
Exceptions
std::range_errorOn failure to convert the data.
Todo:
Move somewhere more global.
static psystem::tstring utf8_to_tchar ( char const *  data)
static

Convert UTF-8 text to "native" strings.

The idea behind this function is that the TCHAR type varies based on the presence of the UNICODE preprocessor macro. This same macro selects which character type the various system API will use. The function converts from UTF-8 to the compile-time configured data type that is compatible with the selected set of system API. This may involve a conversion to UTF-16, or it may simply pass the data back unchanged.

Parameters
[in]dataA UTF-8 string of character data.
Returns
A new std::basic_string instance with data that is compatible with the current set of system API.
Exceptions
std::range_errorOn failure to convert the data.
Todo:
Move somewhere more global.