Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
32
33namespace QPcsc {
35{
36 LONG ret = SCARD_E_READER_UNAVAILABLE;
38
39 bool isOk() const { return ret == SCARD_S_SUCCESS; }
40};
41
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
71
72#endif // QPCSC_P_H
\inmodule QtCore
Definition qbytearray.h:57
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
Definition qbytearray.h:611
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
Definition qbytearray.h:124
friend class QString
Definition qbytearray.h:588
\inmodule QtCore
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
LPSTR Ptr
Definition qpcsc_p.h:60
LPCSTR CPtr
Definition qpcsc_p.h:59
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QString errorMessage(LONG error)
Definition qpcsc.cpp:12
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
GLfloat GLfloat p
[1]
ptrdiff_t qsizetype
Definition qtypes.h:165
bool isOk() const
Definition qpcsc_p.h:39
QByteArray response
Definition qpcsc_p.h:37