ALib C++ Library
by
Library Version:
2510 R0
Documentation generated by
Loading...
Searching...
No Matches
home
dev
A-Worx
ALib
src
ALib.Compatibility.QTBoxing.H
Go to the documentation of this file.
1
//==================================================================================================
2
/// \file
3
/// This header-file is part of the \aliblong.
4
///
5
/// \emoji :copyright: 2013-2025 A-Worx GmbH, Germany.
6
/// Published under \ref mainpage_license "Boost Software License".
7
///
8
/// <b>Legal Notice:</b>
9
/// This is an optional extension header to provide compatibility between ALib and
10
/// the QT class library.
11
/// All information about QT is found at https://www.qt.io
12
/// ALib otherwise does not use or rely on QT.
13
/// The use of QT is bound to the QT license restrictions.
14
//==================================================================================================
15
#ifndef HPP_ALIB_COMPATIBILITY_BOXING_QT
16
#define HPP_ALIB_COMPATIBILITY_BOXING_QT 1
17
#pragma once
18
#if !defined(DOXYGEN)
19
# include "
alib/alib.inl
"
20
#endif
21
22
ALIB_ASSERT_MODULE
(BOXING)
23
24
#if !defined(ALIB_QT_LIB_NOT_FOUND)
// this is only set in an automated test project
25
26
#if defined(__clang__)
27
#pragma clang diagnostic push
28
#pragma clang diagnostic ignored "-Wreserved-id-macro"
29
#pragma clang diagnostic ignored "-Wredundant-parens"
30
#pragma clang diagnostic ignored "-Wcovered-switch-default"
31
#pragma clang diagnostic ignored "-Wsign-conversion"
32
#pragma clang diagnostic ignored "-Wdeprecated"
33
#pragma clang diagnostic ignored "-Wunused-variable"
34
#pragma clang diagnostic ignored "-Wcomma"
35
#pragma clang diagnostic ignored "-Wduplicate-enum"
36
#endif
37
#include <QtCore/QString>
38
#include <QtCore/QVector>
39
40
#if defined(__clang__)
41
#pragma clang diagnostic pop
42
#endif
43
44
# include "
ALib.Compatibility.QTCharacters.H
"
45
46
#include "
ALib.Boxing.H
"
47
#include <functional>
48
49
namespace
alib::boxing::compatibility
{
50
/// This namespace documents compatibility features of \alib_boxing_nl and the
51
/// \https{QT Class Library,www.qt.io}.
52
namespace
qt
{
53
54
55
56
void
BootstrapQTStringBoxing
();
57
/// Initializes \alib_boxing_nl in respect to boxing QT string-types.
58
///
59
/// This method is \b not automatically invoked with function \alib{Bootstrap}, because support
60
/// for boxing QT string-types is optional and provided with the inclusion of header
61
/// \implude{Compatibility.QTBoxing}.
62
///
63
/// In general, boxing of QT string-types works well without the one-time invocation of
64
/// this function at the bootstrap section of a process.
65
/// This method registers box-function \alib{boxing;FAppend} for QT string
66
/// types when \ref alib_boxing_customizing_identity "custom boxing is bypassed" by wrapping the
67
/// types in \c std::reference_wrapper<T>.
68
/// The function is implemented with the help of \alib{boxing;FAppend::WrappedAppendable}
69
/// for wrapped types \b QByteArray, \b QQLatin1String and \b QString, each for character types
70
/// \b nchar and \b wchar.
71
///
72
/// \note
73
/// If invoked after bootstrap and module \alib_monomem_nl is included in the \alibbuild,
74
/// mutex \alib{monomem;GLOBAL_ALLOCATOR_LOCK} has to be locked before an invocation.
75
inline
void
BootstrapQTStringBoxing
()
76
{
77
#if ALIB_STRINGS
78
alib::boxing::BootstrapRegister<boxing::FAppend<nchar, lang::HeapAllocator>
, ::std::reference_wrapper<QByteArray> >(
boxing::FAppend<nchar, lang::HeapAllocator>::WrappedAppendable
<QByteArray> );
79
alib::boxing::BootstrapRegister<boxing::FAppend<wchar, lang::HeapAllocator>
, ::std::reference_wrapper<QByteArray> >(
boxing::FAppend<wchar, lang::HeapAllocator>::WrappedAppendable
<QByteArray> );
80
alib::boxing::BootstrapRegister<boxing::FAppend<nchar, lang::HeapAllocator>
, ::std::reference_wrapper<QLatin1String>>(
boxing::FAppend<nchar, lang::HeapAllocator>::WrappedAppendable
<QLatin1String> );
81
alib::boxing::BootstrapRegister<boxing::FAppend<wchar, lang::HeapAllocator>
, ::std::reference_wrapper<QLatin1String>>(
boxing::FAppend<wchar, lang::HeapAllocator>::WrappedAppendable
<QLatin1String> );
82
alib::boxing::BootstrapRegister<boxing::FAppend<nchar, lang::HeapAllocator>
, ::std::reference_wrapper<QString> >(
boxing::FAppend<nchar, lang::HeapAllocator>::WrappedAppendable
<QString> );
83
alib::boxing::BootstrapRegister<boxing::FAppend<wchar, lang::HeapAllocator>
, ::std::reference_wrapper<QString> >(
boxing::FAppend<wchar, lang::HeapAllocator>::WrappedAppendable
<QString> );
84
#endif
85
}
86
}}
// namespace [alib::boxing::compatibility::qt]
87
88
#endif
// !defined(ALIB_QT_LIB_NOT_FOUND) // this is only set in an automated test project
89
90
#endif
// HPP_ALIB_COMPATIBILITY_BOXING_QT
91
ALib.Boxing.H
ALib.Compatibility.QTCharacters.H
alib.inl
ALIB_ASSERT_MODULE
#define ALIB_ASSERT_MODULE(modulename)
Definition
alib.inl:248
alib::boxing::compatibility::qt
Definition
ALib.Compatibility.QTBoxing.H:52
alib::boxing::compatibility::qt::BootstrapQTStringBoxing
void BootstrapQTStringBoxing()
Definition
ALib.Compatibility.QTBoxing.H:75
alib::boxing::compatibility
Definition
ALib.Boxing.StdFunctors.H:18
alib::boxing::BootstrapRegister
void BootstrapRegister(typename TFDecl::Signature function)
Definition
box.inl:1254
alib::boxing::FAppend::WrappedAppendable
static void WrappedAppendable(const Box &self, strings::TAString< TChar, TAllocator > &target)