From a62335960e52ea7a0093afae865cf6c2777f638a Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Wed, 25 Oct 2023 20:54:39 -0400 Subject: [PATCH] Rename string gen to `IOStreams::String`. --- IOStreams/OStreamable.test/0.cc | 8 ++++---- IOStreams/{Stream.h => String.h} | 14 +++++++------- ProgramOptions.h | 2 +- Testing/TableTest.h | 2 +- tuplize_args.h | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) rename IOStreams/{Stream.h => String.h} (83%) diff --git a/IOStreams/OStreamable.test/0.cc b/IOStreams/OStreamable.test/0.cc index bb962e2..103b723 100644 --- a/IOStreams/OStreamable.test/0.cc +++ b/IOStreams/OStreamable.test/0.cc @@ -10,7 +10,7 @@ static_assert( __cplusplus > 2020'00 ); #include #include -#include +#include namespace { @@ -59,7 +59,7 @@ static auto init= Alepha::Utility::enroll <=[] { using namespace Alepha::Testing::exports; 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 > ::Cases @@ -80,9 +80,9 @@ static auto init= Alepha::Utility::enroll <=[] < []( const Agg agg, const std::string delim ) { - using Alepha::IOStreams::Stream; + using Alepha::IOStreams::String; using Alepha::IOStreams::setFieldDelimiter; - return Stream{} << setFieldDelimiter( delim ) << agg << FinishString; + return String{} << setFieldDelimiter( delim ) << agg << FinishString; } > ::Cases diff --git a/IOStreams/Stream.h b/IOStreams/String.h similarity index 83% rename from IOStreams/Stream.h rename to IOStreams/String.h index d5f0026..7bf8a96 100644 --- a/IOStreams/Stream.h +++ b/IOStreams/String.h @@ -8,18 +8,18 @@ static_assert( __cplusplus > 2020'00 ); #include -namespace Alepha::Hydrogen::IOStreams ::detail:: stream +namespace Alepha::Hydrogen::IOStreams ::detail:: string { inline namespace exports { - class Stream; + class String; enum { FinishString }; std::string stringify( const Alepha::OStreamable auto &item, Alepha::OStreamable auto && ... params ); } - class exports::Stream + class exports::String { private: // TODO: We need the exception throwing capabilities of the @@ -29,7 +29,7 @@ namespace Alepha::Hydrogen::IOStreams ::detail:: stream std::ostringstream oss; public: - Stream && + String && operator << ( const Alepha::OStreamable auto &t ) && { oss << t; @@ -51,11 +51,11 @@ namespace Alepha::Hydrogen::IOStreams ::detail:: stream inline std::string 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; } diff --git a/ProgramOptions.h b/ProgramOptions.h index de678f7..0c35e5a 100644 --- a/ProgramOptions.h +++ b/ProgramOptions.h @@ -92,7 +92,7 @@ static_assert( __cplusplus > 2020'00 ); #include #include -#include +#include #include diff --git a/Testing/TableTest.h b/Testing/TableTest.h index 890418d..ebf9b0f 100644 --- a/Testing/TableTest.h +++ b/Testing/TableTest.h @@ -29,7 +29,7 @@ static_assert( __cplusplus > 2020'00 ); #include #include -#include +#include #include diff --git a/tuplize_args.h b/tuplize_args.h index 0cb729c..fa24001 100644 --- a/tuplize_args.h +++ b/tuplize_args.h @@ -16,7 +16,7 @@ static_assert( __cplusplus > 2020'00 ); #include -#include +#include #include "meta.h" #include "error.h" @@ -50,7 +50,7 @@ namespace Alepha::Hydrogen ::detail:: tuplize_args explicit ArityMismatchError( const std::size_t remaining, const std::size_t processed, const std::string &clarification= "" ) : remaining_( remaining ), processed_( processed ), clarification( clarification ), - message( IOStreams::Stream{} << ( clarification.empty() ? "" : ( clarification + ": " ) ) + message( IOStreams::String{} << ( clarification.empty() ? "" : ( clarification + ": " ) ) << "Argument count mismatch. " << remaining << " remaining " << processed << " processed" ) {}