Finished importing the good bits from LW's library

This commit is contained in:
Emmanuel BENOîT 2017-11-01 23:21:01 +01:00
parent b9d77922ed
commit 4ab3dc1b29
82 changed files with 177 additions and 24084 deletions

View file

@ -2,11 +2,11 @@
/* DYNAMIC LIBRARIES - INLINE CODE ********************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_INLINE_DYNLIB
#define _H_LW_LIB_INLINE_DYNLIB
#ifndef _H_EBCL_INLINE_DYNLIB
#define _H_EBCL_INLINE_DYNLIB
#include <lw/lib/DynLib.hh>
namespace lw {
#include <ebcl/DynLib.hh>
namespace ebcl {
/*= T_DynLib =================================================================*/
@ -27,4 +27,4 @@ inline std::function< T > T_DynLib::getFunction(
}
#endif // _H_LW_LIB_INLINE_DYNLIB
#endif // _H_EBCL_INLINE_DYNLIB

View file

@ -1,154 +0,0 @@
/******************************************************************************/
/* UI<=>GAME MESSAGES - INLINE CODE *******************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_INLINE_MESSAGES
#define _H_LW_LIB_INLINE_MESSAGES
#include <lw/lib/GameLoop.hh>
namespace lw {
/*= T_ProgressInfoPart =======================================================*/
inline T_ProgressInfoPart::T_ProgressInfoPart( T_String text ,
uint32_t progress , uint32_t total ) noexcept
: text_( std::move( text ) ) , progress_( progress ) , total_( total )
{ }
inline T_ProgressInfoPart::T_ProgressInfoPart( T_ProgressInfoPart&& other ) noexcept
: text_( std::move( other.text_ ) ) , progress_( other.progress_ ) ,
total_( other.total_ )
{ }
inline T_ProgressInfoPart::T_ProgressInfoPart( T_ProgressInfoPart const& other )
: text_( other.text_ ) , progress_( other.progress_ ) , total_( other.total_ )
{ }
/*----------------------------------------------------------------------------*/
inline T_String const& T_ProgressInfoPart::text( ) const noexcept
{
return text_;
}
inline uint32_t T_ProgressInfoPart::progress( ) const noexcept
{
return progress_;
}
inline uint32_t T_ProgressInfoPart::total( ) const noexcept
{
return total_;
}
/*= T_ProgressInfo ===========================================================*/
inline T_ProgressInfo::T_ProgressInfo( T_String text , uint32_t progress , uint32_t total ) noexcept
: main_( std::move( text ) , progress , total ) , sub_( )
{ }
inline T_ProgressInfo::T_ProgressInfo( T_ProgressInfoPart main ) noexcept
: main_( std::move( main ) )
{ }
inline T_ProgressInfo::T_ProgressInfo(
T_ProgressInfoPart main ,
T_ProgressInfoPart sub ) noexcept
: main_( std::move( main ) ) ,
sub_( std::move( sub ) )
{ }
inline T_ProgressInfo::T_ProgressInfo( T_ProgressInfoPart main ,
T_String sText , uint32_t sProgress , uint32_t sTotal ) noexcept
: main_( std::move( main ) ) ,
sub_( T_ProgressInfoPart{ std::move( sText ) , sProgress , sTotal } )
{ }
inline T_ProgressInfo::T_ProgressInfo( T_String text , uint32_t progress , uint32_t total ,
T_String sText , uint32_t sProgress , uint32_t sTotal ) noexcept
: main_( std::move( text ) , progress , total ) ,
sub_( T_ProgressInfoPart{ std::move( sText ) , sProgress , sTotal } )
{ }
inline T_ProgressInfo::T_ProgressInfo( T_ProgressInfo&& other ) noexcept
: main_( std::move( other.main_ ) ) , sub_( std::move( other.sub_ ) )
{ }
/*----------------------------------------------------------------------------*/
inline T_ProgressInfoPart const& T_ProgressInfo::main( ) const noexcept
{
return main_;
}
inline bool T_ProgressInfo::hasSub( ) const noexcept
{
return sub_.present( );
}
inline T_ProgressInfoPart const& T_ProgressInfo::sub( ) const
{
return (T_ProgressInfoPart const&) sub_;
}
/*= T_GameMessage ============================================================*/
template< E_MessageDirection D , typename MT , typename MD >
inline constexpr T_GameMessage< D , MT , MD >::T_GameMessage( ) noexcept
: type_( ) , data_( )
{ }
template< E_MessageDirection D , typename MT , typename MD >
inline constexpr T_GameMessage< D , MT , MD >::T_GameMessage(
T_Type type ) noexcept
: type_( type ) , data_( )
{ }
template< E_MessageDirection D , typename MT , typename MD >
inline T_GameMessage< D , MT , MD >::T_GameMessage(
T_Type type ,
T_Data data ) noexcept
: type_( type ) , data_( data )
{ }
template< E_MessageDirection D , typename MT , typename MD >
inline T_GameMessage< D , MT , MD >::T_GameMessage(
T_Self_&& other ) noexcept
: type_( other.type_ ) , data_( std::move( other.data_ ) )
{ }
template< E_MessageDirection D , typename MT , typename MD >
inline T_GameMessage< D >& T_GameMessage< D , MT , MD >::operator =(
T_Self_&& other ) noexcept
{
type_ = other.type_;
data_ = std::move( other.data_ );
return *this;
}
/*----------------------------------------------------------------------------*/
template< E_MessageDirection D , typename MT , typename MD >
inline constexpr bool T_GameMessage< D , MT , MD >::hasMessage( ) const noexcept
{
return type_.present( );
}
template< E_MessageDirection D , typename MT , typename MD >
inline constexpr MT T_GameMessage< D , MT , MD >::type( ) const noexcept
{
return type_;
}
template< E_MessageDirection D , typename MT , typename MD >
template< typename T >
constexpr T const& T_GameMessage< D , MT , MD >::data( ) const
{
return (T const&)( (MD const&) data_ );
}
} // namespace lw
#endif // _H_LW_LIB_INLINE_MESSAGES

View file

@ -1,59 +0,0 @@
/******************************************************************************/
/* MODDING SYSTEM - INLINE CODE ***********************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_INLINE_MODS
#define _H_LW_LIB_INLINE_MODS
#include <lw/lib/Mods.hh>
namespace lw {
/*= T_ModIdentifier ==========================================================*/
inline bool T_ModIdentifier::operator ==(
T_ModIdentifier const& other ) const noexcept
{
return &other == this || ( name == other.name
&& version == other.version );
}
inline bool T_ModIdentifier::operator !=(
T_ModIdentifier const& other ) const noexcept
{
return &other != this && ( name != other.name
|| version != other.version );
}
inline M_DEFINE_HASH( T_ModIdentifier )
{
return ComputeHash( item.name ) * 47 + item.version;
}
inline M_DEFINE_COMPARATOR( T_ModIdentifier )
{
return a.compare( b );
}
inline M_LSHIFT_OP( T_StringBuilder , T_ModIdentifier const& )
{
obj << value.name << ':' << value.version;
return obj;
}
/*= T_ModInfo ================================================================*/
inline bool T_ModInfo::isUserInterface( ) const noexcept
{
return type == E_ModType::UI;
}
inline M_LSHIFT_OP( T_StringBuilder , T_ModInfo const& )
{
obj << value.identifier << '.' << value.revision;
return obj;
}
}
#endif // _H_LW_LIB_INLINE_MODS

View file

@ -2,10 +2,10 @@
/* SRD - BINARY STORAGE - INLINE CODE *****************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_INLINE_SRDBINARY
#define _H_LW_LIB_INLINE_SRDBINARY
#include <lw/lib/SRDBinary.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_SRDBINARY
#define _H_EBCL_INLINE_SRDBINARY
#include <ebcl/SRDBinary.hh>
namespace ebcl {
inline void SRDBinaryWriteTo( A_OutputStream& output , T_SRDList const& data )
@ -30,4 +30,4 @@ inline T_SRDList SRDBinaryReadFrom( T_String const& name , A_InputStream& input
} // namespace
#endif // _H_LW_LIB_INLINE_SRDBINARY
#endif // _H_EBCL_INLINE_SRDBINARY

View file

@ -2,10 +2,10 @@
/* SRD - DATA - INLINE CODE ***************************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_INLINE_SRDDATA
#define _H_LW_LIB_INLINE_SRDDATA
#include <lw/lib/SRDData.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_SRDDATA
#define _H_EBCL_INLINE_SRDDATA
#include <ebcl/SRDData.hh>
namespace ebcl {
/*= T_SRDLocationChaining ====================================================*/
@ -435,4 +435,4 @@ inline T_SRDLocation const& T_SRDToken::location( ) const noexcept
} // namespace
#endif // _H_LW_LIB_INLINE_SRDDATA
#endif // _H_EBCL_INLINE_SRDDATA

View file

@ -2,10 +2,10 @@
/* SRD - PARSER DEFINITIONS - INLINE CODE *************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_INLINE_SRDDEFINITIONS
#define _H_LW_LIB_INLINE_SRDDEFINITIONS
#include <lw/lib/SRDDefinitions.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_SRDDEFINITIONS
#define _H_EBCL_INLINE_SRDDEFINITIONS
#include <ebcl/SRDDefinitions.hh>
namespace ebcl {
/*= T_SRDEnum ================================================================*/
@ -522,4 +522,4 @@ inline T_SRDInputRule::T_SetContextExecutor OnExit( F_SRDHandler f )
} // namespace
#endif // _H_LW_LIB_INLINE_SRDDEFINITIONS
#endif // _H_EBCL_INLINE_SRDDEFINITIONS

View file

@ -2,10 +2,10 @@
/* SRD - INPUT AND OUTPUT - INLINE CODE ***************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_INLINE_SRDIO
#define _H_LW_LIB_INLINE_SRDIO
#include <lw/lib/SRDIO.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_SRDIO
#define _H_EBCL_INLINE_SRDIO
#include <ebcl/SRDIO.hh>
namespace ebcl {
/*= A_SRDWriter ==============================================================*/
@ -77,4 +77,4 @@ inline bool T_SRDMemoryTarget::complete( ) const
} // namespace
#endif // _H_LW_LIB_INLINE_SRDIO
#endif // _H_EBCL_INLINE_SRDIO

View file

@ -2,10 +2,10 @@
/* SRD - PARSER CONFIGURATION - INLINE CODE ***********************************/
/******************************************************************************/
#ifndef _H_LW_LIB_INLINE_SRDPARSERCONFIG
#define _H_LW_LIB_INLINE_SRDPARSERCONFIG
#include <lw/lib/SRDParserConfig.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_SRDPARSERCONFIG
#define _H_EBCL_INLINE_SRDPARSERCONFIG
#include <ebcl/SRDParserConfig.hh>
namespace ebcl {
/*= T_SRDTransition ==========================================================*/
@ -30,4 +30,4 @@ inline T_Optional< uint32_t > T_SRDParserConfig::enumValue(
} // namespace
#endif // _H_LW_LIB_INLINE_SRDPARSERCONFIG
#endif // _H_EBCL_INLINE_SRDPARSERCONFIG

View file

@ -2,10 +2,10 @@
/* SRD - TEXT STORAGE - INLINE CODE *******************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_INLINE_SRDTEXT
#define _H_LW_LIB_INLINE_SRDTEXT
#include <lw/lib/SRDText.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_SRDTEXT
#define _H_EBCL_INLINE_SRDTEXT
#include <ebcl/SRDText.hh>
namespace ebcl {
inline void SRDWriteAsText( A_OutputStream& output , T_SRDList const& data )
@ -22,4 +22,4 @@ inline T_SRDTextReader::T_SRDTextReader( A_SRDReaderTarget& target )
} // namespace
#endif // _H_LW_LIB_INLINE_SRDTEXT
#endif // _H_EBCL_INLINE_SRDTEXT