#include <paludis/paludis.hh>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <set>
#include <list>
using namespace examples;
using std::cout;
using std::endl;
using std::setw;
using std::left;
using std::boolalpha;
int main(int argc, char * argv[])
{
try
{
"example_version_operator", "EXAMPLE_VERSION_OPERATOR_OPTIONS", "EXAMPLE_VERSION_OPERATOR_CMDLINE");
std::set<VersionSpec> versions;
std::list<VersionOperator> operators;
cout << " " << left << setw(8) << "LHS" << " | " << left << setw(8) << "RHS";
for (const auto & op : operators)
cout << " | " << setw(8) << op;
cout << endl << std::string(10, '-');
for (unsigned x(0) ; x <= operators.size() ; ++x)
cout << "+" << std::string(10, '-');
cout << endl;
for (const auto & version_lhs : versions)
{
for (const auto & version_rhs : versions)
{
cout << " " << left << setw(8) << version_lhs << " | " << left << setw(8) << version_rhs;
for (const auto & op : operators)
{
cout << " | " << left << setw(8) << boolalpha << (op.as_version_spec_comparator()(version_lhs, version_rhs));
}
cout << endl;
}
}
}
{
cout << endl;
cout << "Unhandled exception:" << endl
return EXIT_FAILURE;
}
catch (const std::exception & e)
{
cout << endl;
cout << "Unhandled exception:" << endl
<<
" * " << e.
what() << endl;
return EXIT_FAILURE;
}
catch (...)
{
cout << endl;
cout << "Unhandled exception:" << endl
<< " * Unknown exception type. Ouch..." << endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
Definition exception.hh:77
std::string backtrace(const std::string &delim) const
const char * what() const noexcept override
const std::string & message() const noexcept
static CommandLine * get_instance() PALUDIS_ATTRIBUTE((warn_unused_result))
Definition version_operator.hh:49
Definition version_spec.hh:109
VersionSpecOptions user_version_spec_options() PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE
Definition about_metadata-fwd.hh:24