Keyple Util C++ Library 2.0.0
Reference Terminal Reader API for C++
BerTlvUtil.h
Go to the documentation of this file.
1/**************************************************************************************************
2 * Copyright (c) 2021 Calypso Networks Association https://calypsonet.org/ *
3 * *
4 * See the NOTICE file(s) distributed with this work for additional information regarding *
5 * copyright ownership. *
6 * *
7 * This program and the accompanying materials are made available under the terms of the Eclipse *
8 * Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0 *
9 * *
10 * SPDX-License-Identifier: EPL-2.0 *
11 **************************************************************************************************/
12
13#pragma once
14
15#include <map>
16#include <vector>
17
18 /* Core */
19#include "KeypleUtilExport.h"
20
21namespace keyple {
22namespace core {
23namespace util {
24
41public:
59 static const std::map<const int, const std::vector<uint8_t>> parseSimple(
60 const std::vector<uint8_t>& tlvStructure, const bool primitiveOnly);
61
73 static const std::map<const int, std::vector<std::vector<uint8_t>>> parse(
74 const std::vector<uint8_t>& tlvStructure, const bool primitiveOnly);
75
84 static bool isConstructed(const int tagId);
85
86private:
90 BerTlvUtil();
91
101 static const std::map<const int, const std::vector<uint8_t>> parseBufferSimple(
102 const std::vector<uint8_t>& tlvStructure, const bool primitiveOnly);
103
113 static const std::map<const int, std::vector<std::vector<uint8_t>>> parseBuffer(
114 const std::vector<uint8_t>& tlvStructure, const bool primitiveOnly);
115
125 static std::vector<std::vector<uint8_t>>& getOrInitTagValues(
126 std::map<const int, std::vector<std::vector<uint8_t>>>& tlvs, const int tag);
127
138 static int getTagSize(const std::vector<uint8_t>& tlvStructure, const int offset);
139
151 static int getTag(const std::vector<uint8_t>& tlvStructure, const int offset, const int size);
152
163 static int getLengthSize(const std::vector<uint8_t>& tlvStructure, const int offset);
164
176 static int getLength(const std::vector<uint8_t>& tlvStructure,
177 const int offset,
178 const int size);
179};
180
181}
182}
183}
#define KEYPLEUTIL_API