Форматирование кода
This commit is contained in:
parent
827f153c2e
commit
cb6a82d9b5
@ -1 +1 @@
|
|||||||
Subproject commit b05da4d52a0379c9ca9c06fd7898641268624238
|
Subproject commit 69fc1a43dfa7336d5878b0b28a0b9c0e07bf740e
|
@ -105,7 +105,6 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Constructor
|
/** Constructor
|
||||||
* @param container The container to construct from
|
* @param container The container to construct from
|
||||||
*/
|
*/
|
||||||
@ -121,7 +120,6 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template< class CharT, class Traits, class Allocator >
|
template< class CharT, class Traits, class Allocator >
|
||||||
explicit
|
explicit
|
||||||
span( std::basic_string< CharT, Traits, Allocator >& s ) :
|
span( std::basic_string< CharT, Traits, Allocator >& s ) :
|
||||||
@ -130,7 +128,6 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template< class CharT, class Traits, class Allocator >
|
template< class CharT, class Traits, class Allocator >
|
||||||
explicit
|
explicit
|
||||||
span( std::basic_string< CharT, Traits, Allocator > const& s ) :
|
span( std::basic_string< CharT, Traits, Allocator > const& s ) :
|
||||||
@ -139,7 +136,6 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Assignment
|
/** Assignment
|
||||||
* @param container The container to assign from
|
* @param container The container to assign from
|
||||||
*/
|
*/
|
||||||
@ -154,7 +150,6 @@ public:
|
|||||||
return( *this );
|
return( *this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template< class CharT, class Traits, class Allocator >
|
template< class CharT, class Traits, class Allocator >
|
||||||
span&
|
span&
|
||||||
operator=( std::basic_string<
|
operator=( std::basic_string<
|
||||||
@ -165,7 +160,6 @@ public:
|
|||||||
return( *this );
|
return( *this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template< class CharT, class Traits, class Allocator >
|
template< class CharT, class Traits, class Allocator >
|
||||||
span&
|
span&
|
||||||
operator=( std::basic_string<
|
operator=( std::basic_string<
|
||||||
@ -176,7 +170,6 @@ public:
|
|||||||
return( *this );
|
return( *this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Returns `true` if the span is empty
|
/// Returns `true` if the span is empty
|
||||||
bool
|
bool
|
||||||
empty() const
|
empty() const
|
||||||
@ -184,7 +177,6 @@ public:
|
|||||||
return( m_size == 0 );
|
return( m_size == 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Returns a pointer to the beginning of the span
|
/// Returns a pointer to the beginning of the span
|
||||||
T*
|
T*
|
||||||
data() const
|
data() const
|
||||||
@ -192,7 +184,6 @@ public:
|
|||||||
return( m_data );
|
return( m_data );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Returns the number of elements in the span
|
/// Returns the number of elements in the span
|
||||||
std::size_t
|
std::size_t
|
||||||
size() const
|
size() const
|
||||||
@ -200,7 +191,6 @@ public:
|
|||||||
return( m_size );
|
return( m_size );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Returns an iterator to the beginning of the span
|
/// Returns an iterator to the beginning of the span
|
||||||
Iterator
|
Iterator
|
||||||
begin() const
|
begin() const
|
||||||
@ -208,7 +198,6 @@ public:
|
|||||||
return( m_data );
|
return( m_data );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Returns an iterator to the beginning of the span
|
/// Returns an iterator to the beginning of the span
|
||||||
ConstIterator
|
ConstIterator
|
||||||
cbegin() const
|
cbegin() const
|
||||||
@ -216,7 +205,6 @@ public:
|
|||||||
return( m_data );
|
return( m_data );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Returns an iterator to one past the end of the span
|
/// Returns an iterator to one past the end of the span
|
||||||
Iterator
|
Iterator
|
||||||
end() const
|
end() const
|
||||||
@ -224,7 +212,6 @@ public:
|
|||||||
return( m_data + m_size );
|
return( m_data + m_size );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Returns an iterator to one past the end of the span
|
/// Returns an iterator to one past the end of the span
|
||||||
ConstIterator
|
ConstIterator
|
||||||
cend() const
|
cend() const
|
||||||
|
@ -23,7 +23,7 @@ template< typename T >
|
|||||||
class EndianTypesBase
|
class EndianTypesBase
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
#if defined ( _MSC_VER )
|
#if defined( _MSC_VER )
|
||||||
#pragma warning ( push )
|
#pragma warning ( push )
|
||||||
#endif
|
#endif
|
||||||
static T swapBytes( const T& b )
|
static T swapBytes( const T& b )
|
||||||
@ -35,7 +35,6 @@ protected:
|
|||||||
return( n );
|
return( n );
|
||||||
} // swapBytes
|
} // swapBytes
|
||||||
|
|
||||||
|
|
||||||
#if defined( _MSC_VER )
|
#if defined( _MSC_VER )
|
||||||
#pragma warning ( pop )
|
#pragma warning ( pop )
|
||||||
#endif
|
#endif
|
||||||
@ -53,7 +52,6 @@ protected:
|
|||||||
return( ( reinterpret_cast< const char& >( k_i ) == 1 ) ? b : EndianTypesBase< T >::swapBytes( b ) ); //NOLINT
|
return( ( reinterpret_cast< const char& >( k_i ) == 1 ) ? b : EndianTypesBase< T >::swapBytes( b ) ); //NOLINT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
LittleEndianType() = default;
|
LittleEndianType() = default;
|
||||||
@ -73,31 +71,31 @@ public:
|
|||||||
template < typename U > explicit operator U() const { return( U( transform( m_data ) ) ); }
|
template < typename U > explicit operator U() const { return( U( transform( m_data ) ) ); }
|
||||||
explicit operator T() const { return( transform( m_data ) ); }
|
explicit operator T() const { return( transform( m_data ) ); }
|
||||||
|
|
||||||
template < typename U > bool operator ==( U const& o ) { return( U( *this ) == o ); }
|
template < typename U > bool operator==( U const& o ) { return( U( *this ) == o ); }
|
||||||
template < typename U > bool operator !=( U const& o ) { return( U( *this ) != o ); }
|
template < typename U > bool operator!=( U const& o ) { return( U( *this ) != o ); }
|
||||||
|
|
||||||
// Arithmetic assignment operators
|
// Arithmetic assignment operators
|
||||||
LittleEndianType& operator ++() /* prefix */ { *this = T( *this ) + T( 1 ); return( *this ); }
|
LittleEndianType& operator++() /* prefix */ { *this = T( *this ) + T( 1 ); return( *this ); }
|
||||||
LittleEndianType operator ++( int ) /* suffix */ { LittleEndianType t( *this ); *this = T( *this ) + T( 1 ); return( t ); }
|
LittleEndianType operator++( int ) /* suffix */ { LittleEndianType t( *this ); *this = T( *this ) + T( 1 ); return( t ); }
|
||||||
LittleEndianType& operator --() /* prefix */ { *this = T( *this ) - T( 1 ); return( *this ); }
|
LittleEndianType& operator--() /* prefix */ { *this = T( *this ) - T( 1 ); return( *this ); }
|
||||||
LittleEndianType operator --( int ) /* suffix */ { LittleEndianType t( *this ); *this = T( *this ) - T( 1 ); return( t ); }
|
LittleEndianType operator--( int ) /* suffix */ { LittleEndianType t( *this ); *this = T( *this ) - T( 1 ); return( t ); }
|
||||||
|
|
||||||
// Compound assignment operators
|
// Compound assignment operators
|
||||||
LittleEndianType& operator +=( const T& b ) { *this = T( *this ) + b; return( *this ); }
|
LittleEndianType& operator+=( const T& b ) { *this = T( *this ) + b; return( *this ); }
|
||||||
LittleEndianType& operator -=( const T& b ) { *this = T( *this ) - b; return( *this ); }
|
LittleEndianType& operator-=( const T& b ) { *this = T( *this ) - b; return( *this ); }
|
||||||
LittleEndianType& operator *=( const T& b ) { *this = T( *this ) * b; return( *this ); }
|
LittleEndianType& operator*=( const T& b ) { *this = T( *this ) * b; return( *this ); }
|
||||||
LittleEndianType& operator /=( const T& b ) { *this = T( *this ) / b; return( *this ); }
|
LittleEndianType& operator/=( const T& b ) { *this = T( *this ) / b; return( *this ); }
|
||||||
LittleEndianType& operator %=( const T& b ) { *this = T( *this ) % b; return( *this ); }
|
LittleEndianType& operator%=( const T& b ) { *this = T( *this ) % b; return( *this ); }
|
||||||
LittleEndianType& operator &=( const T& b ) { *this = T( *this ) & b; return( *this ); }
|
LittleEndianType& operator&=( const T& b ) { *this = T( *this ) & b; return( *this ); }
|
||||||
LittleEndianType& operator |=( const T& b ) { *this = T( *this ) | b; return( *this ); }
|
LittleEndianType& operator|=( const T& b ) { *this = T( *this ) | b; return( *this ); }
|
||||||
LittleEndianType& operator ^=( const T& b ) { *this = T( *this ) ^ b; return( *this ); }
|
LittleEndianType& operator^=( const T& b ) { *this = T( *this ) ^ b; return( *this ); }
|
||||||
LittleEndianType& operator <<=( const T& b ) { *this = T( T( *this ) << b ); return( *this ); }
|
LittleEndianType& operator<<=( const T& b ) { *this = T( T( *this ) << b ); return( *this ); }
|
||||||
LittleEndianType& operator >>=( const T& b ) { *this = T( T( *this ) >> b ); return( *this ); }
|
LittleEndianType& operator>>=( const T& b ) { *this = T( T( *this ) >> b ); return( *this ); }
|
||||||
friend std::ostream& operator <<( std::ostream& out, const LittleEndianType b ) { out << T( b ); return( out ); }
|
friend std::ostream& operator<<( std::ostream& out, const LittleEndianType b ) { out << T( b ); return( out ); }
|
||||||
friend std::istream& operator >>( std::istream& in, LittleEndianType& b ) { T val; in >> val; b = val; return( in ); }
|
friend std::istream& operator>>( std::istream& in, LittleEndianType& b ) { T val; in >> val; b = val; return( in ); }
|
||||||
std::string toStdString() { return( std::to_string( transform( m_data ) ) ); }
|
std::string toStdString() { return( std::to_string( transform( m_data ) ) ); }
|
||||||
#ifdef QT_CORE_LIB
|
#ifdef QT_CORE_LIB
|
||||||
friend QDebug& operator <<( QDebug& out, const LittleEndianType< T > b ) { out << T( b ); return( out ); }
|
friend QDebug& operator<<( QDebug& out, const LittleEndianType< T > b ) { out << T( b ); return( out ); }
|
||||||
QString toQString() { return( QString::number( transform( m_data ) ) ); }
|
QString toQString() { return( QString::number( transform( m_data ) ) ); }
|
||||||
#endif
|
#endif
|
||||||
}; // class LittleEndianType
|
}; // class LittleEndianType
|
||||||
@ -114,7 +112,6 @@ protected:
|
|||||||
return( ( reinterpret_cast< const char& >( k_i ) == 1 ) ? EndianTypesBase< T >::swapBytes( b ) : b ); //NOLINT
|
return( ( reinterpret_cast< const char& >( k_i ) == 1 ) ? EndianTypesBase< T >::swapBytes( b ) : b ); //NOLINT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
BigEndianType() = default;
|
BigEndianType() = default;
|
||||||
@ -134,31 +131,31 @@ public:
|
|||||||
template < typename U > explicit operator U() const { return( U( transform( m_data ) ) ); }
|
template < typename U > explicit operator U() const { return( U( transform( m_data ) ) ); }
|
||||||
explicit operator T() const { return( transform( m_data ) ); }
|
explicit operator T() const { return( transform( m_data ) ); }
|
||||||
|
|
||||||
template < typename U > bool operator ==( U const& o ) { return( U( *this ) == o ); }
|
template < typename U > bool operator==( U const& o ) { return( U( *this ) == o ); }
|
||||||
template < typename U > bool operator !=( U const& o ) { return( U( *this ) != o ); }
|
template < typename U > bool operator!=( U const& o ) { return( U( *this ) != o ); }
|
||||||
|
|
||||||
// Arithmetic assignment operators
|
// Arithmetic assignment operators
|
||||||
BigEndianType& operator ++() /* prefix */ { *this = T( *this ) + 1; return( *this ); }
|
BigEndianType& operator++() /* prefix */ { *this = T( *this ) + 1; return( *this ); }
|
||||||
BigEndianType operator ++( int ) /* suffix */ { BigEndianType t( *this ); *this = T( *this ) + 1; return( t ); }
|
BigEndianType operator++( int ) /* suffix */ { BigEndianType t( *this ); *this = T( *this ) + 1; return( t ); }
|
||||||
BigEndianType& operator --() /* prefix */ { *this = T( *this ) - 1; return( *this ); }
|
BigEndianType& operator--() /* prefix */ { *this = T( *this ) - 1; return( *this ); }
|
||||||
BigEndianType operator --( int ) /* suffix */ { BigEndianType t( *this ); *this = T( *this ) - 1; return( t ); }
|
BigEndianType operator--( int ) /* suffix */ { BigEndianType t( *this ); *this = T( *this ) - 1; return( t ); }
|
||||||
|
|
||||||
// Compound assignment operators
|
// Compound assignment operators
|
||||||
BigEndianType& operator +=( const T& b ) { *this = T( *this ) + b; return( *this ); }
|
BigEndianType& operator+=( const T& b ) { *this = T( *this ) + b; return( *this ); }
|
||||||
BigEndianType& operator -=( const T& b ) { *this = T( *this ) - b; return( *this ); }
|
BigEndianType& operator-=( const T& b ) { *this = T( *this ) - b; return( *this ); }
|
||||||
BigEndianType& operator *=( const T& b ) { *this = T( *this ) * b; return( *this ); }
|
BigEndianType& operator*=( const T& b ) { *this = T( *this ) * b; return( *this ); }
|
||||||
BigEndianType& operator /=( const T& b ) { *this = T( *this ) / b; return( *this ); }
|
BigEndianType& operator/=( const T& b ) { *this = T( *this ) / b; return( *this ); }
|
||||||
BigEndianType& operator %=( const T& b ) { *this = T( *this ) % b; return( *this ); }
|
BigEndianType& operator%=( const T& b ) { *this = T( *this ) % b; return( *this ); }
|
||||||
BigEndianType& operator &=( const T& b ) { *this = T( *this ) & b; return( *this ); }
|
BigEndianType& operator&=( const T& b ) { *this = T( *this ) & b; return( *this ); }
|
||||||
BigEndianType& operator |=( const T& b ) { *this = T( *this ) | b; return( *this ); }
|
BigEndianType& operator|=( const T& b ) { *this = T( *this ) | b; return( *this ); }
|
||||||
BigEndianType& operator ^=( const T& b ) { *this = T( *this ) ^ b; return( *this ); }
|
BigEndianType& operator^=( const T& b ) { *this = T( *this ) ^ b; return( *this ); }
|
||||||
BigEndianType& operator <<=( const T& b ) { *this = T( T( *this ) << b ); return( *this ); }
|
BigEndianType& operator<<=( const T& b ) { *this = T( T( *this ) << b ); return( *this ); }
|
||||||
BigEndianType& operator >>=( const T& b ) { *this = T( T( *this ) >> b ); return( *this ); }
|
BigEndianType& operator>>=( const T& b ) { *this = T( T( *this ) >> b ); return( *this ); }
|
||||||
friend std::ostream& operator <<( std::ostream& out, const BigEndianType b ) { out << T( b ); return( out ); }
|
friend std::ostream& operator<<( std::ostream& out, const BigEndianType b ) { out << T( b ); return( out ); }
|
||||||
friend std::istream& operator >>( std::istream& in, BigEndianType& b ) { T val; in >> val; b = val; return( in ); }
|
friend std::istream& operator>>( std::istream& in, BigEndianType& b ) { T val; in >> val; b = val; return( in ); }
|
||||||
std::string toStdString() { return( std::to_string( transform( m_data ) ) ); }
|
std::string toStdString() { return( std::to_string( transform( m_data ) ) ); }
|
||||||
#ifdef QT_CORE_LIB
|
#ifdef QT_CORE_LIB
|
||||||
friend QDebug& operator <<( QDebug& out, const BigEndianType< T > b ) { out << T( b ); return( out ); }
|
friend QDebug& operator<<( QDebug& out, const BigEndianType< T > b ) { out << T( b ); return( out ); }
|
||||||
QString toQString() { return( QString::number( transform( m_data ) ) ); }
|
QString toQString() { return( QString::number( transform( m_data ) ) ); }
|
||||||
#endif
|
#endif
|
||||||
}; // class BigEndianType
|
}; // class BigEndianType
|
||||||
|
@ -17,7 +17,7 @@ struct EnableBitMaskOperators
|
|||||||
|
|
||||||
template< typename Enum >
|
template< typename Enum >
|
||||||
typename std::enable_if< EnableBitMaskOperators< Enum >::kEnable, Enum >::type
|
typename std::enable_if< EnableBitMaskOperators< Enum >::kEnable, Enum >::type
|
||||||
operator ~( Enum e )
|
operator~( Enum e )
|
||||||
{
|
{
|
||||||
using Underlying = typename std::underlying_type< Enum >::type;
|
using Underlying = typename std::underlying_type< Enum >::type;
|
||||||
return( static_cast< Enum >( ~static_cast< Underlying >( e ) ) );
|
return( static_cast< Enum >( ~static_cast< Underlying >( e ) ) );
|
||||||
@ -26,7 +26,7 @@ operator ~( Enum e )
|
|||||||
|
|
||||||
template< typename Enum >
|
template< typename Enum >
|
||||||
typename std::enable_if< EnableBitMaskOperators< Enum >::kEnable, Enum >::type
|
typename std::enable_if< EnableBitMaskOperators< Enum >::kEnable, Enum >::type
|
||||||
operator |( Enum lhs, Enum rhs )
|
operator|( Enum lhs, Enum rhs )
|
||||||
{
|
{
|
||||||
using Underlying = typename std::underlying_type< Enum >::type;
|
using Underlying = typename std::underlying_type< Enum >::type;
|
||||||
return( static_cast< Enum >( static_cast< Underlying >( lhs ) | static_cast< Underlying >( rhs ) ) );
|
return( static_cast< Enum >( static_cast< Underlying >( lhs ) | static_cast< Underlying >( rhs ) ) );
|
||||||
@ -35,7 +35,7 @@ operator |( Enum lhs, Enum rhs )
|
|||||||
|
|
||||||
template< typename Enum >
|
template< typename Enum >
|
||||||
typename std::enable_if< EnableBitMaskOperators< Enum >::kEnable, typename std::add_lvalue_reference< Enum >::type >::type
|
typename std::enable_if< EnableBitMaskOperators< Enum >::kEnable, typename std::add_lvalue_reference< Enum >::type >::type
|
||||||
operator |=( Enum& lhs, Enum rhs )
|
operator|=( Enum& lhs, Enum rhs )
|
||||||
{
|
{
|
||||||
using Underlying = typename std::underlying_type< Enum >::type;
|
using Underlying = typename std::underlying_type< Enum >::type;
|
||||||
lhs = static_cast< Enum >( static_cast< Underlying >( lhs ) | static_cast< Underlying >( rhs ) );
|
lhs = static_cast< Enum >( static_cast< Underlying >( lhs ) | static_cast< Underlying >( rhs ) );
|
||||||
@ -45,7 +45,7 @@ operator |=( Enum& lhs, Enum rhs )
|
|||||||
|
|
||||||
template< typename Enum >
|
template< typename Enum >
|
||||||
typename std::enable_if< EnableBitMaskOperators< Enum >::kEnable, Enum >::type
|
typename std::enable_if< EnableBitMaskOperators< Enum >::kEnable, Enum >::type
|
||||||
operator &( Enum lhs, Enum rhs )
|
operator&( Enum lhs, Enum rhs )
|
||||||
{
|
{
|
||||||
using Underlying = typename std::underlying_type< Enum >::type;
|
using Underlying = typename std::underlying_type< Enum >::type;
|
||||||
return( static_cast< Enum >( static_cast< Underlying >( lhs ) & static_cast< Underlying >( rhs ) ) );
|
return( static_cast< Enum >( static_cast< Underlying >( lhs ) & static_cast< Underlying >( rhs ) ) );
|
||||||
@ -54,7 +54,7 @@ operator &( Enum lhs, Enum rhs )
|
|||||||
|
|
||||||
template< typename Enum >
|
template< typename Enum >
|
||||||
typename std::enable_if< EnableBitMaskOperators< Enum >::kEnable, typename std::add_lvalue_reference< Enum >::type >::type
|
typename std::enable_if< EnableBitMaskOperators< Enum >::kEnable, typename std::add_lvalue_reference< Enum >::type >::type
|
||||||
operator &=( Enum& lhs, Enum rhs )
|
operator&=( Enum& lhs, Enum rhs )
|
||||||
{
|
{
|
||||||
using Underlying = typename std::underlying_type< Enum >::type;
|
using Underlying = typename std::underlying_type< Enum >::type;
|
||||||
lhs = static_cast< Enum >( static_cast< Underlying >( lhs ) & static_cast< Underlying >( rhs ) );
|
lhs = static_cast< Enum >( static_cast< Underlying >( lhs ) & static_cast< Underlying >( rhs ) );
|
||||||
|
@ -60,7 +60,6 @@ public:
|
|||||||
return( sPaths );
|
return( sPaths );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Обновление путей с учётом расположения исполняемого файла
|
* @brief Обновление путей с учётом расположения исполняемого файла
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user