aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Richard Brown <rbrown@exherbo.org> 2007-01-05 21:03:47 +0000
committerAvatar Richard Brown <rbrown@exherbo.org> 2007-01-05 21:03:47 +0000
commitfa38e2a5f5219907848a67bbf24782c1f6eae7af (patch)
tree424fe116e1e8b4826234587606f7dc50af69ef10
parent2ec46abce1fef8ff8970c6599c5a7bc921d0d777 (diff)
downloadpaludis-fa38e2a5f5219907848a67bbf24782c1f6eae7af.tar.gz
paludis-fa38e2a5f5219907848a67bbf24782c1f6eae7af.tar.xz
Stringify DepList enums.
-rw-r--r--paludis/dep_list/dep_list.cc257
-rw-r--r--paludis/dep_list/dep_list.hh72
2 files changed, 329 insertions, 0 deletions
diff --git a/paludis/dep_list/dep_list.cc b/paludis/dep_list/dep_list.cc
index 8f06d09..8945fdc 100644
--- a/paludis/dep_list/dep_list.cc
+++ b/paludis/dep_list/dep_list.cc
@@ -1072,3 +1072,260 @@ DepList::is_top_level_target(const PackageDatabaseEntry & e) const
return t(e);
}
+std::ostream &
+paludis::operator<< (std::ostream & o, const DepListTargetType & s)
+{
+ do
+ {
+ switch (s)
+ {
+ case dl_target_package:
+ o << "target_package";
+ continue;
+
+ case dl_target_set:
+ o << "target_set";
+ continue;
+
+ case last_dl_target:
+ ;
+ }
+
+ throw InternalError(PALUDIS_HERE, "Bad DepListTargetType");
+ } while (false);
+
+ return o;
+}
+
+std::ostream &
+paludis::operator<< (std::ostream & o, const DepListReinstallOption & s)
+{
+ do
+ {
+ switch (s)
+ {
+ case dl_reinstall_never:
+ o << "reinstall_never";
+ continue;
+
+ case dl_reinstall_always:
+ o << "reinstall_always";
+ continue;
+
+ case dl_reinstall_if_use_changed:
+ o << "reinstall_if_use_changed";
+ continue;
+
+ case last_dl_reinstall:
+ ;
+ }
+
+ throw InternalError(PALUDIS_HERE, "Bad DepListReinstallOption");
+ } while (false);
+
+ return o;
+}
+
+std::ostream &
+paludis::operator<< (std::ostream & o, const DepListFallBackOption & s)
+{
+ do
+ {
+ switch (s)
+ {
+ case dl_fall_back_as_needed_except_targets:
+ o << "fall_back_as_needed_except_targets";
+ continue;
+
+ case dl_fall_back_as_needed:
+ o << "fall_back_as_needed";
+ continue;
+
+ case dl_fall_back_never:
+ o << "fall_back_never";
+ continue;
+
+ case last_dl_fall_back:
+ ;
+ }
+
+ throw InternalError(PALUDIS_HERE, "Bad DepListFallBackOption");
+ } while (false);
+
+ return o;
+}
+
+std::ostream &
+paludis::operator<< (std::ostream & o, const DepListReinstallScmOption & s)
+{
+ do
+ {
+ switch (s)
+ {
+ case dl_reinstall_scm_never:
+ o << "reinstall_scm_never";
+ continue;
+
+ case dl_reinstall_scm_always:
+ o << "reinstall_scm_always";
+ continue;
+
+ case dl_reinstall_scm_daily:
+ o << "reinstall_scm_daily";
+ continue;
+
+ case dl_reinstall_scm_weekly:
+ o << "reinstall_scm_weekly";
+ continue;
+
+ case last_dl_reinstall_scm:
+ ;
+ }
+
+ throw InternalError(PALUDIS_HERE, "Bad DepListReinstallScmOption");
+ } while (false);
+
+ return o;
+}
+
+std::ostream &
+paludis::operator<< (std::ostream & o, const DepListUpgradeOption & s)
+{
+ do
+ {
+ switch (s)
+ {
+ case dl_upgrade_always:
+ o << "upgrade_always";
+ continue;
+
+ case dl_upgrade_as_needed:
+ o << "upgrade_as_needed";
+ continue;
+
+ case last_dl_upgrade:
+ ;
+ }
+
+ throw InternalError(PALUDIS_HERE, "Bad DepListUpgradeOption");
+ } while (false);
+
+ return o;
+}
+
+std::ostream &
+paludis::operator<< (std::ostream & o, const DepListNewSlotsOption & s)
+{
+ do
+ {
+ switch (s)
+ {
+ case dl_new_slots_always:
+ o << "new_slots_always";
+ continue;
+
+ case dl_new_slots_as_needed:
+ o << "new_slots_as_needed";
+ continue;
+
+ case last_dl_new_slots:
+ ;
+ }
+
+ throw InternalError(PALUDIS_HERE, "Bad DepListNewSlotsOption");
+ } while (false);
+
+ return o;
+}
+
+std::ostream &
+paludis::operator<< (std::ostream & o, const DepListDepsOption & s)
+{
+ do
+ {
+ switch (s)
+ {
+ case dl_deps_discard:
+ o << "deps_discard";
+ continue;
+
+ case dl_deps_pre:
+ o << "deps_pre";
+ continue;
+
+ case dl_deps_pre_or_post:
+ o << "deps_pre_or_post";
+ continue;
+
+ case dl_deps_post:
+ o << "deps_post";
+ continue;
+
+ case dl_deps_try_post:
+ o << "deps_try_post";
+ continue;
+
+ case last_dl_deps:
+ ;
+ }
+
+ throw InternalError(PALUDIS_HERE, "Bad DepListDepsOption");
+ } while (false);
+
+ return o;
+}
+
+std::ostream &
+paludis::operator<< (std::ostream & o, const DepListCircularOption & s)
+{
+ do
+ {
+ switch (s)
+ {
+ case dl_circular_error:
+ o << "circular_error";
+ continue;
+
+ case dl_circular_discard:
+ o << "circular_discard";
+ continue;
+
+ case last_dl_circular:
+ ;
+ }
+
+ throw InternalError(PALUDIS_HERE, "Bad DepListCircularOption");
+ } while (false);
+
+ return o;
+}
+
+std::ostream &
+paludis::operator<< (std::ostream & o, const DepListEntryState & s)
+{
+ do
+ {
+ switch (s)
+ {
+ case dle_no_deps:
+ o << "no_deps";
+ continue;
+
+ case dle_has_pre_deps:
+ o << "has_pre_deps";
+ continue;
+
+ case dle_has_all_deps:
+ o << "has_all_deps";
+ continue;
+
+ case last_dle:
+ ;
+ }
+
+ throw InternalError(PALUDIS_HERE, "Bad DepListEntryState");
+ } while (false);
+
+ return o;
+}
+
diff --git a/paludis/dep_list/dep_list.hh b/paludis/dep_list/dep_list.hh
index c1174f4..50d7c72 100644
--- a/paludis/dep_list/dep_list.hh
+++ b/paludis/dep_list/dep_list.hh
@@ -347,6 +347,78 @@ namespace paludis
///\}
};
+
+ /**
+ * Write a DepListTargetType to a stream.
+ *
+ * \ingroup grpdepresolver
+ */
+ std::ostream &
+ operator<< (std::ostream &, const DepListTargetType &) PALUDIS_VISIBLE;
+
+ /**
+ * Write a DepListReinstallOption to a stream.
+ *
+ * \ingroup grpdepresolver
+ */
+ std::ostream &
+ operator<< (std::ostream &, const DepListReinstallOption &) PALUDIS_VISIBLE;
+
+ /**
+ * Write a DepListFallBackOption to a stream.
+ *
+ * \ingroup grpdepresolver
+ */
+ std::ostream &
+ operator<< (std::ostream &, const DepListFallBackOption &) PALUDIS_VISIBLE;
+
+ /**
+ * Write a DepListReinstallScmOption to a stream.
+ *
+ * \ingroup grpdepresolver
+ */
+ std::ostream &
+ operator<< (std::ostream &, const DepListReinstallScmOption &) PALUDIS_VISIBLE;
+
+ /**
+ * Write a DepListUpgradeOption to a stream.
+ *
+ * \ingroup grpdepresolver
+ */
+ std::ostream &
+ operator<< (std::ostream &, const DepListUpgradeOption &) PALUDIS_VISIBLE;
+
+ /**
+ * Write a DepListNewSlotsOption to a stream.
+ *
+ * \ingroup grpdepresolver
+ */
+ std::ostream &
+ operator<< (std::ostream &, const DepListNewSlotsOption &) PALUDIS_VISIBLE;
+
+ /**
+ * Write a DepListDepsOption to a stream.
+ *
+ * \ingroup grpdepresolver
+ */
+ std::ostream &
+ operator<< (std::ostream &, const DepListDepsOption &) PALUDIS_VISIBLE;
+
+ /**
+ * Write a DepListCircularOption to a stream.
+ *
+ * \ingroup grpdepresolver
+ */
+ std::ostream &
+ operator<< (std::ostream &, const DepListCircularOption &) PALUDIS_VISIBLE;
+
+ /**
+ * Write a DepListEntryState to a stream.
+ *
+ * \ingroup grpdepresolver
+ */
+ std::ostream &
+ operator<< (std::ostream &, const DepListEntryState &) PALUDIS_VISIBLE;
}
#endif