Commit 4000b96e authored by Botond Baranyi's avatar Botond Baranyi
Browse files

Implemented cloning for pattern strings



Change-Id: I1c7841f235bff046fd50077565e2f8f930834e55
Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
parent caa981bd
......@@ -68,6 +68,22 @@ namespace Ttcn {
if (!p_ref) FATAL_ERROR("PatternString::ps_elem_t::ps_elem_t()");
ref = p_ref;
}
PatternString::ps_elem_t::ps_elem_t(const PatternString::ps_elem_t& p)
: kind(p.kind), str(NULL), ref(NULL), t(NULL), with_N(FALSE),
is_charstring(FALSE), is_universal_charstring(FALSE)
{
switch(kind) {
case PSE_STR:
str = new string(*p.str);
break;
case PSE_REF:
ref = p.ref->clone();
break;
case PSE_REFDSET:
FATAL_ERROR("PatternString::ps_elem_t::ps_elem_t");
}
}
PatternString::ps_elem_t::~ps_elem_t()
{
......@@ -85,7 +101,7 @@ namespace Ttcn {
PatternString::ps_elem_t* PatternString::ps_elem_t::clone() const
{
FATAL_ERROR("PatternString::ps_elem_t::clone");
return new ps_elem_t(*this);
}
void PatternString::ps_elem_t::set_fullname(const string& p_fullname)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment