#include #include "mail.hpp" namespace smtp::file { Mail::Mail( std::string const& path_file ) : PathFile( path_file ) { } std::list Mail::Read() const { std::ifstream mail_file{ PathFile }; if ( !mail_file.is_open() ) { //TODO new file // std::cerr << "Failed to open pcie_devices database \n"; } std::string line{}; std::list result; while ( std::getline( mail_file, line ) ) { auto parsed_data = GetMailFromLine( line ); if( parsed_data ) { result.push_back( *parsed_data ); } } return result; } std::optional Mail::GetMailFromLine( std::string const& line ) const { //TODO parsing return line; } }