mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 02:06:08 +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 QPixmap;
|
||||||
class QStringList;
|
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
|
* \defgroup JSON Streaming operators for JSON
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#include "blackmisc/integersequence.h"
|
#include "blackmisc/integersequence.h"
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QLatin1String>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
@@ -102,6 +103,24 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
class CVariant;
|
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*
|
// *INDENT-OFF*
|
||||||
/*!
|
/*!
|
||||||
* Type wrapper for passing MetaFlag to CMetaClassIntrospector::with and CMetaClassIntrospector::without.
|
* Type wrapper for passing MetaFlag to CMetaClassIntrospector::with and CMetaClassIntrospector::without.
|
||||||
|
|||||||
Reference in New Issue
Block a user