From b4b15c7f455991db167a0777fd94295d3774665b Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 21 Jun 2015 21:08:11 -0400 Subject: [PATCH] CLI2: Added polymorphic ::attribute --- src/CLI2.cpp | 7 +++++++ src/CLI2.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/CLI2.cpp b/src/CLI2.cpp index bce03c238..d80075c90 100644 --- a/src/CLI2.cpp +++ b/src/CLI2.cpp @@ -126,6 +126,13 @@ void A2::attribute (const std::string& name, const std::string& value) _attributes[name] = value; } +//////////////////////////////////////////////////////////////////////////////// +// Accessor for attributes. +void A2::attribute (const std::string& name, const int value) +{ + _attributes[name] = format (value); +} + //////////////////////////////////////////////////////////////////////////////// // Accessor for attributes. const std::string A2::attribute (const std::string& name) const diff --git a/src/CLI2.h b/src/CLI2.h index bccca2512..70dd178b4 100644 --- a/src/CLI2.h +++ b/src/CLI2.h @@ -48,6 +48,7 @@ public: void unTagAll (); */ void attribute (const std::string&, const std::string&); + void attribute (const std::string&, const int); const std::string attribute (const std::string&) const; const std::string dump () const;