Keyple Card Calypso C++ Library 2.1.0
Reference Terminal Reader API for C++
CalypsoCardClass.cpp
Go to the documentation of this file.
1/**************************************************************************************************
2 * Copyright (c) 2022 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#include "CalypsoCardClass.h"
14
15namespace keyple {
16namespace card {
17namespace calypso {
18
19const CalypsoCardClass CalypsoCardClass::LEGACY(0x94);
20const CalypsoCardClass CalypsoCardClass::LEGACY_STORED_VALUE(0xFA);
21const CalypsoCardClass CalypsoCardClass::ISO(0x00);
22const CalypsoCardClass CalypsoCardClass::UNKNOWN(0xff);
23
24CalypsoCardClass::CalypsoCardClass(const uint8_t cla) : mCla(cla) {}
25
26CalypsoCardClass::CalypsoCardClass(const CalypsoCardClass& o) : CalypsoCardClass(o.mCla) {}
27
29{
30 return mCla;
31}
32
34{
35 mCla = o.mCla;
36
37 return *this;
38}
39
41{
42 return mCla == o.mCla;
43}
44
45std::ostream& operator<<(std::ostream& os, const CalypsoCardClass& ccc)
46{
47 os << "CALYPSO_CARD_CLASS: ";
48
50 os << "ISO";
51 } else if (ccc.getValue() == CalypsoCardClass::LEGACY.getValue()) {
52 os << "LEGACY";
54 os << "LEGACY_STORED_VALUE";
55 } else {
56 os << "UNKNOWN";
57 }
58
59 return os;
60}
61
62}
63}
64}
bool operator==(const CalypsoCardClass &o) const
static const CalypsoCardClass LEGACY
CalypsoCardClass & operator=(const CalypsoCardClass &o)
static const CalypsoCardClass ISO
static const CalypsoCardClass UNKNOWN
static const CalypsoCardClass LEGACY_STORED_VALUE
CalypsoCardClass(const CalypsoCardClass &o)
std::ostream & operator<<(std::ostream &os, const std::shared_ptr< ApduRequestAdapter > ara)