From b3b509eabec823a84e3452f72aa2e3424e063bbe Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 15 Oct 2014 01:33:12 -0400 Subject: [PATCH] CLI - Added default constructor, so it plays nice with others. - Added ::clear method to reset all members. --- src/CLI.cpp | 14 ++++++++++++++ src/CLI.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/CLI.cpp b/src/CLI.cpp index 545f6a72e..bbda45c1d 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -43,6 +43,12 @@ static int minimumMatchLength = 3; // Alias expansion limit. Any more indicates some kind of error. static int safetyValveDefault = 10; +//////////////////////////////////////////////////////////////////////////////// +A::A () +: _name ("") +{ +} + //////////////////////////////////////////////////////////////////////////////// A::A (const std::string& name, const std::string& raw) { @@ -76,6 +82,14 @@ A& A::operator= (const A& other) return *this; } +//////////////////////////////////////////////////////////////////////////////// +void A::clear () +{ + _name = ""; + _tags.clear (); + _attributes.clear (); +} + //////////////////////////////////////////////////////////////////////////////// bool A::hasTag (const std::string& tag) const { diff --git a/src/CLI.h b/src/CLI.h index 3b09b681f..2899e00f4 100644 --- a/src/CLI.h +++ b/src/CLI.h @@ -34,10 +34,12 @@ class A { public: + A (); A (const std::string&, const std::string&); ~A (); A (const A&); A& operator= (const A&); + void clear (); bool hasTag (const std::string&) const; void tag (const std::string&); void unTag (const std::string&);