Formatter.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace AppSecInc
4 {
6  namespace Formatter
7  {
9  std::string FormatMessageFromHRA(HRESULT hr);
11  std::string FormatMessageFromLastErrorCodeA(DWORD);
13  std::wstring FormatMessageFromHRW(HRESULT hr);
15  std::wstring FormatMessageFromLastErrorCodeW(DWORD);
17  std::string FormatMessageFromVArgs(char *, va_list&);
19  std::wstring FormatMessageFromVArgs(wchar_t *, va_list&);
21  std::string FormatMessage(char *, ...);
23  std::wstring FormatMessage(wchar_t *, ...);
25  std::string FormatHexA(byte * buffer, unsigned long len);
27  std::wstring FormatHexW(byte * buffer, unsigned long len);
29  std::string FormatHexStringA(byte * buffer, unsigned long len);
31  std::wstring FormatHexStringW(byte * buffer, unsigned long len);
33  std::wstring FormatTemplate(const std::wstring& buffer, const std::map<std::wstring, std::wstring>& tokens, const std::wstring& left = L"[", const std::wstring& right = L"]");
35  std::string FormatTemplate(const std::string& buffer, const std::map<std::string, std::string>& tokens, const std::string& left = "[", const std::string& right = "]");
36  }
37 }
std::string FormatMessage(char *,...)
format a message with a list of arguments (printf-style)
Definition: Formatter.cpp:107
std::wstring FormatHexW(byte *buffer, unsigned long len)
format a UNICODE buffer of bytes into a hex view
Definition: Formatter.cpp:243
std::string FormatMessageFromLastErrorCodeA(DWORD)
format an ANSI message from a Win32 error code
Definition: Formatter.cpp:76
std::wstring FormatTemplate(const std::wstring &buffer, const std::map< std::wstring, std::wstring > &tokens, const std::wstring &left=L"[", const std::wstring &right=L"]")
format a UNICODE template
Definition: Formatter.cpp:324
std::string FormatHexA(byte *buffer, unsigned long len)
format an ANSI buffer of bytes into a hex view
Definition: Formatter.cpp:127
std::wstring FormatMessageFromHRW(HRESULT hr)
format a UNICODE message from an HRESULT
Definition: Formatter.cpp:39
std::string FormatMessageFromVArgs(char *, va_list &)
format a message with a list of arguments (printf-style)
Definition: Formatter.cpp:81
std::wstring FormatMessageFromLastErrorCodeW(DWORD)
format a UNICODE message from a Win32 error code
Definition: Formatter.cpp:71
std::string FormatMessageFromHRA(HRESULT hr)
format an ANSI message from an HRESULT
Definition: Formatter.cpp:6
std::wstring FormatHexStringW(byte *buffer, unsigned long len)
format a UNICODE buffer of bytes into a hex string
Definition: Formatter.cpp:225
std::string FormatHexStringA(byte *buffer, unsigned long len)
format an ANSI buffer of bytes into a hex string
Definition: Formatter.cpp:207


© Application Security Inc. - All Rights Reserved http://msiext.codeplex.com