File tree Expand file tree Collapse file tree 4 files changed +23
-13
lines changed
src/actions/transformations Expand file tree Collapse file tree 4 files changed +23
-13
lines changed Original file line number Diff line number Diff line change 17
17
18
18
#include < string>
19
19
20
+ #include < assert.h>
21
+
20
22
#endif
21
23
22
24
@@ -35,7 +37,9 @@ class Action {
35
37
Action ()
36
38
: m_parserPayload(" " ),
37
39
m_name (" " )
38
- { }
40
+ {
41
+ assert (0 );
42
+ }
39
43
40
44
41
45
explicit Action (const std::string& action)
@@ -44,9 +48,9 @@ class Action {
44
48
{ }
45
49
46
50
47
- Action (const Action &a )
48
- : m_parserPayload(a .m_parserPayload),
49
- m_name(a .m_name)
51
+ Action (const Action &other )
52
+ : m_parserPayload(other .m_parserPayload),
53
+ m_name(other .m_name)
50
54
{ }
51
55
52
56
@@ -76,7 +80,7 @@ class Action {
76
80
}
77
81
78
82
79
- const std::string *getName () const {
83
+ const std::string *getName () const noexcept {
80
84
return &m_name;
81
85
}
82
86
Original file line number Diff line number Diff line change @@ -65,17 +65,23 @@ namespace actions {
65
65
namespace transformations {
66
66
67
67
68
- class TransformationDoesNotExist : public std ::exception {
68
+ class TransformationDoesNotExist : public std ::exception {
69
69
public:
70
+ explicit TransformationDoesNotExist (const char *name)
71
+ : m_transformation(name)
72
+ { }
73
+
70
74
explicit TransformationDoesNotExist (const std::string& name)
71
75
: m_transformation(name)
72
76
{ }
73
77
74
- virtual const char * what () const throw() {
75
- return std::string (" Transformation not found: " + m_transformation + \
76
- " . Make sure that the new transformation is registered at: " + \
77
- " transformation.cc" ).c_str ();
78
- }
78
+ virtual ~TransformationDoesNotExist () throw (){}
79
+
80
+ virtual const char * what () const throw() {
81
+ return strdup (std::string (" Transformation not found: " + m_transformation + \
82
+ " . Make sure that the new transformation is registered at: " + \
83
+ " transformation.cc" ).c_str ());
84
+ }
79
85
80
86
private:
81
87
std::string m_transformation;
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ namespace transformations {
34
34
class TrimLeft : public Trim {
35
35
public:
36
36
TrimLeft ()
37
- : Trim (" t:trimLeft" )
37
+ : Action (" t:trimLeft" )
38
38
{ }
39
39
40
40
void execute (const Transaction *t,
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ namespace transformations {
34
34
class TrimRight : public Trim {
35
35
public:
36
36
TrimRight ()
37
- : Trim (" t:trimRight" )
37
+ : Action (" t:trimRight" )
38
38
{ }
39
39
40
40
void execute (const Transaction *t,
You can’t perform that action at this time.
0 commit comments