diff --git a/src/Type.cc b/src/Type.cc index 7556da698b..ce39ddf838 100644 --- a/src/Type.cc +++ b/src/Type.cc @@ -947,6 +947,20 @@ TypeDecl::~TypeDecl() delete[] id; } +TypeDecl& TypeDecl::operator=(const TypeDecl& other) + { + if ( this == &other ) + return *this; + + type = other.type; + attrs = other.attrs; + + delete[] id; + id = util::copy_string(other.id); + + return *this; + } + void TypeDecl::DescribeReST(ODesc* d, bool roles_only) const { d->Add(id); diff --git a/src/Type.h b/src/Type.h index 0e34e83c48..52b0920675 100644 --- a/src/Type.h +++ b/src/Type.h @@ -583,6 +583,8 @@ public: TypeDecl(const TypeDecl& other); ~TypeDecl(); + TypeDecl& operator=(const TypeDecl& other); + const detail::AttrPtr& GetAttr(detail::AttrTag a) const { return attrs ? attrs->Find(a) : detail::Attr::nil; diff --git a/src/input/readers/ascii/Ascii.cc b/src/input/readers/ascii/Ascii.cc index a021ad28f8..635d93f70f 100644 --- a/src/input/readers/ascii/Ascii.cc +++ b/src/input/readers/ascii/Ascii.cc @@ -47,6 +47,21 @@ FieldMapping FieldMapping::subType() return FieldMapping(name, subtype, position); } +FieldMapping& FieldMapping::operator=(const FieldMapping& arg) + { + if ( this == &arg ) + return *this; + + name = arg.name; + type = arg.type; + subtype = arg.subtype; + present = arg.present; + position = arg.position; + secondary_position = arg.secondary_position; + + return *this; + } + Ascii::Ascii(ReaderFrontend* frontend) : ReaderBackend(frontend) { mtime = 0; diff --git a/src/input/readers/ascii/Ascii.h b/src/input/readers/ascii/Ascii.h index 5f3370971d..d572259e4a 100644 --- a/src/input/readers/ascii/Ascii.h +++ b/src/input/readers/ascii/Ascii.h @@ -32,6 +32,8 @@ struct FieldMapping FieldMapping(const FieldMapping& arg); FieldMapping() = default; + FieldMapping& operator=(const FieldMapping& arg); + FieldMapping subType(); };