diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-05-20 01:23:18 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-05-20 01:23:18 +0100 |
commit | 150e6606b6d8e28a5de1d3344df183cce1545986 (patch) | |
tree | d3b0d0347702fb5232f239ea20be38b05119179c | |
parent | Split test presenter into its own class, not rolled into the script host (diff) | |
download | project2-150e6606b6d8e28a5de1d3344df183cce1545986.tar.bz2 project2-150e6606b6d8e28a5de1d3344df183cce1545986.tar.xz project2-150e6606b6d8e28a5de1d3344df183cce1545986.zip |
Extend TestPresenter to be a full Presenter implementation
-rw-r--r-- | project2/ut/testPresenter.cpp | 20 | ||||
-rw-r--r-- | project2/ut/testPresenter.h | 5 |
2 files changed, 23 insertions, 2 deletions
diff --git a/project2/ut/testPresenter.cpp b/project2/ut/testPresenter.cpp index e93d7aa..2b9c952 100644 --- a/project2/ut/testPresenter.cpp +++ b/project2/ut/testPresenter.cpp @@ -6,7 +6,7 @@ #include <boost/format.hpp> TestPresenter::TestPresenter() : - MultiRowSetPresenter(Default) + Presenter(Default) { } @@ -59,6 +59,24 @@ TestPresenter::finishArray(bool objects) const } void +TestPresenter::pushSub(const Glib::ustring & name, const Glib::ustring & ns) const +{ + presenterData.push_back(stringbf("%s: %s:%s", __FUNCTION__, ns, name)); +} + +void +TestPresenter::popSub() const +{ + presenterData.push_back(stringbf("%s", __FUNCTION__)); +} + +void +TestPresenter::addText(const VariableType & value) const +{ + presenterData.push_back(stringbf("%s: %s", __FUNCTION__, value)); +} + +void TestPresenter::init(ExecContext *) { presenterData.push_back(stringbf("%s", __FUNCTION__)); diff --git a/project2/ut/testPresenter.h b/project2/ut/testPresenter.h index a6772ea..74e5e0d 100644 --- a/project2/ut/testPresenter.h +++ b/project2/ut/testPresenter.h @@ -8,7 +8,7 @@ typedef std::vector<std::string> PresenterData; -class TestPresenter : public MultiRowSetPresenter { +class TestPresenter : public Presenter { public: TestPresenter(); @@ -20,6 +20,9 @@ class TestPresenter : public MultiRowSetPresenter { void finishRowSet() const override; void addNewArray(const Glib::ustring & name, bool objects) const override; void finishArray(bool objects) const override; + void pushSub(const Glib::ustring & name, const Glib::ustring & ns) const override; + void popSub() const override; + void addText(const VariableType & value) const override; void init(ExecContext *) override; const PresenterData & GetPresenterData() const; |