28std::unique_ptr<GStore::StoredMessage> GStore::operator++( std::shared_ptr<MessageStore::Iterator> & iter )
30 return iter.get() ? iter->next() : std::unique_ptr<StoredMessage>() ;
35 if( address.empty() || address.at(0U) ==
'@' || address.at(address.size()-1U) ==
'@' )
36 return AddressStyle::Invalid ;
39 return AddressStyle::Invalid ;
41 std::size_t at_pos = address.rfind(
'@' ) ;
44 G_ASSERT( !mailbox.empty() ) ;
51 if( ( !mailbox_ascii && !mailbox_utf8 ) || ( !domain_ascii && !domain_utf8 ) )
52 return AddressStyle::Invalid ;
53 else if( mailbox_ascii && domain_ascii )
54 return AddressStyle::Ascii ;
55 else if( mailbox_ascii && !domain_ascii )
56 return AddressStyle::Utf8Domain ;
57 else if( !mailbox_ascii && domain_ascii )
58 return AddressStyle::Utf8Mailbox ;
60 return AddressStyle::Utf8Both ;
static AddressStyle addressStyle(std::string_view address)
Parses an address to determine whether it has ASCII or UTF-8 parts.
static bool valid(std::string_view) noexcept
Returns true if the string is valid UTF-8.
static bool isPrintable(std::string_view s) noexcept
Returns true if every character is 0x20 or above but not 0x7f.
static std::string_view tailView(std::string_view in, std::size_t pos, std::string_view default_={}) noexcept
Like tail() but returning a view into the input string.
static std::string_view headView(std::string_view in, std::size_t pos, std::string_view default_={}) noexcept
Like head() but returning a view into the input string.
static bool isPrintableAscii(std::string_view s) noexcept
Returns true if every character is between 0x20 and 0x7e inclusive.