예제 #1
0
/**
 * @brief Add comparable support for qnames.
 *
 * This is required as part of the current (very sub-optimal)
 * implementation of concept processing.
 */
inline bool operator<(const qname& lhs, const qname& rhs) {
    return
        lhs.model_name() < rhs.model_name() ||
        (lhs.model_name() == rhs.model_name() &&
            (lhs.external_module_path() < rhs.external_module_path() ||
                (lhs.external_module_path() == rhs.external_module_path() &&
                    (lhs.simple_name() < rhs.simple_name()))));
}
예제 #2
0
std::string string_converter::convert(const qname& qn) {
    std::ostringstream s;
    for (const auto& m : qn.external_module_path())
        s << "<" << m << ">";

    if (!qn.model_name().empty())
        s << "<" << qn.model_name() << ">";

    for (const auto& m : qn.module_path())
        s << "<" << m << ">";

    if (!qn.simple_name().empty())
        s << "<" << qn.simple_name() << ">";

    return s.str();
}