13 while( startIdx <
string.
Length() ) {
15 conv.
Reset(
string.Substring<alib::NC>(startIdx, length) );
32template<
typename TChar>
36 TAString<TChar, HeapAllocator>& target,
37 const compatibility::std::TIStreamLine<TChar>& constIsLine ) {
40 compatibility::std::TIStreamLine<TChar>& isLine=
41 const_cast<compatibility::std::TIStreamLine<TChar>&
>( constIsLine );
43 if ( isLine.TargetData == lang::CurrentData::Clear )
45 integer origLength= target.Length();
48 while( !isLine.IStream->eof() ) {
51 integer actReadSize= (std::min)( isLine.BufferSize,
52 isLine.MaxLineWidth - (target.Length() - origLength) + 1 );
53 if ( actReadSize < 2 )
56 target.EnsureRemainingCapacity( actReadSize );
60 isLine.IStream->getline( target.VBuffer() + start, actReadSize );
61 std::streamsize gCount= isLine.IStream->gcount();
62 std::streamsize count=
static_cast<std::streamsize
>( characters::Length( target.Buffer() + start ) );
64 bool lineComplete= count + 1 == gCount;
69 if( *(target.Buffer() + start) ==
'\r' ) {
70 target.template Delete<NC>(
static_cast<integer>(start), 1 );
76 if( *(target.Buffer() + start -1 ) ==
'\r' )
79 target.SetLength(
static_cast<integer>(start) );
82 if ( isLine.IStream->eof() ) {
92 if ( gCount == actReadSize -1) {
93 if ( isLine.IStream->eof() )
98 ALIB_ASSERT( isLine.IStream->rdstate() == std::iostream::failbit,
"STRINGS" )
99 isLine.IStream->clear();
104 if ( isLine.IStream->eof() )
107 if ( isLine.IStream->rdstate() == std::iostream::failbit ) {
108 ALIB_ERROR(
"STRINGS",
"Unknown Error Reading File. Maybe method implemented incomplete?")
118 ALIB_ERROR(
"STRINGS",
"Unknown Error Reading File. Probably not a text file." )
126template
void alib::strings::AppendableTraits<
alib::strings::compatibility::std::TIStreamLine<
char >,
char ,
alib::lang::HeapAllocator>::operator()( TAString<
char ,
alib::lang::HeapAllocator>& target, const compatibility::std::TIStreamLine<
char >& reader );
127template
void alib::strings::AppendableTraits<
alib::strings::compatibility::std::TIStreamLine<
wchar_t>,
wchar_t,
alib::lang::HeapAllocator>::operator()( TAString<
wchar_t,
alib::lang::HeapAllocator>& target, const compatibility::std::TIStreamLine<
wchar_t>& reader );
#define ALIB_ASSERT(cond, domain)
#define ALIB_ERROR(domain,...)
void DbgDisableBufferReplacementWarning()
constexpr integer Length() const
constexpr const TChar * Buffer() const
integer Length(const TChar *cstring)
ALIB_EXPORT constexpr TEnum operator<<(TEnum lhs, typename std::underlying_type< TEnum >::type rhs) noexcept
platform_specific integer
strings::TString< nchar > NString
Type alias in namespace #"%alib".
strings::TString< wchar > WString
Type alias in namespace #"%alib".
lang::integer integer
Type alias in namespace #"%alib".
NLocalString< 4096 > NString4K
Type alias name for #"TLocalString;TLocalString<nchar,8192>".