Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / lib / core / CHIPTLVUtilities.hpp
1 /*
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *    Copyright (c) 2015-2017 Nest Labs, Inc.
5  *
6  *    Licensed under the Apache License, Version 2.0 (the "License");
7  *    you may not use this file except in compliance with the License.
8  *    You may obtain a copy of the License at
9  *
10  *        http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *    Unless required by applicable law or agreed to in writing, software
13  *    distributed under the License is distributed on an "AS IS" BASIS,
14  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *    See the License for the specific language governing permissions and
16  *    limitations under the License.
17  */
18
19 /**
20  *    @file
21  *      This file specifies types and utility interfaces for managing and
22  *      working with CHIP TLV.
23  *
24  */
25
26 #ifndef CHIPTLVUTILITIES_HPP
27 #define CHIPTLVUTILITIES_HPP
28
29 #include <stddef.h>
30 #include <stdint.h>
31
32 #include <core/CHIPError.h>
33 #include <core/CHIPTLV.h>
34
35 namespace chip {
36
37 namespace TLV {
38
39 /**
40  *   @namespace chip::TLV::Utilities
41  *
42  *   @brief
43  *     This namespace includes types and utility interfaces for managing and
44  *     working with CHIP TLV.
45  *
46  */
47 namespace Utilities {
48
49 typedef CHIP_ERROR (*IterateHandler)(const TLVReader & aReader, size_t aDepth, void * aContext);
50
51 extern CHIP_ERROR Iterate(const TLVReader & aReader, IterateHandler aHandler, void * aContext);
52 extern CHIP_ERROR Iterate(const TLVReader & aReader, IterateHandler aHandler, void * aContext, bool aRecurse);
53
54 extern CHIP_ERROR Count(const TLVReader & aReader, size_t & aCount);
55 extern CHIP_ERROR Count(const TLVReader & aReader, size_t & aCount, bool aRecurse);
56
57 extern CHIP_ERROR Find(const TLVReader & aReader, const uint64_t & aTag, TLVReader & aResult);
58 extern CHIP_ERROR Find(const TLVReader & aReader, const uint64_t & aTag, TLVReader & aResult, bool aRecurse);
59
60 extern CHIP_ERROR Find(const TLVReader & aReader, IterateHandler aHandler, void * aContext, TLVReader & aResult);
61 extern CHIP_ERROR Find(const TLVReader & aReader, IterateHandler aHandler, void * aContext, TLVReader & aResult, bool aRecurse);
62 } // namespace Utilities
63
64 } // namespace TLV
65
66 } // namespace chip
67
68 #endif // CHIPTLVUTILITIES_HPP