1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     dbg_PrintResult.h
4 
5   Copyright (C)2009 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 29161 $
14  *---------------------------------------------------------------------------*/
15 
16 /*!
17     @file
18 
19     :include nn/dbg.h
20 */
21 
22 #ifndef NN_DBG_DBG_PRINTRESULT_H_
23 #define NN_DBG_DBG_PRINTRESULT_H_
24 
25 #include <nn/Result.h>
26 
27 #ifdef __cplusplus
28 namespace nn { namespace dbg {
29 
30 /*
31     @brief エラーレベルを示す文字列を取得します。
32 
33     @param[in] result 結果
34 
35     @return エラーレベルを示す文字列
36 */
37 const char* GetLevelString(nn::Result result);
38 
39 /*
40     @brief モジュール情報を示す文字列を取得します。
41 
42     @param[in] result 結果
43 
44     @return モジュール情報を示す文字列
45 */
46 const char* GetModuleString(nn::Result result);
47 
48 /*
49     @brief エラー概要を示す文字列を取得します。
50 
51     @param[in] result 結果
52 
53     @return エラー概要を示す文字列
54 */
55 const char* GetSummaryString(nn::Result result);
56 
57 /*
58     @brief エラー詳細を示す文字列を取得します。
59 
60     @param[in] result 結果
61 
62     @return エラー詳細を示す文字列
63 */
64 const char* GetDescriptionString(nn::Result result);
65 
66 /*
67     @brief 結果を出力します。
68 
69     @param[in] result 結果
70 */
71 void PrintResult(Result result);
72 
73 /*
74     @brief 結果を出力します。PrintResult の省メモリ版です。
75 
76     @param[in] result 結果
77 */
78 void TPrintResult(Result result);
79 
80 }}
81 
82 #ifndef NN_SWITCH_DISABLE_ASSERT_WARNING
83 
84     #define NN_DBG_DECLARE_GET_RESULT_DESCRIPTION_STRING_IMPL_KEEPER(libname) \
85         namespace nn { namespace libname { \
86             void GetResultDescriptionStringImplKeeper(); \
87         }}
88 
89     #define NN_DBG_USE_GET_RESULT_DESCRIPTION_STRING_IMPL_KEEPER(libname) (::nn::libname::GetResultDescriptionStringImplKeeper())
90 
91     #define NN_DBG_CHECK_RESULT(exp)    NN_UTIL_PANIC_IF_FAILED(exp)
92 #else
93 
94     #define NN_DBG_DECLARE_GET_RESULT_DESCRIPTION_STRING_IMPL_KEEPER(libname)
95     #define NN_DBG_USE_GET_RESULT_DESCRIPTION_STRING_IMPL_KEEPER(libname) (void)0
96 
97     #define NN_DBG_CHECK_RESULT(exp)    ((void)(exp))
98 
99 #endif
100 
101 #endif  // ifdef __cplusplus
102 
103 
104 #endif /* NN_DBG_DBG_RESULT_H_ */
105