48 std::string sep( 1U ,
'|' ) ;
52 if( part.size() != 9U )
throw std::runtime_error(
"incorrect number of parts" ) ;
55 s.is_valid = part.at(i++) ==
"1" ;
56 s.is_local = part.at(i++) ==
"1" ;
57 s.temporary = part.at(i++) ==
"1" ;
58 s.abort = part.at(i++) ==
"1" ;
59 s.full_name = part.at(i++) ;
60 s.address = part.at(i++) ;
61 s.response = part.at(i++) ;
62 s.reason = part.at(i++) ;
65 catch( std::exception & )
67 G_ERROR(
"GSmtp::VerifierStatus::parse: invalid stringised status: [" << line <<
"]" ) ;
74 std::string sep( 1U ,
'|' ) ;
75 std::string t(
"1" ) ;
76 std::string f(
"0" ) ;
79 (is_valid?t:f) + sep +
80 (is_local?t:f) + sep +
81 (temporary?t:f) + sep +
std::vector< std::string > StringArray
A std::vector of std::strings.
static VerifierStatus parse(const std::string &str, std::string &to_ref)
Parses a str() string into a structure and a recipient 'to' address (by reference).
VerifierStatus()
Default constructor for an invalid remote mailbox.
A structure returned by GSmtp::Verifier to describe the status of a 'rcpt-to' recipient.
static void splitIntoFields(const std::string &in, StringArray &out, const std::string &separators, char escape= '\0', bool remove_escapes=true)
Splits the string into fields.
std::string str(const std::string &to) const
Returns a string representation of the structure plus the original recipient 'to' address...