OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PPAPI_CPP_COMMON_H_ | 5 #ifndef PPAPI_CPP_COMMON_H_ |
6 #define PPAPI_CPP_COMMON_H_ | 6 #define PPAPI_CPP_COMMON_H_ |
7 | 7 |
8 /** | 8 |
9 * @file | 9 /// @file |
10 * Defines the API ... | 10 /// Defines the API to convert PP_Bool to and from their C++ equivalent. |
11 * | |
12 * @addtogroup CPP | |
13 * @{ | |
14 */ | |
15 | 11 |
16 #include "ppapi/c/pp_bool.h" | 12 #include "ppapi/c/pp_bool.h" |
17 | 13 |
18 namespace pp { | 14 namespace pp { |
19 | 15 |
20 /** Convert a C++ bool to the appropriate PP_Bool value. */ | 16 /// This function is used to convert a C++ bool to the appropriate PP_Bool |
| 17 /// value. |
| 18 /// @param[in] value A C++ boolean value. |
| 19 /// @return A PP_Bool equivalent of the C++ boolean value. |
21 inline PP_Bool BoolToPPBool(bool value) { | 20 inline PP_Bool BoolToPPBool(bool value) { |
22 return value ? PP_TRUE : PP_FALSE; | 21 return value ? PP_TRUE : PP_FALSE; |
23 } | 22 } |
24 | 23 |
25 /** Convert a PP_Bool to a C++ bool value. */ | 24 /// This function is used to convert a PP_Bool to a C++ boolean value. |
| 25 /// value. |
| 26 /// @param[in] value A PP_Bool boolean value. |
| 27 /// @return A C++ equivalent of the PP_Bool boolean value. |
26 inline bool PPBoolToBool(PP_Bool value) { | 28 inline bool PPBoolToBool(PP_Bool value) { |
27 return !!value; | 29 return !!value; |
28 } | 30 } |
29 | 31 |
30 } // namespace pp | 32 } // namespace pp |
31 | 33 |
32 /** | |
33 * @} | |
34 * End addtogroup CPP | |
35 */ | |
36 | |
37 #endif // PPAPI_CPP_COMMON_H_ | 34 #endif // PPAPI_CPP_COMMON_H_ |
38 | 35 |
OLD | NEW |