Чистка кода

This commit is contained in:
Andrei Astafev 2020-05-15 20:14:21 +03:00
parent 27b3f4182a
commit e0c9e2f551
3 changed files with 10 additions and 9 deletions

View File

@ -48,4 +48,4 @@ int main( int argc, char** argv )
qDebug() << "userLogDirectory : " << paths.userLogDirectory(); qDebug() << "userLogDirectory : " << paths.userLogDirectory();
return( 0 ); return( 0 );
} } // main

View File

@ -3,7 +3,7 @@
#pragma once #pragma once
#include "span.hpp" #include <myx/base/span.hpp>
#include <cassert> #include <cassert>
#include <cstdint> #include <cstdint>
@ -62,6 +62,7 @@ public:
// 1. Set an OE from a PE // 1. Set an OE from a PE
// 2. Get a PE from an OE // 2. Get a PE from an OE
// Storage in // Storage in
// NOLINTNEXTLINE
LittleEndianType( const T& b ) : LittleEndianType( const T& b ) :
m_data( transform( b ) ) m_data( transform( b ) )
{} {}
@ -96,12 +97,11 @@ public:
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 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
template< typename T > template< typename T >
class BigEndianType : public EndianTypesBase< T > class BigEndianType : public EndianTypesBase< T >
{ {
@ -123,6 +123,7 @@ public:
// 1. Set an OE from a PE // 1. Set an OE from a PE
// 2. Get a PE from an OE // 2. Get a PE from an OE
// Storage in // Storage in
// NOLINTNEXTLINE
BigEndianType( const T& b ) : BigEndianType( const T& b ) :
m_data( transform( b ) ) m_data( transform( b ) )
{} {}
@ -157,7 +158,7 @@ public:
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 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

View File

@ -19,11 +19,11 @@ namespace myx {
namespace base { namespace base {
template< typename ... Ts > struct make_void { typedef void type;}; template< typename ... Ts > struct make_void { typedef void type;}; // NOLINT
template< typename ... Ts > using void_t = typename make_void< Ts... >::type; template< typename ... Ts > using void_t = typename make_void< Ts... >::type; // NOLINT
template< class T, class E, class = void > template< class T, class E, class = void >
struct is_contiguous_container : std::false_type {}; struct is_contiguous_container : std::false_type {}; // NOLINT
template< class T, class E > template< class T, class E >
struct is_contiguous_container< T, E, void_t< struct is_contiguous_container< T, E, void_t<
@ -52,7 +52,7 @@ struct is_contiguous_container< T, E, void_t<
@tparam T The type pointed to by span iterators @tparam T The type pointed to by span iterators
*/ */
template< class T > template< class T >
class span class span // NOLINT
{ {
T* m_data = nullptr; T* m_data = nullptr;
std::size_t m_size = 0; std::size_t m_size = 0;