10#if !defined (HPP_ALIB_COMPATIBILITY_STD_STRINGS_IOSTREAM)
15#if !defined (_GLIBCXX_ALGORITHM) && !defined(_ALGORITHM_)
31 while( startIdx <
string.Length() )
34 conv.
Reset(
string.Substring<false>(startIdx, length) );
51template<
typename TChar>
53 TAString<TChar>& target,
54 const compatibility::std::TISReadLine<TChar>& reader )
58 compatibility::std::TISReadLine<TChar>& param=
const_cast<compatibility::std::TISReadLine<TChar>&
>( reader );
60 if ( param.TargetData == lang::CurrentData::Clear )
65 while( !param.IStream->eof() )
69 alib::integer actReadSize= (std::min)( param.BufferSize, param.MaxLineWidth - ( target.Length() - origLength) + 1 );
70 if ( actReadSize < 2 )
73 target.EnsureRemainingCapacity( actReadSize );
77 int64_t start= target.Length();
78 param.IStream->getline( target.VBuffer() + start, actReadSize );
79 std::streamsize gCount= param.IStream->gcount();
80 std::streamsize count=
static_cast<std::streamsize
>( characters::CharArray<TChar>::Length( target.Buffer() + start ) );
82 bool lineComplete= count + 1 == gCount;
88 if( *(target.Buffer() + start) ==
'\r' )
90 target.template Delete<false>(
static_cast<alib::integer>(start), 1 );
96 if( *(target.Buffer() + start -1 ) ==
'\r' )
102 if ( param.IStream->eof() )
116 if ( gCount == actReadSize -1)
118 if ( param.IStream->eof() )
124 ALIB_ASSERT( param.IStream->rdstate() == std::iostream::failbit )
125 param.IStream->clear();
130 if ( param.IStream->eof() )
133 if ( param.IStream->rdstate() == std::iostream::failbit )
135 ALIB_ERROR(
"STRINGS",
"Unknown Error Reading File. Maybe method implemented incomplete?" )
145 ALIB_ERROR( "STRINGS", "Unknown Error Reading File. Probably not a text file." )
154template
void alib::strings::T_Append<
alib::strings::compatibility::std::TISReadLine<
char >,
char >::operator()( TAString<
char >& target, const compatibility::std::TISReadLine<
char >& reader );
155template
void alib::strings::T_Append<
alib::strings::compatibility::std::TISReadLine<
wchar_t>,
wchar_t>::operator()( TAString<
wchar_t>& target, const compatibility::std::TISReadLine<
wchar_t>& reader );
void DbgDisableBufferReplacementWarning()
constexpr integer Length() const
constexpr const TChar * Buffer() const
#define ALIB_WARNINGS_RESTORE
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
#define ALIB_ASSERT(cond)
std::ostream & operator<<(std::ostream &stream, const alib::NString &string)
lang::integer integer
Type alias in namespace alib.