Merge branch 'feature/string-streams' into development

This commit is contained in:
John Wellbelove 2020-07-06 18:14:13 +01:00
commit dd7cc0766c
4 changed files with 24 additions and 12 deletions

View File

@ -60,7 +60,7 @@ namespace etl
//*************************************************************************
/// Construct from text and format spec.
//*************************************************************************
string_stream(etl::istring& text_, etl::format_spec spec_)
string_stream(etl::istring& text_, const etl::format_spec& spec_)
: text(text_)
, spec(spec_)
{
@ -69,7 +69,7 @@ namespace etl
//*************************************************************************
/// Set the format spec.
//*************************************************************************
void set_format(etl::format_spec spec_)
void set_format(const etl::format_spec& spec_)
{
spec = spec_;
}
@ -125,7 +125,7 @@ namespace etl
//*************************************************************************
/// Stream operators.
//*************************************************************************
friend string_stream& operator <<(string_stream& ss, etl::format_spec spec)
friend string_stream& operator <<(string_stream& ss, const etl::format_spec& spec)
{
ss.spec = spec;
return ss;
@ -174,6 +174,9 @@ namespace etl
etl::istring& text;
etl::format_spec spec;
string_stream(const string_stream&) ETL_DELETE;
string_stream& operator =(const string_stream&) ETL_DELETE;
};
}

View File

@ -60,7 +60,7 @@ namespace etl
//*************************************************************************
/// Construct from text and format spec.
//*************************************************************************
u16string_stream(etl::iu16string& text_, etl::u16format_spec spec_)
u16string_stream(etl::iu16string& text_, const etl::u16format_spec& spec_)
: text(text_)
, spec(spec_)
{
@ -69,7 +69,7 @@ namespace etl
//*************************************************************************
/// Set the format spec.
//*************************************************************************
void set_format(etl::u16format_spec spec_)
void set_format(const etl::u16format_spec& spec_)
{
spec = spec_;
}
@ -125,7 +125,7 @@ namespace etl
//*************************************************************************
/// Stream operators.
//*************************************************************************
friend u16string_stream& operator <<(u16string_stream& ss, etl::u16format_spec spec)
friend u16string_stream& operator <<(u16string_stream& ss, const etl::u16format_spec& spec)
{
ss.spec = spec;
return ss;
@ -174,6 +174,9 @@ namespace etl
etl::iu16string& text;
etl::u16format_spec spec;
u16string_stream(const u16string_stream&) ETL_DELETE;
u16string_stream& operator =(const u16string_stream&) ETL_DELETE;
};
}

View File

@ -60,7 +60,7 @@ namespace etl
//*************************************************************************
/// Construct from text and format spec.
//*************************************************************************
u32string_stream(etl::iu32string& text_, etl::u32format_spec spec_)
u32string_stream(etl::iu32string& text_, const etl::u32format_spec& spec_)
: text(text_)
, spec(spec_)
{
@ -69,7 +69,7 @@ namespace etl
//*************************************************************************
/// Set the format spec.
//*************************************************************************
void set_format(etl::u32format_spec spec_)
void set_format(const etl::u32format_spec& spec_)
{
spec = spec_;
}
@ -125,7 +125,7 @@ namespace etl
//*************************************************************************
/// Stream operators.
//*************************************************************************
friend u32string_stream& operator <<(u32string_stream& ss, etl::u32format_spec spec)
friend u32string_stream& operator <<(u32string_stream& ss, const etl::u32format_spec& spec)
{
ss.spec = spec;
return ss;
@ -174,6 +174,9 @@ namespace etl
etl::iu32string& text;
etl::u32format_spec spec;
u32string_stream(const u32string_stream&) ETL_DELETE;
u32string_stream& operator =(const u32string_stream&) ETL_DELETE;
};
}

View File

@ -60,7 +60,7 @@ namespace etl
//*************************************************************************
/// Construct from text and format spec.
//*************************************************************************
wstring_stream(etl::iwstring& text_, etl::wformat_spec spec_)
wstring_stream(etl::iwstring& text_, const etl::wformat_spec& spec_)
: text(text_)
, spec(spec_)
{
@ -69,7 +69,7 @@ namespace etl
//*************************************************************************
/// Set the format spec.
//*************************************************************************
void set_format(etl::wformat_spec spec_)
void set_format(const etl::wformat_spec& spec_)
{
spec = spec_;
}
@ -125,7 +125,7 @@ namespace etl
//*************************************************************************
/// Stream operators.
//*************************************************************************
friend wstring_stream& operator <<(wstring_stream& ss, etl::wformat_spec spec)
friend wstring_stream& operator <<(wstring_stream& ss, const etl::wformat_spec& spec)
{
ss.spec = spec;
return ss;
@ -174,6 +174,9 @@ namespace etl
etl::iwstring& text;
etl::wformat_spec spec;
wstring_stream(const wstring_stream&) ETL_DELETE;
wstring_stream& operator =(const wstring_stream&) ETL_DELETE;
};
}