Added diagram templates to config
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "enums.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <stdexcept>
|
||||
|
||||
namespace clanguml::common::model {
|
||||
|
||||
@@ -135,4 +136,18 @@ std::string to_string(const diagram_t t)
|
||||
}
|
||||
}
|
||||
|
||||
diagram_t from_string(const std::string &s)
|
||||
{
|
||||
if (s == "class")
|
||||
return diagram_t::kClass;
|
||||
else if (s == "sequence")
|
||||
return diagram_t::kSequence;
|
||||
else if (s == "include")
|
||||
return diagram_t::kInclude;
|
||||
else if (s == "package")
|
||||
return diagram_t::kPackage;
|
||||
else
|
||||
throw std::runtime_error{"Invalid diagram type: " + s};
|
||||
}
|
||||
|
||||
} // namespace clanguml::common::model
|
||||
|
||||
@@ -80,4 +80,6 @@ std::string to_string(message_t m);
|
||||
|
||||
std::string to_string(diagram_t r);
|
||||
|
||||
diagram_t from_string(const std::string &s);
|
||||
|
||||
} // namespace clanguml::common::model
|
||||
|
||||
Reference in New Issue
Block a user