From 65ba2b47c8d6c83e37fe772a7b54fd6b7480ce17 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 1 Apr 2020 23:01:02 +0300 Subject: Add support for test-exclude task manifest value Note that the last two commits demonstrate an approach to use for migrating data on the ODB object member type change. --- libbrep/common.cxx | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'libbrep/common.cxx') diff --git a/libbrep/common.cxx b/libbrep/common.cxx index 2e9ff34..cddf44e 100644 --- a/libbrep/common.cxx +++ b/libbrep/common.cxx @@ -6,4 +6,32 @@ namespace brep { const version wildcard_version (0, "0", nullopt, nullopt, 0); + + // buildable_status + // + string + to_string (buildable_status s) + { + switch (s) + { + case buildable_status::buildable: return "buildable"; + case buildable_status::unbuildable: return "unbuildable"; + case buildable_status::external: return "external"; + case buildable_status::test: return "test"; + case buildable_status::stub: return "stub"; + } + + return string (); // Should never reach. + } + + buildable_status + to_buildable_status (const string& s) + { + if (s == "buildable") return buildable_status::buildable; + else if (s == "unbuildable") return buildable_status::unbuildable; + else if (s == "external") return buildable_status::external; + else if (s == "test") return buildable_status::test; + else if (s == "stub") return buildable_status::stub; + else throw invalid_argument ("invalid buildable status '" + s + "'"); + } } -- cgit v1.1