aboutsummaryrefslogtreecommitdiff
path: root/libbrep/common.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-04-01 23:01:02 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-04-06 15:09:41 +0300
commit65ba2b47c8d6c83e37fe772a7b54fd6b7480ce17 (patch)
treef24967df1c447e10c43206cf599007e98c24afb7 /libbrep/common.cxx
parentd1662abccb91be4844efc1508ff8b0427019a27c (diff)
Add support for test-exclude task manifest valuemigration-example
Note that the last two commits demonstrate an approach to use for migrating data on the ODB object member type change.
Diffstat (limited to 'libbrep/common.cxx')
-rw-r--r--libbrep/common.cxx28
1 files changed, 28 insertions, 0 deletions
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 + "'");
+ }
}