CLI
- Added default constructor, so it plays nice with others. - Added ::clear method to reset all members.
This commit is contained in:
14
src/CLI.cpp
14
src/CLI.cpp
@@ -43,6 +43,12 @@ static int minimumMatchLength = 3;
|
|||||||
// Alias expansion limit. Any more indicates some kind of error.
|
// Alias expansion limit. Any more indicates some kind of error.
|
||||||
static int safetyValveDefault = 10;
|
static int safetyValveDefault = 10;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
A::A ()
|
||||||
|
: _name ("")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
A::A (const std::string& name, const std::string& raw)
|
A::A (const std::string& name, const std::string& raw)
|
||||||
{
|
{
|
||||||
@@ -76,6 +82,14 @@ A& A::operator= (const A& other)
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
void A::clear ()
|
||||||
|
{
|
||||||
|
_name = "";
|
||||||
|
_tags.clear ();
|
||||||
|
_attributes.clear ();
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
bool A::hasTag (const std::string& tag) const
|
bool A::hasTag (const std::string& tag) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,10 +34,12 @@
|
|||||||
class A
|
class A
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
A ();
|
||||||
A (const std::string&, const std::string&);
|
A (const std::string&, const std::string&);
|
||||||
~A ();
|
~A ();
|
||||||
A (const A&);
|
A (const A&);
|
||||||
A& operator= (const A&);
|
A& operator= (const A&);
|
||||||
|
void clear ();
|
||||||
bool hasTag (const std::string&) const;
|
bool hasTag (const std::string&) const;
|
||||||
void tag (const std::string&);
|
void tag (const std::string&);
|
||||||
void unTag (const std::string&);
|
void unTag (const std::string&);
|
||||||
|
|||||||
Reference in New Issue
Block a user