From 0c82da9160125311deb604c7dd27867274d2414a Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Thu, 29 Jul 2021 17:43:41 +0200 Subject: [PATCH] Refactored command to decorators --- src/uml/{command_parser.cc => decorators.cc} | 26 ++++---- src/uml/{command_parser.h => decorators.h} | 34 +++++----- tests/CMakeLists.txt | 14 ++-- ...and_parser.cc => test_decorator_parser.cc} | 64 +++++++++---------- 4 files changed, 69 insertions(+), 69 deletions(-) rename src/uml/{command_parser.cc => decorators.cc} (83%) rename src/uml/{command_parser.h => decorators.h} (57%) rename tests/{test_command_parser.cc => test_decorator_parser.cc} (53%) diff --git a/src/uml/command_parser.cc b/src/uml/decorators.cc similarity index 83% rename from src/uml/command_parser.cc rename to src/uml/decorators.cc index 90e71b3f..c5495c6d 100644 --- a/src/uml/command_parser.cc +++ b/src/uml/decorators.cc @@ -1,5 +1,5 @@ /** - * src/uml/command_parser.cc + * src/uml/decorators.cc * * Copyright (c) 2021 Bartek Kryza * @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "command_parser.h" +#include "decorators.h" #include "util/util.h" @@ -23,7 +23,7 @@ #include namespace clanguml { -namespace command_parser { +namespace decorators { const std::string note::label = "note"; const std::string skip::label = "skip"; @@ -31,7 +31,7 @@ const std::string skip_relationship::label = "skiprelationship"; const std::string style::label = "style"; const std::string aggregation::label = "aggregation"; -std::shared_ptr command::from_string(std::string_view c) +std::shared_ptr decorator::from_string(std::string_view c) { if (c.find(note::label) == 0) { return note::from_string(c); @@ -52,7 +52,7 @@ std::shared_ptr command::from_string(std::string_view c) return {}; } -std::shared_ptr note::from_string(std::string_view c) +std::shared_ptr note::from_string(std::string_view c) { auto res = std::make_shared(); auto it = c.begin(); @@ -77,19 +77,19 @@ std::shared_ptr note::from_string(std::string_view c) return res; } -std::shared_ptr skip::from_string(std::string_view c) +std::shared_ptr skip::from_string(std::string_view c) { auto res = std::make_shared(); return res; } -std::shared_ptr skip_relationship::from_string(std::string_view c) +std::shared_ptr skip_relationship::from_string(std::string_view c) { auto res = std::make_shared(); return res; } -std::shared_ptr style::from_string(std::string_view c) +std::shared_ptr style::from_string(std::string_view c) { auto res = std::make_shared