libtld/tld_compiler.cpp
std::string tld_definition::get_inverted_name() const
{
    std::string name;

    for(auto it(f_tld.rbegin()); it != f_tld.rend(); ++it)
    {
        std::string const s(f_strings.get_string(*it));
        if(s.empty())
        {
            throw std::logic_error("a segment string is not defined");
        }
        name += '!';
        name += s;
    }

    return name;
}
/** \brief Get the full TLD as a reversed domain name.
 *
 * This function re-assembles the domain segments in a full name in reverse
 * order. This is used to properly sort sub-domain names (still part of the
 * TLD) by their parent domain name.
 *
 * We use '!' as the separate instead of the '.' because some domain names
 * have a dash in their as the order still needs to be correct and '.' > '-'
 * when we need the opposite, but '!' < '-'.
 *
 * \return The concatenated domain name in reverse order with '!' as separators.
 */
\brief Get the full TLD as a reversed domain name.
This function re-assembles the domain segments in a full name in reverse
order. This is used to properly sort sub-domain names (still part of the
TLD) by their parent domain name.



\return The concatenated domain name in reverse order with '!' as separators.
\ brief Get the full TLD as a reversed domain name . This function re - assembles the domain segments in a full name in reverse order . This is used to properly sort sub - domain names ( still part of the TLD ) by their parent domain name . \ return The concatenated domain name in reverse order with ' ! ' as separators .
std::string tld_definition::get_inverted_name() const
{
    std::string name;
    for(auto it(f_tld.rbegin()); it != f_tld.rend(); ++it)
    {
        std::string const s(f_strings.get_string(*it));
        if(s.empty())
        {
            throw std::logic_error("a segment string is not defined");
        }
        name += '!';
        name += s;
    }
    return name;
}
std :: string tld_definition :: get_inverted_name ( ) const { std :: string name ; for ( auto it ( f_tld . rbegin ( ) ) ; it != f_tld . rend ( ) ; ++ it ) { std :: string const s ( f_strings . get_string ( * it ) ) ; if ( s . empty ( ) ) { throw std :: logic_error ( " " ) ; } name += ' ' ; name += s ; } return name ; }
\brief Get the full TLD as a reversed domain name.
\ brief Get the full TLD as a reversed domain name .