mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Issue #77 Move CExplicitLatin1String from json.h to metaclass.h
This commit is contained in:
@@ -32,27 +32,6 @@ class QDateTime;
|
||||
class QPixmap;
|
||||
class QStringList;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
/*!
|
||||
* Simple literal type containing a single QLatin1String.
|
||||
*
|
||||
* Just useful for encapsulating a QLatin1String in a way that inhibits implicit conversion to QString
|
||||
* to avoid ambiguities in overload resolution.
|
||||
*/
|
||||
struct CExplicitLatin1String
|
||||
{
|
||||
//! Embedded string.
|
||||
const QLatin1String m_latin1;
|
||||
|
||||
//! Implicit constructor.
|
||||
constexpr CExplicitLatin1String(QLatin1String s) : m_latin1(s) {}
|
||||
|
||||
//! Implicit conversion.
|
||||
constexpr operator QLatin1String() const { return m_latin1; }
|
||||
};
|
||||
}
|
||||
|
||||
/*!
|
||||
* \defgroup JSON Streaming operators for JSON
|
||||
*/
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "blackmisc/integersequence.h"
|
||||
#include <QHash>
|
||||
#include <QString>
|
||||
#include <QLatin1String>
|
||||
#include <type_traits>
|
||||
#include <functional>
|
||||
|
||||
@@ -102,6 +103,24 @@ namespace BlackMisc
|
||||
{
|
||||
class CVariant;
|
||||
|
||||
/*!
|
||||
* Simple literal type containing a single QLatin1String.
|
||||
*
|
||||
* Just useful for encapsulating a QLatin1String in a way that inhibits implicit conversion to QString
|
||||
* to avoid ambiguities in overload resolution.
|
||||
*/
|
||||
struct CExplicitLatin1String
|
||||
{
|
||||
//! Embedded string.
|
||||
const QLatin1String m_latin1;
|
||||
|
||||
//! Implicit constructor.
|
||||
constexpr CExplicitLatin1String(QLatin1String s) : m_latin1(s) {}
|
||||
|
||||
//! Implicit conversion.
|
||||
constexpr operator QLatin1String() const { return m_latin1; }
|
||||
};
|
||||
|
||||
// *INDENT-OFF*
|
||||
/*!
|
||||
* Type wrapper for passing MetaFlag to CMetaClassIntrospector::with and CMetaClassIntrospector::without.
|
||||
|
||||
Reference in New Issue
Block a user