Rsh API  SDK 2.1
Документация по программированию
 Указатель Классы Файлы Функции Переменные Определения типов Перечисления Элементы перечислений Друзья Макросы Страницы
RshError.h
См. документацию.
1 
18 #ifndef RSH_ERROR_H
19 #define RSH_ERROR_H
20 
21 #include "RshDefChk.h"
22 #include "RshConsts_Language.h"
23 #include "RshConsts_StatusCodes.h"
24 
25 #include <map>
26 
46 class RshError {
47 
48 public:
49 
110  static U32 GetSystemErrorDescription(U32 error, wchar_t* str, U32 maxLength);
111 
112 
175  static U32 GetSystemErrorDescription(U32 error, char* str, U32 maxLength);
176 
177  static U32 GetSystemErrorDescription(U32 error, std::string& str);
178  static U32 GetSystemErrorDescription(U32 error, std::wstring& str);
179 
241  static U32 GetErrorDescription(U32 error, wchar_t* str, U32 maxLength, RSH_LANGUAGE language = RSH_LANGUAGE_ENGLISH);
242 
306  static U32 GetErrorDescription(U32 error, char* str, U32 maxLength, RSH_LANGUAGE language = RSH_LANGUAGE_ENGLISH);
307 
308  static U32 GetErrorDescription(U32 error, std::wstring& str, RSH_LANGUAGE language = RSH_LANGUAGE_ENGLISH);
309 
310  static U32 GetErrorDescription(U32 error, std::string& str, RSH_LANGUAGE language = RSH_LANGUAGE_ENGLISH);
311 
372  static void PrintError(U32 error, RSH_LANGUAGE language = RSH_LANGUAGE_ENGLISH, bool includeSystemErrorInfo = false);
373 
427  static void PrintErrorDebug(U32 error, const wchar_t* message, bool includeSystemErrorInfo = false);
428  static void PrintErrorDebug(U32 error, const char* message, bool includeSystemErrorInfo = false);
429 
430 private:
431  //russian error messages
432  static const std::map<RSH_STATUS, std::wstring> m_errorsRu;
433  //english error messages
434  static const std::map<RSH_STATUS, std::wstring> m_errorsEn;
435 
436  //helper method to populate const maps
437  static const std::map<RSH_STATUS, std::wstring> populateMap(RSH_LANGUAGE language);
438 
439  //helper method to convert std::wstring in std::string (platform specific to support cyrillic)
440  static U32 convertWStringToStirng(const std::wstring& src, std::string& dst);
441 };
442 
443 
444 
445 #endif //RSH_ERROR_H