Keyple Util C++ Library 2.3.0.5-SNAPSHOT
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#include <cstdint>
18
19 /* Core */
20#include "KeypleUtilExport.h"
21
22namespace keyple {
23namespace core {
24namespace util {
25
42public:
60 static const std::map<const int, const std::vector<uint8_t>> parseSimple(
61 const std::vector<uint8_t>& tlvStructure, const bool primitiveOnly);
62
74 static const std::map<const int, std::vector<std::vector<uint8_t>>> parse(
75 const std::vector<uint8_t>& tlvStructure, const bool primitiveOnly);
76
85 static bool isConstructed(const int tagId);
86
87private:
91 BerTlvUtil();
92
102 static const std::map<const int, const std::vector<uint8_t>> parseBufferSimple(
103 const std::vector<uint8_t>& tlvStructure, const bool primitiveOnly);
104
114 static const std::map<const int, std::vector<std::vector<uint8_t>>> parseBuffer(
115 const std::vector<uint8_t>& tlvStructure, const bool primitiveOnly);
116
126 static std::vector<std::vector<uint8_t>>& getOrInitTagValues(
127 std::map<const int, std::vector<std::vector<uint8_t>>>& tlvs, const int tag);
128
139 static int getTagSize(const std::vector<uint8_t>& tlvStructure, const int offset);
140
152 static int getTag(const std::vector<uint8_t>& tlvStructure, const int offset, const int size);
153
164 static int getLengthSize(const std::vector<uint8_t>& tlvStructure, const int offset);
165
177 static int getLength(const std::vector<uint8_t>& tlvStructure,
178 const int offset,
179 const int size);
180};
181
182}
183}
184}
#define KEYPLEUTIL_API