forked from Alepha/Alepha
Rename string gen to IOStreams::String.
This commit is contained in:
@ -10,7 +10,7 @@ static_assert( __cplusplus > 2020'00 );
|
|||||||
#include <Alepha/auto_comparable.h>
|
#include <Alepha/auto_comparable.h>
|
||||||
|
|
||||||
#include <Alepha/IOStreams/delimiters.h>
|
#include <Alepha/IOStreams/delimiters.h>
|
||||||
#include <Alepha/IOStreams/Stream.h>
|
#include <Alepha/IOStreams/String.h>
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@ -59,7 +59,7 @@ static auto init= Alepha::Utility::enroll <=[]
|
|||||||
{
|
{
|
||||||
using namespace Alepha::Testing::exports;
|
using namespace Alepha::Testing::exports;
|
||||||
using namespace Alepha::Testing::literals::test_literals;
|
using namespace Alepha::Testing::literals::test_literals;
|
||||||
using namespace Alepha::IOStreams::exports::stream;
|
using namespace Alepha::IOStreams::exports::string;
|
||||||
|
|
||||||
"Simple OStream (default delimiter)"_test <=TableTest< stringify_default >
|
"Simple OStream (default delimiter)"_test <=TableTest< stringify_default >
|
||||||
::Cases
|
::Cases
|
||||||
@ -80,9 +80,9 @@ static auto init= Alepha::Utility::enroll <=[]
|
|||||||
<
|
<
|
||||||
[]( const Agg agg, const std::string delim )
|
[]( const Agg agg, const std::string delim )
|
||||||
{
|
{
|
||||||
using Alepha::IOStreams::Stream;
|
using Alepha::IOStreams::String;
|
||||||
using Alepha::IOStreams::setFieldDelimiter;
|
using Alepha::IOStreams::setFieldDelimiter;
|
||||||
return Stream{} << setFieldDelimiter( delim ) << agg << FinishString;
|
return String{} << setFieldDelimiter( delim ) << agg << FinishString;
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
::Cases
|
::Cases
|
||||||
|
|||||||
@ -8,18 +8,18 @@ static_assert( __cplusplus > 2020'00 );
|
|||||||
|
|
||||||
#include <Alepha/Concepts.h>
|
#include <Alepha/Concepts.h>
|
||||||
|
|
||||||
namespace Alepha::Hydrogen::IOStreams ::detail:: stream
|
namespace Alepha::Hydrogen::IOStreams ::detail:: string
|
||||||
{
|
{
|
||||||
inline namespace exports
|
inline namespace exports
|
||||||
{
|
{
|
||||||
class Stream;
|
class String;
|
||||||
|
|
||||||
enum { FinishString };
|
enum { FinishString };
|
||||||
|
|
||||||
std::string stringify( const Alepha::OStreamable auto &item, Alepha::OStreamable auto && ... params );
|
std::string stringify( const Alepha::OStreamable auto &item, Alepha::OStreamable auto && ... params );
|
||||||
}
|
}
|
||||||
|
|
||||||
class exports::Stream
|
class exports::String
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
// TODO: We need the exception throwing capabilities of the
|
// TODO: We need the exception throwing capabilities of the
|
||||||
@ -29,7 +29,7 @@ namespace Alepha::Hydrogen::IOStreams ::detail:: stream
|
|||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Stream &&
|
String &&
|
||||||
operator << ( const Alepha::OStreamable auto &t ) &&
|
operator << ( const Alepha::OStreamable auto &t ) &&
|
||||||
{
|
{
|
||||||
oss << t;
|
oss << t;
|
||||||
@ -51,11 +51,11 @@ namespace Alepha::Hydrogen::IOStreams ::detail:: stream
|
|||||||
inline std::string
|
inline std::string
|
||||||
exports::stringify( const Alepha::OStreamable auto &item, Alepha::OStreamable auto && ... params )
|
exports::stringify( const Alepha::OStreamable auto &item, Alepha::OStreamable auto && ... params )
|
||||||
{
|
{
|
||||||
return ( Stream{} << ... << params ) << item << FinishString;
|
return ( String{} << ... << params ) << item << FinishString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Alepha::Hydrogen::IOStreams::inline exports::inline stream
|
namespace Alepha::Hydrogen::IOStreams::inline exports::inline string
|
||||||
{
|
{
|
||||||
using namespace detail::stream::exports;
|
using namespace detail::string::exports;
|
||||||
}
|
}
|
||||||
@ -92,7 +92,7 @@ static_assert( __cplusplus > 2020'00 );
|
|||||||
#include <Alepha/Concepts.h>
|
#include <Alepha/Concepts.h>
|
||||||
#include <Alepha/string_algorithms.h>
|
#include <Alepha/string_algorithms.h>
|
||||||
|
|
||||||
#include <Alepha/IOStreams/Stream.h>
|
#include <Alepha/IOStreams/String.h>
|
||||||
|
|
||||||
#include <Alepha/Utility/evaluation_helpers.h>
|
#include <Alepha/Utility/evaluation_helpers.h>
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@ static_assert( __cplusplus > 2020'00 );
|
|||||||
#include <Alepha/function_traits.h>
|
#include <Alepha/function_traits.h>
|
||||||
#include <Alepha/template_for_each.h>
|
#include <Alepha/template_for_each.h>
|
||||||
|
|
||||||
#include <Alepha/IOStreams/Stream.h>
|
#include <Alepha/IOStreams/String.h>
|
||||||
|
|
||||||
#include <Alepha/Utility/evaluation_helpers.h>
|
#include <Alepha/Utility/evaluation_helpers.h>
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@ static_assert( __cplusplus > 2020'00 );
|
|||||||
|
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
#include <Alepha/IOStreams/Stream.h>
|
#include <Alepha/IOStreams/String.h>
|
||||||
|
|
||||||
#include "meta.h"
|
#include "meta.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
@ -50,7 +50,7 @@ namespace Alepha::Hydrogen ::detail:: tuplize_args
|
|||||||
explicit
|
explicit
|
||||||
ArityMismatchError( const std::size_t remaining, const std::size_t processed, const std::string &clarification= "" )
|
ArityMismatchError( const std::size_t remaining, const std::size_t processed, const std::string &clarification= "" )
|
||||||
: remaining_( remaining ), processed_( processed ), clarification( clarification ),
|
: remaining_( remaining ), processed_( processed ), clarification( clarification ),
|
||||||
message( IOStreams::Stream{} << ( clarification.empty() ? "" : ( clarification + ": " ) )
|
message( IOStreams::String{} << ( clarification.empty() ? "" : ( clarification + ": " ) )
|
||||||
<< "Argument count mismatch. "
|
<< "Argument count mismatch. "
|
||||||
<< remaining << " remaining "
|
<< remaining << " remaining "
|
||||||
<< processed << " processed" ) {}
|
<< processed << " processed" ) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user