17 #ifndef COM_BORA_SOFTWARE__BALAU_UTIL__STREAMS 18 #define COM_BORA_SOFTWARE__BALAU_UTIL__STREAMS 30 template <
typename AllocatorT>
32 std::istreambuf_iterator<char> eof;
39 inline std::string
toString(std::istream & inputStream) {
40 std::istreambuf_iterator<char> eof;
41 return std::string(std::istreambuf_iterator<char>(inputStream), eof);
47 template <
typename AllocatorT>
49 std::istreambuf_iterator<char32_t> eof;
56 inline std::u32string
toString32(std::u32istream & inputStream) {
57 std::istreambuf_iterator<char32_t> eof;
58 return std::u32string(std::istreambuf_iterator<char32_t>(inputStream), eof);
71 std::vector<std::string> lines;
74 while (std::getline(inputStream, s)) {
85 public:
static void consume(std::ostream & dst, std::istream & src) {
98 #endif // COM_BORA_SOFTWARE__BALAU_UTIL__STREAMS
static std::vector< std::string > readLinesToVector(std::istream &inputStream)
Read all lines of text from the supplied input stream into a vector.
Definition: Streams.hpp:70
static void consume(std::ostream &dst, std::istream &src)
Consume all the data from the supplied input stream into the supplied output stream.
Definition: Streams.hpp:85
Utilities for streams.
Definition: Streams.hpp:66
Core includes, typedefs and functions.
std::basic_string< char32_t, std::char_traits< char32_t >, AllocatorT > U32String
UTF-32 string type with selectable allocator.
Definition: ToStringA.hpp:53
std::basic_string< char, std::char_traits< char >, AllocatorT > U8String
UTF-8 string type with selectable allocator.
Definition: ToStringA.hpp:41
Balau::U32String< AllocatorT > toString32(std::u32istream &inputStream)
Read all the text into a UTF-32 string from the supplied UTF-32 input stream.
Definition: Streams.hpp:48
Balau::U8String< AllocatorT > toString(std::istream &inputStream)
Read all the text into a UTF-8 string from the supplied UTF-8 input stream.
Definition: Streams.hpp:31