Keypop Card C++ API 2.0.0
Reference Card API for C++
CardSelectionResponse.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 <memory>
13#include <ostream>
14#include <string>
15#include <vector>
16
17/* Calypsonet Terminal Card */
20
21namespace keypop {
22namespace card {
23
34public:
56 virtual const std::string& getPowerOnData() const = 0;
57
65 virtual const std::shared_ptr<ApduResponseApi> getSelectApplicationResponse() const = 0;
66
73 virtual bool hasMatched() const = 0;
74
83 virtual const std::shared_ptr<CardResponseApi> getCardResponse() const = 0;
84
88 friend std::ostream&
89 operator<<(std::ostream& os, const std::shared_ptr<CardSelectionResponseApi> csr) {
90 os << "CARD_SELECTION_RESPONSE_API: {"
91 << "HAS_MATCHED: " << csr->hasMatched() << "<TODO>"
92 << "}";
93
94 return os;
95 }
96
100 friend std::ostream&
102 std::ostream& os, const std::vector<std::shared_ptr<CardSelectionResponseApi>>& csrs) {
103 os << "CARD_SELECTION_RESPONSE_APIS: {";
104
105 for (auto it = std::begin(csrs); it != std::end(csrs); ++it) {
106 os << *it;
107 if (it != csrs.end() - 1) {
108 os << ", ";
109 }
110 }
111
112 os << "}";
113
114 return os;
115 }
116};
117
118} /* namespace card */
119} /* namespace keypop */
virtual const std::shared_ptr< CardResponseApi > getCardResponse() const =0
friend std::ostream & operator<<(std::ostream &os, const std::shared_ptr< CardSelectionResponseApi > csr)
virtual const std::shared_ptr< ApduResponseApi > getSelectApplicationResponse() const =0
virtual bool hasMatched() const =0
virtual const std::string & getPowerOnData() const =0