Keypop Card C++ API 2.0.0
Reference Card API for C++
ApduResponseApi.hpp
Go to the documentation of this file.
1/**************************************************************************************************
2 * Copyright (c) 2024 Calypso Networks Association https://calypsonet.org/ *
3 * *
4 * This program and the accompanying materials are made available under the *
5 * terms of the MIT License which is available at https://opensource.org/licenses/MIT. *
6 * *
7 * SPDX-License-Identifier: MIT *
8 **************************************************************************************************/
9
10#pragma once
11
12#include <cstdint>
13#include <memory>
14#include <ostream>
15#include <vector>
16
17namespace keypop {
18namespace card {
19
29public:
36 virtual const std::vector<uint8_t>& getApdu() const = 0;
37
44 virtual const std::vector<uint8_t> getDataOut() const = 0;
45
52 virtual int getStatusWord() const = 0;
53
57 friend std::ostream&
58 operator<<(std::ostream& os, const std::shared_ptr<ApduResponseApi> ara) {
59 os << "APDU_RESPONSE_API: {"
60 << "APDU = " << ara->getApdu() << ", "
61 << "DATA_OUT = " << ara->getDataOut() << ", "
62 << "STATUS_WORD = " << ara->getStatusWord() << "}";
63
64 return os;
65 }
66
70 friend std::ostream&
71 operator<<(std::ostream& os, const std::vector<std::shared_ptr<ApduResponseApi>>& aras) {
72 os << "APDU_RESPONSE_APIS: {";
73 for (auto it = aras.begin(); it != aras.end(); ++it) {
74 if (it != aras.begin())
75 os << ", ";
76 os << *it;
77 }
78 os << "}";
79
80 return os;
81 }
82};
83
84} /* namespace card */
85} /* namespace keypop */
friend std::ostream & operator<<(std::ostream &os, const std::shared_ptr< ApduResponseApi > ara)
virtual const std::vector< uint8_t > & getApdu() const =0
virtual const std::vector< uint8_t > getDataOut() const =0
virtual int getStatusWord() const =0