1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     util_Base64.h
4 
5   Copyright (C)2009-2012 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:$
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NN_UTIL_UTIL_BASE64_H_
17 #define NN_UTIL_UTIL_BASE64_H_
18 
19 #include <nn/types.h>
20 #include <nn/util/util_Result.h>
21 
22 #ifdef __cplusplus
23 
24 namespace nn { namespace util {
25 
26 /* Please see man pages for details
27 
28 
29 
30 */
31     NN_DEFINE_RESULT_CONST(
32         ResultBufferFull,
33         Result::LEVEL_PERMANENT,
34         Result::SUMMARY_OUT_OF_RESOURCE,
35         Result::MODULE_NN_UTIL,
36         DESCRIPTION_BUFFER_FULL
37     );
38 
39 /* Please see man pages for details
40 
41 
42 
43 */
44     NN_DEFINE_RESULT_CONST(
45         ResultBadData,
46         Result::LEVEL_PERMANENT,
47         Result::SUMMARY_WRONG_ARGUMENT,
48         Result::MODULE_NN_UTIL,
49         DESCRIPTION_BAD_DATA
50     );
51 
52 /* Please see man pages for details
53 
54 
55 
56 */
57     NN_DEFINE_RESULT_CONST(
58         ResultInvalidPtr,
59         Result::LEVEL_USAGE,
60         Result::SUMMARY_INVALID_ARGUMENT,
61         Result::MODULE_NN_UTIL,
62         Result::DESCRIPTION_INVALID_POINTER
63     );
64 
65 /* Please see man pages for details
66 
67  */
68 class Base64
69 {
70 public:
71 
72     /* Please see man pages for details
73 
74 
75 
76 
77 
78 
79 
80 
81      */
82     static nn::Result ToBase64String(const void* pSrc, size_t sizeSrc, char* pDst, size_t sizeDst);
83 
84     /* Please see man pages for details
85 
86 
87 
88 
89 
90 
91 
92 
93      */
94     static nn::Result FromBase64String(const char* pSrc, void* pDst, size_t sizeDst, size_t* pNum);
95 };
96 
97 }}
98 
99 #endif // __cplusplus
100 
101 #endif // ifndef NN_UTIL_UTIL_BASE64_H_
102