Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qpcsc_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QPCSC_P_H
5#define QPCSC_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#ifdef Q_OS_WIN
19# include <qt_windows.h>
20#endif
21#include <QtCore/QtGlobal>
22#ifdef Q_OS_DARWIN
23# include <PCSC/winscard.h>
24# include <PCSC/wintypes.h>
25#else
26# include <winscard.h>
27#endif
28#include <QtCore/QByteArray>
29#include <QtCore/QString>
30
31QT_BEGIN_NAMESPACE
32
33namespace QPcsc {
35{
38
39 bool isOk() const { return ret == SCARD_S_SUCCESS; }
40};
41
42QString errorMessage(LONG error);
43
44} // namespace QPcsc
45
46class QPcscSlotName : public
47#ifdef Q_OS_WIN
49#else
51#endif
52{
53public:
54#ifdef Q_OS_WIN
55 using CPtr = LPCWSTR;
56 using Ptr = LPWSTR;
57 explicit QPcscSlotName(CPtr p) : QString(reinterpret_cast<const QChar *>(p)) { }
58#else
59 using CPtr = LPCSTR;
60 using Ptr = LPSTR;
61 explicit QPcscSlotName(CPtr p) : QByteArray(p) { }
62#endif
63
64 CPtr ptr() const noexcept { return reinterpret_cast<CPtr>(constData()); }
65 Ptr ptr() { return reinterpret_cast<Ptr>(data()); }
66
67 static qsizetype nameSize(CPtr p);
68};
69
70QT_END_NAMESPACE
71
72#endif // QPCSC_P_H
Ptr ptr()
Definition qpcsc_p.h:65
QPcscSlotName(CPtr p)
Definition qpcsc_p.h:61
CPtr ptr() const noexcept
Definition qpcsc_p.h:64
static qsizetype nameSize(CPtr p)
Definition qpcsc.cpp:23
QString errorMessage(LONG error)
Definition qpcsc.cpp:12
bool isOk() const
Definition qpcsc_p.h:39
QByteArray response
Definition qpcsc_p.h:37