3 * Copyright (c) 2020 Project CHIP Authors
4 * Copyright (c) 2016-2017 Nest Labs, Inc.
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 * This file defines List parser in CHIP interaction model
26 #ifndef _CHIP_INTERACTION_MODEL_MESSAGE_DEF_LIST_PARSER_H
27 #define _CHIP_INTERACTION_MODEL_MESSAGE_DEF_LIST_PARSER_H
31 #include <core/CHIPCore.h>
32 #include <core/CHIPTLV.h>
33 #include <support/CodeUtils.h>
34 #include <support/logging/CHIPLogging.h>
35 #include <util/basic-types.h>
39 class ListParser : public chip::app::Parser
46 * @brief Initialize the parser object with TLVReader
48 * @param [in] aReader A pointer to a TLVReader, which should be on the element of the array element
50 * @return #CHIP_NO_ERROR on success
52 CHIP_ERROR Init(const chip::TLV::TLVReader & aReader);
55 * @brief Initialize the parser object with TLVReader if context tag exists
57 * @param [in] aReader A pointer to a TLVReader, which should be on the element of the array element
58 * @param [in] aContextTagToFind A context tag it tries to find
60 * @return #CHIP_NO_ERROR on success
62 CHIP_ERROR InitIfPresent(const chip::TLV::TLVReader & aReader, const uint8_t aContextTagToFind);
65 * @brief Iterate to next element
67 * @return #CHIP_NO_ERROR on success
75 #endif // _CHIP_INTERACTION_MODEL_MESSAGE_DEF_LIST_PARSER_H