[453] | 1 | // Copyright (c) Microsoft. All rights reserved.
|
---|
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
---|
| 3 |
|
---|
| 4 | #ifndef JSONENCODER_H
|
---|
| 5 | #define JSONENCODER_H
|
---|
| 6 |
|
---|
| 7 | #include "azure_macro_utils/macro_utils.h"
|
---|
| 8 | #include "azure_c_shared_utility/strings.h"
|
---|
| 9 |
|
---|
| 10 | #ifdef __cplusplus
|
---|
| 11 | #include "cstddef"
|
---|
| 12 | extern "C" {
|
---|
| 13 | #else
|
---|
| 14 | #include "stddef.h"
|
---|
| 15 | #endif
|
---|
| 16 |
|
---|
| 17 | #include "multitree.h"
|
---|
| 18 |
|
---|
| 19 | #define JSON_ENCODER_RESULT_VALUES \
|
---|
| 20 | JSON_ENCODER_OK, \
|
---|
| 21 | JSON_ENCODER_INVALID_ARG, \
|
---|
| 22 | JSON_ENCODER_ALREADY_EXISTS, \
|
---|
| 23 | JSON_ENCODER_MULTITREE_ERROR, \
|
---|
| 24 | JSON_ENCODER_TOSTRING_FUNCTION_ERROR, \
|
---|
| 25 | JSON_ENCODER_ERROR
|
---|
| 26 |
|
---|
| 27 | MU_DEFINE_ENUM_WITHOUT_INVALID(JSON_ENCODER_RESULT, JSON_ENCODER_RESULT_VALUES);
|
---|
| 28 |
|
---|
| 29 | #define JSON_ENCODER_TOSTRING_RESULT_VALUES \
|
---|
| 30 | JSON_ENCODER_TOSTRING_OK, \
|
---|
| 31 | JSON_ENCODER_TOSTRING_INVALID_ARG, \
|
---|
| 32 | JSON_ENCODER_TOSTRING_ERROR
|
---|
| 33 |
|
---|
| 34 | MU_DEFINE_ENUM_WITHOUT_INVALID(JSON_ENCODER_TOSTRING_RESULT, JSON_ENCODER_TOSTRING_RESULT_VALUES);
|
---|
| 35 |
|
---|
| 36 | typedef JSON_ENCODER_TOSTRING_RESULT(*JSON_ENCODER_TOSTRING_FUNC)(STRING_HANDLE, const void* value);
|
---|
| 37 |
|
---|
| 38 | #include "umock_c/umock_c_prod.h"
|
---|
| 39 |
|
---|
| 40 | MOCKABLE_FUNCTION(, JSON_ENCODER_TOSTRING_RESULT, JSONEncoder_CharPtr_ToString, STRING_HANDLE, destination, const void*, value);
|
---|
| 41 | MOCKABLE_FUNCTION(, JSON_ENCODER_RESULT, JSONEncoder_EncodeTree, MULTITREE_HANDLE, treeHandle, STRING_HANDLE, destination, JSON_ENCODER_TOSTRING_FUNC, toStringFunc);
|
---|
| 42 |
|
---|
| 43 | #ifdef __cplusplus
|
---|
| 44 | }
|
---|
| 45 | #endif
|
---|
| 46 |
|
---|
| 47 |
|
---|
| 48 | #endif /* JSONENCODER_H */
|
---|