Are there any good examples of using C ++ I / O

I am actively involved in working with I / O in C ++ (currently using it for print headers, tables, some data alignments) and wonder about this proper / big use in open source projects or common examples / nippets

I use things like this:

cout.setf(ios::right,ios::jyustified);
cout<<std::setw()

std::copy (vector.begin(), vector.end(), std::osteam_iterator<const Foo *>
              std::cout,"\n");  //provided I have  operator <<  in/for Foo

locale mylocale(""); 
cout.imbue( mylocale );

I do not like my current implementation, since I have a lot of coercion (\t)and spacesto ensure the right indentation. Therefore, I want to see how I / O is used by top-level professionals.

+3
source share
3 answers

, , - Boost IO state saver library. ( ) "" .

, , - .., , . HTML, , . RAII , , .

+1

, , - (, html pdf), . - ++ <stdio>.

+1

Regarding the indentation of your question: the concept of "filter" (as implemented, for example, in the Boost.IOStreams library) is quite useful and powerful in this regard. For example, see Answer.

+1
source

Source: https://habr.com/ru/post/1721178/


All Articles