44 template <
typename CharType>
50 static constexpr CharType
CHAR_CR =
static_cast<CharType
>(
'\r');
51 static constexpr CharType
CHAR_LF =
static_cast<CharType
>(
'\n');
67 iContents(aPointer, aLength)
71 iContents(aOther.iContents)
77 iContents = aOther.iContents;
97 return iContents.size();
105 return iContents.max_size();
115 while (aFirst != aLast && is_delimiter(*aFirst))
118 while (aFirst != aLast && !is_delimiter(*aFirst))
123 iContents.insert(iContents.end(), start,
end);
124 while (aFirst != aLast && !is_terminating_delimiter(*aFirst))
128 return end != aLast || (start ==
end && !iContents.empty());
137 if (aSource.
length() != 0)
138 iContents.assign(aSource.
data(), aSource.
length());
151 virtual bool has_delimiters()
const
157 return has_delimiters() && (aCharacter ==
CHAR_CR || aCharacter ==
CHAR_LF);
159 virtual bool is_terminating_delimiter(
character_type aCharacter)
const
161 return has_delimiters() && aCharacter ==
CHAR_LF;
virtual size_type length() const
base_type::size_type size_type
contents_type & contents()
virtual clone_pointer clone() const
base_type::clone_pointer clone_pointer
base_type::const_pointer const_pointer
const contents_type & contents() const
virtual bool take_some(const_pointer &aFirst, const_pointer aLast)
virtual size_type max_length() const
basic_string_packet & operator=(const basic_string_packet &aOther)
std::basic_string< CharType > contents_type
static constexpr CharType CHAR_LF
static constexpr CharType CHAR_CR
base_type::character_type character_type
virtual const_pointer data() const
basic_string_packet(const basic_string_packet &aOther)
virtual void copy_from(const i_basic_packet< CharType > &aSource)
basic_string_packet(const character_type *aPointer, size_type aLength)
basic_string_packet(const contents_type &aContents=contents_type())
virtual bool has_max_length() const
base_type::pointer pointer
const_iterator end() const
const character_type * const_pointer
virtual const_pointer data() const =0
std::unique_ptr< i_basic_packet > clone_pointer
virtual size_type length() const =0
basic_string_packet< char > string_packet