summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--project2/cgi/cgiAppEngine.cpp52
-rw-r--r--project2/cgi/cgiStageDefaultError.cpp4
-rw-r--r--project2/cgi/cgiStageDefaultNotFound.cpp2
-rw-r--r--project2/cgi/cgiStageFail.cpp2
-rw-r--r--project2/cgi/cgiStageRedirect.cpp2
-rw-r--r--project2/common/appEngine.cpp12
-rw-r--r--project2/common/cache.h2
-rw-r--r--project2/common/iHaveSubTasks.cpp5
-rw-r--r--project2/common/iHaveSubTasks.h1
-rw-r--r--project2/common/if.cpp5
-rw-r--r--project2/common/if.h1
-rw-r--r--project2/common/library.cpp5
-rw-r--r--project2/common/library.h2
-rw-r--r--project2/common/presenter.cpp80
-rw-r--r--project2/common/presenter.h52
-rw-r--r--project2/common/rowProcessor.cpp10
-rw-r--r--project2/common/rowProcessor.h2
-rw-r--r--project2/common/rowView.cpp12
-rw-r--r--project2/common/sessionClearTask.cpp5
-rw-r--r--project2/common/sessionClearTask.h2
-rw-r--r--project2/common/sessionSetTask.cpp5
-rw-r--r--project2/common/sessionSetTask.h2
-rw-r--r--project2/common/sourceObject.cpp5
-rw-r--r--project2/common/sourceObject.h2
-rw-r--r--project2/common/validDateCheck.cpp5
-rw-r--r--project2/common/variables.cpp12
-rw-r--r--project2/common/viewHost.cpp16
-rw-r--r--project2/common/viewHost.h8
-rw-r--r--project2/console/consolePresenter.cpp14
-rw-r--r--project2/console/consolePresenter.h6
-rw-r--r--project2/files/fileRows.cpp5
-rw-r--r--project2/files/fileRows.h1
-rw-r--r--project2/files/fsRows.cpp5
-rw-r--r--project2/files/fsRows.h1
-rw-r--r--project2/mail/sendmailTask.cpp5
-rw-r--r--project2/mail/sendmailTask.h1
-rw-r--r--project2/processes/procRows.cpp5
-rw-r--r--project2/processes/procRows.h1
-rw-r--r--project2/regex/regexCheck.cpp5
-rw-r--r--project2/regex/regexCheck.h1
-rw-r--r--project2/regex/regexRows.cpp5
-rw-r--r--project2/regex/regexRows.h2
-rw-r--r--project2/sql/rdbmsDataSource.cpp5
-rw-r--r--project2/sql/rdbmsDataSource.h1
-rw-r--r--project2/sql/sqlCache.cpp87
-rw-r--r--project2/sql/sqlMergeTask.cpp5
-rw-r--r--project2/url/urlRows.cpp5
-rw-r--r--project2/url/urlRows.h1
-rw-r--r--project2/xml/rawView.cpp7
-rw-r--r--project2/xml/rawView.h2
-rw-r--r--project2/xml/xmlCache.cpp6
-rw-r--r--project2/xml/xmlDocumentPrefetch.cpp6
-rw-r--r--project2/xml/xmlDocumentPrefetch.h1
-rw-r--r--project2/xml/xmlPresenter.cpp2
-rw-r--r--project2/xml/xmlPresenter.h2
-rw-r--r--project2/xml/xmlRawRows.cpp4
-rw-r--r--project2/xml/xmlRawRows.h2
-rw-r--r--project2/xml/xmlRows.cpp5
-rw-r--r--project2/xml/xmlRows.h1
-rw-r--r--project2/xml/xpathRows.cpp5
-rw-r--r--project2/xml/xpathRows.h1
61 files changed, 241 insertions, 277 deletions
diff --git a/project2/cgi/cgiAppEngine.cpp b/project2/cgi/cgiAppEngine.cpp
index ceac940..37ae19c 100644
--- a/project2/cgi/cgiAppEngine.cpp
+++ b/project2/cgi/cgiAppEngine.cpp
@@ -117,35 +117,37 @@ void
CgiApplicationEngine::addEnvData(const Presenter * p) const
{
// These were for debug... but why not pass them on?
- p->addField("servername", env()->xmlPrefix, env()->getServerName());
- p->addField("scriptname", env()->xmlPrefix, env()->getScriptName());
+ p->addNamedValue("servername", env()->xmlPrefix, env()->getServerName());
+ p->addNamedValue("scriptname", env()->xmlPrefix, env()->getScriptName());
// URL elements
- p->pushSub("uriElems", env()->xmlPrefix);
+ p->addNewRowSet("uriElems", env()->xmlPrefix);
BOOST_FOREACH(std::string s, _env->elems) {
- p->addField("uriElem", env()->xmlPrefix, s);
+ p->addNewRow("uriElem");
+ p->addAttribute("text", s);
+ p->finishRow();
}
- p->popSub();
+ p->finishRow();
// Parameters
- p->pushSub("params", env()->xmlPrefix);
+ p->addNewRowSet("params", env()->xmlPrefix);
BOOST_FOREACH(cgicc::FormEntry fe, _env->cgi->getElements()) {
- p->pushSub("param", env()->xmlPrefix);
- p->addAttr("name", fe.getName());
- p->addAttr("value", fe.getValue());
- p->popSub();
+ p->addNewRow("param");
+ p->addAttribute("name", fe.getName());
+ p->addAttribute("value", fe.getValue());
+ p->finishRow();
}
- p->popSub();
+ p->finishRowSet();
}
static
void
-addToPresenter(const Environment * env, const Presenter * p, const Glib::ustring & name, const VariableType & value)
+addToPresenter(const Presenter * p, const Glib::ustring & name, const VariableType & value)
{
- p->pushSub("var", env->xmlPrefix);
- p->addAttr("value", value);
- p->addAttr("name", name);
- p->popSub();
+ p->addNewRow("var");
+ p->addAttribute("value", value);
+ p->addAttribute("name", name);
+ p->finishRow();
}
void
@@ -153,19 +155,19 @@ CgiApplicationEngine::addAppData(const Presenter * p) const
{
addCoreAppData(p);
// Sessions variables
- p->pushSub("session", env()->xmlPrefix);
- p->addAttr("id", cursession->ID.str());
- cursession->ForeachValue(boost::bind(addToPresenter, env(), p, _1, _2));
- p->popSub();
+ p->addNewRowSet("session", env()->xmlPrefix);
+ p->addAttribute("id", cursession->ID.str());
+ cursession->ForeachValue(boost::bind(addToPresenter, p, _1, _2));
+ p->finishRowSet();
// Timing info
- p->pushSub("timing", env()->xmlPrefix);
- p->addAttr("start", startTime);
+ p->addNewRowSet("timing", env()->xmlPrefix);
+ p->addAttribute("start", startTime);
if (!endTime.is_not_a_date_time()) {
- p->addAttr("end", endTime);
- p->addAttr("duration", (endTime - startTime).total_milliseconds());
+ p->addAttribute("end", endTime);
+ p->addAttribute("duration", (endTime - startTime).total_milliseconds());
}
- p->popSub();
+ p->finishRowSet();
}
SessionPtr
diff --git a/project2/cgi/cgiStageDefaultError.cpp b/project2/cgi/cgiStageDefaultError.cpp
index 5ba371f..82d7b2e 100644
--- a/project2/cgi/cgiStageDefaultError.cpp
+++ b/project2/cgi/cgiStageDefaultError.cpp
@@ -29,8 +29,8 @@ CgiApplicationEngine::DefaultErrorStage::getHeader() const
CgiApplicationEngine::NextStage
CgiApplicationEngine::DefaultErrorStage::run()
{
- pres->addField("error-type", e->xmlPrefix, buf);
- pres->addField("error-what", e->xmlPrefix, what.c_str());
+ pres->addNamedValue("error-type", e->xmlPrefix, buf);
+ pres->addNamedValue("error-what", e->xmlPrefix, what.c_str());
return NextStage(NULL, this, pres.get(), pres.get());
}
diff --git a/project2/cgi/cgiStageDefaultNotFound.cpp b/project2/cgi/cgiStageDefaultNotFound.cpp
index d67d892..38cc395 100644
--- a/project2/cgi/cgiStageDefaultNotFound.cpp
+++ b/project2/cgi/cgiStageDefaultNotFound.cpp
@@ -23,7 +23,7 @@ CgiApplicationEngine::DefaultNotFoundStage::getHeader() const
CgiApplicationEngine::NextStage
CgiApplicationEngine::DefaultNotFoundStage::run()
{
- pres->addField("missing-resource", e->xmlPrefix, nf.what());
+ pres->addNamedValue("missing-resource", e->xmlPrefix, nf.what());
return NextStage(NULL, this, pres.get(), pres.get());
}
diff --git a/project2/cgi/cgiStageFail.cpp b/project2/cgi/cgiStageFail.cpp
index 04e131b..6a60700 100644
--- a/project2/cgi/cgiStageFail.cpp
+++ b/project2/cgi/cgiStageFail.cpp
@@ -35,8 +35,6 @@ namespace CgiApplicationExtras {
View(e),
code(e, "code", false, 500),
message(e, "message", false, "Application error") {
- }
- void loadComplete(const CommonObjects *) {
}
void execute(const Presenter *) const {
throw CgiApplicationEngine::ResponseStagePtr(
diff --git a/project2/cgi/cgiStageRedirect.cpp b/project2/cgi/cgiStageRedirect.cpp
index af938c0..c2e498f 100644
--- a/project2/cgi/cgiStageRedirect.cpp
+++ b/project2/cgi/cgiStageRedirect.cpp
@@ -33,8 +33,6 @@ namespace CgiApplicationExtras {
SourceObject(e),
View(e),
url(e, "url", true) {
- }
- void loadComplete(const CommonObjects *) {
}
void execute(const Presenter *) const {
throw CgiApplicationEngine::ResponseStagePtr(
diff --git a/project2/common/appEngine.cpp b/project2/common/appEngine.cpp
index 6fa71ce..59fa1ee 100644
--- a/project2/common/appEngine.cpp
+++ b/project2/common/appEngine.cpp
@@ -34,14 +34,14 @@ void
ApplicationEngine::addCoreAppData(const Presenter * p) const
{
// Message log
- p->pushSub("messages", env()->xmlPrefix);
+ p->addNewRowSet("messages", env()->xmlPrefix);
BOOST_FOREACH(const Messages::value_type & m, appMessages) {
- p->pushSub("message");
- p->addAttr("group", m->group);
- p->addAttr("text", m->message);
- p->popSub();
+ p->addNewRow("message");
+ p->addAttribute("group", m->group);
+ p->addAttribute("text", m->message);
+ p->finishRow();
}
- p->popSub();
+ p->finishRowSet();
}
ApplicationEngine::Message::Message(const Glib::ustring & g, const Glib::ustring & m) :
diff --git a/project2/common/cache.h b/project2/common/cache.h
index e642f5f..eff24b0 100644
--- a/project2/common/cache.h
+++ b/project2/common/cache.h
@@ -15,7 +15,7 @@ class Cache : public IHaveParameters, public SourceObject {
Cache(const xmlpp::Element * p);
bool checkAndExecute(const Glib::ustring &, const Glib::ustring &, const RowProcessor *);
- virtual PresenterPtr openFor(const Glib::ustring &, const Glib::ustring &, const IHaveParameters *) = 0;
+ virtual RowSetPresenterPtr openFor(const Glib::ustring &, const Glib::ustring &, const IHaveParameters *) = 0;
virtual void save(const Glib::ustring &, const Glib::ustring &, const IHaveParameters *) = 0;
virtual void discard(const Glib::ustring &, const Glib::ustring &, const IHaveParameters *) = 0;
diff --git a/project2/common/iHaveSubTasks.cpp b/project2/common/iHaveSubTasks.cpp
index dae8640..586dff8 100644
--- a/project2/common/iHaveSubTasks.cpp
+++ b/project2/common/iHaveSubTasks.cpp
@@ -13,11 +13,6 @@ IHaveSubTasks::~IHaveSubTasks()
}
void
-IHaveSubTasks::loadComplete(const CommonObjects *)
-{
-}
-
-void
IHaveSubTasks::run(const Tasks & tlist) const
{
BOOST_FOREACH(const Tasks::value_type & t, tlist) {
diff --git a/project2/common/iHaveSubTasks.h b/project2/common/iHaveSubTasks.h
index ee6d173..c2d2022 100644
--- a/project2/common/iHaveSubTasks.h
+++ b/project2/common/iHaveSubTasks.h
@@ -12,7 +12,6 @@ class IHaveSubTasks : public NoOutputExecute {
IHaveSubTasks(const std::string & n);
virtual ~IHaveSubTasks();
- void loadComplete(const CommonObjects*);
virtual void execute() const = 0;
Tasks normal;
diff --git a/project2/common/if.cpp b/project2/common/if.cpp
index c65315e..eac55c5 100644
--- a/project2/common/if.cpp
+++ b/project2/common/if.cpp
@@ -54,11 +54,6 @@ If::If(const xmlpp::Element * e) :
}
void
-If::loadComplete(const CommonObjects*)
-{
-}
-
-void
If::execute(const Presenter * presenter) const
{
if (passes()) {
diff --git a/project2/common/if.h b/project2/common/if.h
index b33bca1..7a13fea 100644
--- a/project2/common/if.h
+++ b/project2/common/if.h
@@ -23,7 +23,6 @@ class If : public IHaveSubTasks, public View, public IfSet {
public:
If(const xmlpp::Element *);
- virtual void loadComplete(const CommonObjects*);
virtual void execute(const Presenter*) const;
virtual void execute() const;
diff --git a/project2/common/library.cpp b/project2/common/library.cpp
index 476df56..711e14f 100644
--- a/project2/common/library.cpp
+++ b/project2/common/library.cpp
@@ -23,11 +23,6 @@ Library::~Library()
}
}
-void
-Library::loadComplete(const CommonObjects*)
-{
-}
-
STORAGEOF(Library) libraries;
class LibraryLoader : public ElementLoaderImpl<Library> {
public:
diff --git a/project2/common/library.h b/project2/common/library.h
index af8e73f..523dcf4 100644
--- a/project2/common/library.h
+++ b/project2/common/library.h
@@ -7,7 +7,7 @@ class Library : public SourceObject {
public:
Library(const xmlpp::Element * p);
~Library();
- void loadComplete(const CommonObjects*);
+
private:
void * handle;
};
diff --git a/project2/common/presenter.cpp b/project2/common/presenter.cpp
index 48dd27e..b8fc545 100644
--- a/project2/common/presenter.cpp
+++ b/project2/common/presenter.cpp
@@ -4,6 +4,36 @@
#include "appEngine.h"
#include <boost/foreach.hpp>
+NameValuePairPresenter::NameValuePairPresenter()
+{
+}
+
+NameValuePairPresenter::~NameValuePairPresenter()
+{
+}
+
+void
+NameValuePairPresenter::addAttribute(const Glib::ustring & name, const VariableType & value) const
+{
+ addNamedValue(name, value);
+}
+
+RowSetPresenter::RowSetPresenter()
+{
+}
+
+RowSetPresenter::~RowSetPresenter()
+{
+}
+
+MultiRowSetPresenter::MultiRowSetPresenter()
+{
+}
+
+MultiRowSetPresenter::~MultiRowSetPresenter()
+{
+}
+
Presenter::Presenter()
{
}
@@ -19,25 +49,25 @@ Presenter::pushSub(const Glib::ustring & name) const
}
void
-Presenter::addAttr(const Glib::ustring & name, const VariableType & value) const
+Presenter::addAttribute(const Glib::ustring & name, const VariableType & value) const
{
- addAttr(name, Glib::ustring(), value);
+ addAttribute(name, Glib::ustring(), value);
}
void
-Presenter::addAttr(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const
+Presenter::addAttribute(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const
{
- addField(name, ns, value);
+ addNamedValue(name, ns, value);
}
void
-Presenter::addField(const Glib::ustring & name, const VariableType & value) const
+Presenter::addNamedValue(const Glib::ustring & name, const VariableType & value) const
{
- addField(name, Glib::ustring(), value);
+ addNamedValue(name, Glib::ustring(), value);
}
void
-Presenter::addField(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const
+Presenter::addNamedValue(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const
{
pushSub(name, ns);
addText(value);
@@ -49,3 +79,39 @@ ContentPresenter::ContentPresenter(const Glib::ustring & ct) :
{
}
+
+void
+Presenter::addNewRowSet(const Glib::ustring & name) const
+{
+ pushSub(name);
+}
+void
+Presenter::addNewRowSet(const Glib::ustring & name, const Glib::ustring & ns) const
+{
+ pushSub(name, ns);
+}
+void
+Presenter::addNewRow(const Glib::ustring & name) const
+{
+ pushSub(name);
+}
+void
+Presenter::finishRow() const
+{
+ popSub();
+}
+void
+Presenter::finishRowSet() const
+{
+ popSub();
+}
+
+void
+MultiRowSetPresenter::declareNamespace(const Glib::ustring &, const Glib::ustring &) const
+{
+}
+void
+MultiRowSetPresenter::setNamespace(const Glib::ustring &, const Glib::ustring &) const
+{
+}
+
diff --git a/project2/common/presenter.h b/project2/common/presenter.h
index a4c0a00..8ba7e6b 100644
--- a/project2/common/presenter.h
+++ b/project2/common/presenter.h
@@ -9,21 +9,57 @@
#include "paramChecker.h"
#include "xmlObjectLoader.h"
-class Presenter : public virtual IntrusivePtrBase {
+class NameValuePairPresenter : public virtual IntrusivePtrBase {
+ public:
+ NameValuePairPresenter();
+ virtual ~NameValuePairPresenter();
+
+ virtual void addNamedValue(const Glib::ustring & name, const VariableType & value) const = 0;
+ virtual void addAttribute(const Glib::ustring & name, const VariableType & value) const;
+};
+
+class RowSetPresenter : public NameValuePairPresenter {
+ public:
+ RowSetPresenter();
+ virtual ~RowSetPresenter() = 0;
+
+ virtual void addNewRow(const Glib::ustring & name) const = 0;
+ virtual void finishRow() const = 0;
+};
+
+class MultiRowSetPresenter : public RowSetPresenter {
+ public:
+ MultiRowSetPresenter();
+ virtual ~MultiRowSetPresenter() = 0;
+
+ virtual void declareNamespace(const Glib::ustring & prefix, const Glib::ustring & ns) const;
+ virtual void setNamespace(const Glib::ustring & prefix, const Glib::ustring & ns) const;
+
+ virtual void addNewRowSet(const Glib::ustring & name) const = 0;
+ virtual void addNewRowSet(const Glib::ustring & name, const Glib::ustring & ns) const = 0;
+ virtual void finishRowSet() const = 0;
+};
+
+class Presenter : public MultiRowSetPresenter {
public:
Presenter();
virtual ~Presenter() = 0;
- virtual void declareNamespace(const Glib::ustring & prefix, const Glib::ustring & ns) const = 0;
virtual void pushSub(const Glib::ustring & name) const;
virtual void pushSub(const Glib::ustring & name, const Glib::ustring & ns) const = 0;
- virtual void setNamespace(const Glib::ustring & prefix, const Glib::ustring & ns) const = 0;
- virtual void addAttr(const Glib::ustring & name, const VariableType & value) const;
- virtual void addAttr(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const;
- virtual void addField(const Glib::ustring & name, const VariableType & value) const;
- virtual void addField(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const;
+ virtual void addAttribute(const Glib::ustring & name, const VariableType & value) const;
+ virtual void addAttribute(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const;
+ virtual void addNamedValue(const Glib::ustring & name, const VariableType & value) const;
+ virtual void addNamedValue(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const;
virtual void addText(const VariableType & value) const = 0;
virtual void popSub() const = 0;
+
+ // RowPresenter implementation
+ void addNewRowSet(const Glib::ustring & name) const;
+ void addNewRowSet(const Glib::ustring & name, const Glib::ustring & ns) const;
+ void addNewRow(const Glib::ustring & name) const;
+ void finishRow() const;
+ void finishRowSet() const;
};
class ContentPresenter : public Presenter {
@@ -34,6 +70,8 @@ class ContentPresenter : public Presenter {
typedef boost::intrusive_ptr<const Presenter> PresenterCPtr;
typedef boost::intrusive_ptr<Presenter> PresenterPtr;
+typedef boost::intrusive_ptr<RowSetPresenter> RowSetPresenterPtr;
+typedef boost::intrusive_ptr<NameValuePairPresenter> NameValuePairPresenterPtr;
/// Base class to implement presenter modules
class PresenterLoader : public ComponentLoader {
diff --git a/project2/common/rowProcessor.cpp b/project2/common/rowProcessor.cpp
index 1e81dc6..b2d3cbd 100644
--- a/project2/common/rowProcessor.cpp
+++ b/project2/common/rowProcessor.cpp
@@ -36,7 +36,7 @@ RowProcessor::execute() const
if (c->checkAndExecute(source->name, filter, this)) {
return;
}
- PresenterPtr p = c->openFor(source->name, filter, this);
+ RowSetPresenterPtr p = c->openFor(source->name, filter, this);
if (p) {
tc.insert(TargetCachePtr(new TargetCache(p, c)));
}
@@ -75,10 +75,10 @@ void
RowProcessor::rowReadyInternal(const RowState * rs) const
{
BOOST_FOREACH(const TargetCaches::value_type & c, tc) {
- c->get<0>()->pushSub(filter.empty() ? "row" : filter);
- rs->foreachColumn(boost::bind(&Presenter::addField, c->get<0>(), _2, _3));
- rs->foreachAttr(boost::bind(&Presenter::addAttr, c->get<0>(), _1, _2));
- c->get<0>()->popSub();
+ c->get<0>()->addNewRow(filter.empty() ? "row" : filter);
+ rs->foreachColumn(boost::bind(&RowSetPresenter::addNamedValue, c->get<0>(), _2, _3));
+ rs->foreachAttr(boost::bind(&RowSetPresenter::addAttribute, c->get<0>(), _1, _2));
+ c->get<0>()->finishRow();
}
rowReady(rs);
}
diff --git a/project2/common/rowProcessor.h b/project2/common/rowProcessor.h
index 8a52e01..e435bf4 100644
--- a/project2/common/rowProcessor.h
+++ b/project2/common/rowProcessor.h
@@ -31,7 +31,7 @@ class RowProcessor : public IHaveParameters {
virtual void rowReady(const RowState *) const = 0;
typedef ANONORDEREDSTORAGEOF(Cache) Caches;
Caches caches;
- typedef boost::tuple<PresenterPtr, CachePtr> TargetCache;
+ typedef boost::tuple<RowSetPresenterPtr, CachePtr> TargetCache;
typedef boost::shared_ptr<TargetCache> TargetCachePtr;
typedef std::set<TargetCachePtr> TargetCaches;
mutable TargetCaches tc;
diff --git a/project2/common/rowView.cpp b/project2/common/rowView.cpp
index 7173c19..000222d 100644
--- a/project2/common/rowView.cpp
+++ b/project2/common/rowView.cpp
@@ -40,25 +40,25 @@ RowView::loadComplete(const CommonObjects * co)
void
RowView::rowReady(const RowState * rs) const
{
- presenter->pushSub(recordName());
+ presenter->addNewRow(recordName());
if (viewColumns.empty()) {
- rs->foreachColumn(boost::bind(&Presenter::addField, presenter, _2, _3));
+ rs->foreachColumn(boost::bind(&RowSetPresenter::addNamedValue, presenter, _2, _3));
}
else {
BOOST_FOREACH(const Columns::value_type & col, viewColumns) {
- presenter->addField(col.first, col.second);
+ presenter->addNamedValue(col.first, col.second);
}
}
executeChildren();
- presenter->popSub();
+ presenter->finishRow();
}
void
RowView::execute(const Presenter * p) const
{
presenter = p;
- presenter->pushSub(rootName());
- ScopeObject pres(boost::bind(&Presenter::popSub, p));
+ presenter->addNewRowSet(rootName());
+ ScopeObject pres(boost::bind(&MultiRowSetPresenter::finishRowSet, p));
RowProcessor::execute();
}
diff --git a/project2/common/sessionClearTask.cpp b/project2/common/sessionClearTask.cpp
index 0781c54..17dcf8f 100644
--- a/project2/common/sessionClearTask.cpp
+++ b/project2/common/sessionClearTask.cpp
@@ -19,11 +19,6 @@ SessionClearTask::~SessionClearTask()
}
void
-SessionClearTask::loadComplete(const CommonObjects *)
-{
-}
-
-void
SessionClearTask::execute() const
{
ApplicationEngine::getCurrent()->session()->ClearValue(key);
diff --git a/project2/common/sessionClearTask.h b/project2/common/sessionClearTask.h
index 8241f8a..5df0aa5 100644
--- a/project2/common/sessionClearTask.h
+++ b/project2/common/sessionClearTask.h
@@ -15,7 +15,7 @@ class SessionClearTask : public Task {
public:
SessionClearTask(const xmlpp::Element * p);
virtual ~SessionClearTask();
- virtual void loadComplete(const CommonObjects *);
+
void execute() const;
const Glib::ustring key;
diff --git a/project2/common/sessionSetTask.cpp b/project2/common/sessionSetTask.cpp
index 7a90bca..69e05c5 100644
--- a/project2/common/sessionSetTask.cpp
+++ b/project2/common/sessionSetTask.cpp
@@ -20,11 +20,6 @@ SessionSetTask::~SessionSetTask()
}
void
-SessionSetTask::loadComplete(const CommonObjects *)
-{
-}
-
-void
SessionSetTask::execute() const
{
ApplicationEngine::getCurrent()->session()->SetValue(key, value);
diff --git a/project2/common/sessionSetTask.h b/project2/common/sessionSetTask.h
index f439768..1fddbba 100644
--- a/project2/common/sessionSetTask.h
+++ b/project2/common/sessionSetTask.h
@@ -16,7 +16,7 @@ class SessionSetTask : public Task {
public:
SessionSetTask(const xmlpp::Element * p);
virtual ~SessionSetTask();
- virtual void loadComplete(const CommonObjects *);
+
void execute() const;
const Glib::ustring key;
diff --git a/project2/common/sourceObject.cpp b/project2/common/sourceObject.cpp
index 9de39b4..f0423cb 100644
--- a/project2/common/sourceObject.cpp
+++ b/project2/common/sourceObject.cpp
@@ -19,3 +19,8 @@ SourceObject::~SourceObject()
{
}
+void
+SourceObject::loadComplete(const CommonObjects *)
+{
+}
+
diff --git a/project2/common/sourceObject.h b/project2/common/sourceObject.h
index 3ebae2c..6a6df55 100644
--- a/project2/common/sourceObject.h
+++ b/project2/common/sourceObject.h
@@ -15,7 +15,7 @@ class SourceObject : public virtual IntrusivePtrBase {
SourceObject(const std::string & name);
virtual ~SourceObject() = 0;
- virtual void loadComplete(const CommonObjects *) = 0;
+ virtual void loadComplete(const CommonObjects *);
const std::string name;
const unsigned int order;
diff --git a/project2/common/validDateCheck.cpp b/project2/common/validDateCheck.cpp
index 4e2fa49..6f731bb 100644
--- a/project2/common/validDateCheck.cpp
+++ b/project2/common/validDateCheck.cpp
@@ -19,11 +19,6 @@ class ValidDateCheck : public ParamChecker {
{
}
- void
- loadComplete(const CommonObjects *)
- {
- }
-
bool
performCheck() const
{
diff --git a/project2/common/variables.cpp b/project2/common/variables.cpp
index 261e942..74bdecd 100644
--- a/project2/common/variables.cpp
+++ b/project2/common/variables.cpp
@@ -8,7 +8,6 @@
#include "rowSet.h"
#include <libxml++/nodes/textnode.h>
#include <stdexcept>
-#include <boost/tokenizer.hpp>
#include <boost/foreach.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/function.hpp>
@@ -19,25 +18,30 @@ SimpleMessageException(UnknownVariableType);
SimpleMessageException(UnknownVariableSource);
SimpleMessageException(NoVariableDefinition);
-bool Null::operator<(const Null &) const
+bool
+Null::operator<(const Null &) const
{
return false;
}
-bool Boolean::operator<(const Boolean & b) const
+bool
+Boolean::operator<(const Boolean & b) const
{
return ((this->value == false) && (b.value == true));
}
+
Boolean::operator bool() const
{
return this->value;
}
+
std::basic_ostream<char> &
operator<<(std::basic_ostream<char> & os, const Boolean & b)
{
os << (b.value ? "true" : "false");
return os;
}
+
std::basic_ostream<unsigned char> &
operator<<(std::basic_ostream<unsigned char> & os, const Boolean & b)
{
@@ -76,6 +80,7 @@ getVariableTypeFromName(const std::string & src)
if (src == "datetime") return DateTime;
throw UnknownVariableType(src);
}
+
static
VariableType
makeVariableType(const Glib::ustring & src, const VT_typeID format = DefaultType)
@@ -180,6 +185,7 @@ class comp : public boost::static_visitor<bool> {
private:
const VariableType & _a;
};
+
bool
VariableType::operator<(const VariableType & b) const
{
diff --git a/project2/common/viewHost.cpp b/project2/common/viewHost.cpp
index 41ed05b..7f7d6c7 100644
--- a/project2/common/viewHost.cpp
+++ b/project2/common/viewHost.cpp
@@ -73,24 +73,24 @@ ViewHost::PresenterMultiplexer::pushSub(const Glib::ustring & name, const Glib::
FOREACH_PRESENTER { p->pushSub(name, ns); }
}
void
-ViewHost::PresenterMultiplexer::addAttr(const Glib::ustring & name, const VariableType & value) const
+ViewHost::PresenterMultiplexer::addAttribute(const Glib::ustring & name, const VariableType & value) const
{
- FOREACH_PRESENTER { p->addAttr(name, value); }
+ FOREACH_PRESENTER { p->addAttribute(name, value); }
}
void
-ViewHost::PresenterMultiplexer::addAttr(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const
+ViewHost::PresenterMultiplexer::addAttribute(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const
{
- FOREACH_PRESENTER { p->addAttr(name, ns, value); }
+ FOREACH_PRESENTER { p->addAttribute(name, ns, value); }
}
void
-ViewHost::PresenterMultiplexer::addField(const Glib::ustring & name, const VariableType & value) const
+ViewHost::PresenterMultiplexer::addNamedValue(const Glib::ustring & name, const VariableType & value) const
{
- FOREACH_PRESENTER { p->addField(name, value); }
+ FOREACH_PRESENTER { p->addNamedValue(name, value); }
}
void
-ViewHost::PresenterMultiplexer::addField(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const
+ViewHost::PresenterMultiplexer::addNamedValue(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const
{
- FOREACH_PRESENTER { p->addField(name, ns, value); }
+ FOREACH_PRESENTER { p->addNamedValue(name, ns, value); }
}
void
ViewHost::PresenterMultiplexer::addText(const VariableType & value) const
diff --git a/project2/common/viewHost.h b/project2/common/viewHost.h
index 5995d82..d5e8695 100644
--- a/project2/common/viewHost.h
+++ b/project2/common/viewHost.h
@@ -18,10 +18,10 @@ class ViewHost : virtual public XmlScriptParser, virtual public CheckHost {
void setNamespace(const Glib::ustring & prefix, const Glib::ustring & ns) const;
void pushSub(const Glib::ustring & name) const;
void pushSub(const Glib::ustring & name, const Glib::ustring & ns) const;
- void addAttr(const Glib::ustring & name, const VariableType & value) const;
- void addAttr(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const;
- void addField(const Glib::ustring & name, const VariableType & value) const;
- void addField(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const;
+ void addAttribute(const Glib::ustring & name, const VariableType & value) const;
+ void addAttribute(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const;
+ void addNamedValue(const Glib::ustring & name, const VariableType & value) const;
+ void addNamedValue(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const;
void addText(const VariableType & value) const;
void popSub() const;
Presenters presenters;
diff --git a/project2/console/consolePresenter.cpp b/project2/console/consolePresenter.cpp
index d1aeeb7..47c846a 100644
--- a/project2/console/consolePresenter.cpp
+++ b/project2/console/consolePresenter.cpp
@@ -10,16 +10,6 @@ ConsolePresenter::ConsolePresenter(const xmlpp::Element *) :
}
void
-ConsolePresenter::declareNamespace(const Glib::ustring &, const Glib::ustring &) const
-{
-}
-
-void
-ConsolePresenter::setNamespace(const Glib::ustring &, const Glib::ustring &) const
-{
-}
-
-void
ConsolePresenter::pushSub(const Glib::ustring & name, const Glib::ustring & ns) const
{
fprintf(stdout, "%*s", indent, "");
@@ -32,7 +22,7 @@ ConsolePresenter::pushSub(const Glib::ustring & name, const Glib::ustring & ns)
}
void
-ConsolePresenter::addAttr(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const
+ConsolePresenter::addAttribute(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const
{
fprintf(stdout, "%*s", indent, "");
if (!ns.empty()) {
@@ -44,7 +34,7 @@ ConsolePresenter::addAttr(const Glib::ustring & name, const Glib::ustring & ns,
}
void
-ConsolePresenter::addField(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const
+ConsolePresenter::addNamedValue(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const
{
fprintf(stdout, "%*s", indent, "");
if (!ns.empty()) {
diff --git a/project2/console/consolePresenter.h b/project2/console/consolePresenter.h
index dc409ab..a411765 100644
--- a/project2/console/consolePresenter.h
+++ b/project2/console/consolePresenter.h
@@ -7,11 +7,9 @@
class ConsolePresenter : public Presenter {
public:
ConsolePresenter(const xmlpp::Element *);
- void declareNamespace(const Glib::ustring & prefix, const Glib::ustring & ns) const;
- void setNamespace(const Glib::ustring & prefix, const Glib::ustring & ns) const;
void pushSub(const Glib::ustring & ns, const Glib::ustring & name) const;
- void addAttr(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const;
- void addField(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const;
+ void addAttribute(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const;
+ void addNamedValue(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const;
void addText(const VariableType & value) const;
void popSub() const;
void write(const boost::function1<std::ostream *, const std::string &> &) const;
diff --git a/project2/files/fileRows.cpp b/project2/files/fileRows.cpp
index d7c8fca..8ba5c0c 100644
--- a/project2/files/fileRows.cpp
+++ b/project2/files/fileRows.cpp
@@ -18,11 +18,6 @@ FileRows::~FileRows()
}
void
-FileRows::loadComplete(const CommonObjects *)
-{
-}
-
-void
FileRows::setFilter(const Glib::ustring &)
{
throw NotSupported(__PRETTY_FUNCTION__);
diff --git a/project2/files/fileRows.h b/project2/files/fileRows.h
index 0cf3f1d..7d92d20 100644
--- a/project2/files/fileRows.h
+++ b/project2/files/fileRows.h
@@ -13,7 +13,6 @@ class FileRows : public StreamRows {
~FileRows();
void execute(const Glib::ustring &, const RowProcessor *) const;
- virtual void loadComplete(const CommonObjects *);
virtual void setFilter(const Glib::ustring &);
const Variable path;
diff --git a/project2/files/fsRows.cpp b/project2/files/fsRows.cpp
index cb73b04..a76cc02 100644
--- a/project2/files/fsRows.cpp
+++ b/project2/files/fsRows.cpp
@@ -136,11 +136,6 @@ FsRows::~FsRows()
{
}
-void
-FsRows::loadComplete(const CommonObjects *)
-{
-}
-
FsRows::Path
normalisePath(const std::string & p)
{
diff --git a/project2/files/fsRows.h b/project2/files/fsRows.h
index 3356b37..6ef6b31 100644
--- a/project2/files/fsRows.h
+++ b/project2/files/fsRows.h
@@ -32,7 +32,6 @@ class FsRows : public RowSet {
~FsRows();
void execute(const Glib::ustring &, const RowProcessor *) const;
- virtual void loadComplete(const CommonObjects *);
class SearchState : public RowState {
public:
SearchState(const boost::filesystem::path & r);
diff --git a/project2/mail/sendmailTask.cpp b/project2/mail/sendmailTask.cpp
index e335d30..18be222 100644
--- a/project2/mail/sendmailTask.cpp
+++ b/project2/mail/sendmailTask.cpp
@@ -59,11 +59,6 @@ SendMailTask::~SendMailTask()
{
}
-void
-SendMailTask::loadComplete(const CommonObjects *)
-{
-}
-
const char *
SendMailTask::writeMailWrapper(void ** buf, int * len, void * arg)
{
diff --git a/project2/mail/sendmailTask.h b/project2/mail/sendmailTask.h
index 8c427dd..5b10d44 100644
--- a/project2/mail/sendmailTask.h
+++ b/project2/mail/sendmailTask.h
@@ -33,7 +33,6 @@ class SendMailTask : public Task {
SendMailTask(const xmlpp::Element * p);
virtual ~SendMailTask();
- virtual void loadComplete(const CommonObjects *);
virtual void execute() const;
protected:
diff --git a/project2/processes/procRows.cpp b/project2/processes/procRows.cpp
index f1d00e0..c868323 100644
--- a/project2/processes/procRows.cpp
+++ b/project2/processes/procRows.cpp
@@ -16,11 +16,6 @@ ProcRows::~ProcRows()
{
}
-void
-ProcRows::loadComplete(const CommonObjects *)
-{
-}
-
FileStarChannel
ProcRows::doOpen() const
{
diff --git a/project2/processes/procRows.h b/project2/processes/procRows.h
index 63dbb8e..09b6f04 100644
--- a/project2/processes/procRows.h
+++ b/project2/processes/procRows.h
@@ -9,7 +9,6 @@ class ProcRows : public FileRows {
ProcRows(const xmlpp::Element * p);
~ProcRows();
- virtual void loadComplete(const CommonObjects *);
virtual FileStarChannel doOpen() const;
static int doClose(FILE*);
};
diff --git a/project2/regex/regexCheck.cpp b/project2/regex/regexCheck.cpp
index b88a44c..1a1add3 100644
--- a/project2/regex/regexCheck.cpp
+++ b/project2/regex/regexCheck.cpp
@@ -16,11 +16,6 @@ RegexCheck::~RegexCheck()
{
}
-void
-RegexCheck::loadComplete(const CommonObjects *)
-{
-}
-
bool
RegexCheck::performCheck() const
{
diff --git a/project2/regex/regexCheck.h b/project2/regex/regexCheck.h
index 17033de..c4f6e02 100644
--- a/project2/regex/regexCheck.h
+++ b/project2/regex/regexCheck.h
@@ -10,7 +10,6 @@ class RegexCheck : public ParamChecker {
RegexCheck(const xmlpp::Element * p);
virtual ~RegexCheck();
- virtual void loadComplete(const CommonObjects *);
bool performCheck() const;
const Variable applyTo;
diff --git a/project2/regex/regexRows.cpp b/project2/regex/regexRows.cpp
index 1dab636..a822cf1 100644
--- a/project2/regex/regexRows.cpp
+++ b/project2/regex/regexRows.cpp
@@ -19,11 +19,6 @@ RegexRows::~RegexRows()
}
void
-RegexRows::loadComplete(const CommonObjects*)
-{
-}
-
-void
RegexRows::execute(const Glib::ustring&, const RowProcessor * rp) const
{
Glib::RefPtr<Glib::Regex> reg = Glib::Regex::create(regex(), Glib::REGEX_CASELESS | Glib::REGEX_DOTALL);
diff --git a/project2/regex/regexRows.h b/project2/regex/regexRows.h
index cef2e71..21d9dfa 100644
--- a/project2/regex/regexRows.h
+++ b/project2/regex/regexRows.h
@@ -9,7 +9,7 @@ class RegexRows : public DefinedColumns, public RowSet {
public:
RegexRows(const xmlpp::Element * p);
~RegexRows();
- void loadComplete(const CommonObjects*);
+
void execute(const Glib::ustring&, const RowProcessor*) const;
private:
diff --git a/project2/sql/rdbmsDataSource.cpp b/project2/sql/rdbmsDataSource.cpp
index 77d6fbf..20ccaec 100644
--- a/project2/sql/rdbmsDataSource.cpp
+++ b/project2/sql/rdbmsDataSource.cpp
@@ -57,11 +57,6 @@ RdbmsDataSource::~RdbmsDataSource()
{
}
-void
-RdbmsDataSource::loadComplete(const CommonObjects *)
-{
-}
-
const DB::Connection &
RdbmsDataSource::getWritable() const
{
diff --git a/project2/sql/rdbmsDataSource.h b/project2/sql/rdbmsDataSource.h
index fdcfbe7..60206ff 100644
--- a/project2/sql/rdbmsDataSource.h
+++ b/project2/sql/rdbmsDataSource.h
@@ -53,7 +53,6 @@ class RdbmsDataSource : public DataSource {
const DB::Connection & getReadonly() const;
const DB::Connection & getWritable() const;
- virtual void loadComplete(const CommonObjects *);
virtual void commit();
virtual void rollback();
diff --git a/project2/sql/sqlCache.cpp b/project2/sql/sqlCache.cpp
index d6875ac..5435dc4 100644
--- a/project2/sql/sqlCache.cpp
+++ b/project2/sql/sqlCache.cpp
@@ -62,8 +62,6 @@ class SqlCache : public Cache {
SqlCacheRowSet(SelectPtr r) :
RowSet(NULL),
s(r) {
- }
- void loadComplete(const CommonObjects *) {
}
class SqlCacheRowState : public RowState {
public:
@@ -149,78 +147,61 @@ class SqlCache : public Cache {
return NULL;
}
- class SqlCachePresenter : public Presenter {
+ class SqlCachePresenter : public RowSetPresenter {
public:
SqlCachePresenter(const Glib::ustring & name, const Glib::ustring & filter, const RdbmsDataSource * d) :
- depth(0),
row(1),
db(d),
n(name),
f(filter) {
}
- void declareNamespace(const Glib::ustring &, const Glib::ustring &) const { }
- void setNamespace(const Glib::ustring &, const Glib::ustring &) const { }
- void pushSub(const Glib::ustring & name, const Glib::ustring &) const {
- depth += 1;
- if (depth == 2) {
- col = name;
- }
- else if (depth == 1) {
- }
+ void addNewRow(const Glib::ustring &) const {
}
- void addAttr(const Glib::ustring & name, const Glib::ustring &, const VariableType & value) const {
- attrs.insert(Values::value_type(name, value));
+ void addAttribute(const Glib::ustring & name, const VariableType & value) const {
+ attrs[name] = value;
}
- void addText(const VariableType & value) const {
- cols.insert(Values::value_type(col, value));
+ void addNamedValue(const Glib::ustring & name, const VariableType & value) const {
+ cols[name] = value;
}
- void popSub() const {
- if (depth == 2) {
- col.clear();
+ void finishRow() const {
+ Buffer sql;
+ sql.appendf("INSERT INTO %s_%s_%s_rows(p2_row", HeaderTable.c_str(), n.c_str(), f.c_str());
+ BOOST_FOREACH(const Values::value_type & a, attrs) {
+ sql.appendf(", p2attr_%s", a.first.c_str());
}
- else if (depth == 1) {
- Buffer sql;
- sql.appendf("INSERT INTO %s_%s_%s_rows(p2_row", HeaderTable.c_str(), n.c_str(), f.c_str());
- BOOST_FOREACH(const Values::value_type & a, attrs) {
- sql.appendf(", p2attr_%s", a.first.c_str());
- }
- BOOST_FOREACH(const Values::value_type & v, cols) {
- sql.appendf(", %s", v.first.c_str());
- }
- sql.appendf(") VALUES(?");
- for (size_t x = attrs.size(); x > 0; x -= 1) {
- sql.append(", ?");
- }
- for (size_t x = cols.size(); x > 0; x -= 1) {
- sql.append(", ?");
- }
- sql.appendf(")");
- ModifyPtr m(db->getWritable().newModifyCommand(sql));
- unsigned int offset = 0;
- m->bindParamI(offset++, row++);
- BOOST_FOREACH(const Values::value_type & a, attrs) {
- boost::apply_visitor<const SqlVariableBinder, const VariableType>(SqlVariableBinder(m.get(), offset++), a.second);
- }
- BOOST_FOREACH(const Values::value_type & v, cols) {
- boost::apply_visitor<const SqlVariableBinder, const VariableType>(SqlVariableBinder(m.get(), offset++), v.second);
- }
- m->execute();
- cols.clear();
- attrs.clear();
+ BOOST_FOREACH(const Values::value_type & v, cols) {
+ sql.appendf(", %s", v.first.c_str());
+ }
+ sql.appendf(") VALUES(?");
+ for (size_t x = attrs.size(); x > 0; x -= 1) {
+ sql.append(", ?");
+ }
+ for (size_t x = cols.size(); x > 0; x -= 1) {
+ sql.append(", ?");
+ }
+ sql.appendf(")");
+ ModifyPtr m(db->getWritable().newModifyCommand(sql));
+ unsigned int offset = 0;
+ m->bindParamI(offset++, row++);
+ BOOST_FOREACH(const Values::value_type & a, attrs) {
+ boost::apply_visitor<const SqlVariableBinder, const VariableType>(SqlVariableBinder(m.get(), offset++), a.second);
+ }
+ BOOST_FOREACH(const Values::value_type & v, cols) {
+ boost::apply_visitor<const SqlVariableBinder, const VariableType>(SqlVariableBinder(m.get(), offset++), v.second);
}
- depth -= 1;
+ m->execute();
+ cols.clear();
+ attrs.clear();
}
private:
- mutable unsigned int depth;
mutable unsigned int row;
const RdbmsDataSource * db;
- mutable Glib::ustring col;
const Glib::ustring n, f;
typedef std::map<Glib::ustring, VariableType> Values;
mutable Values cols, attrs;
};
- PresenterPtr openFor(const Glib::ustring & n, const Glib::ustring & f, const IHaveParameters * ps)
+ RowSetPresenterPtr openFor(const Glib::ustring & n, const Glib::ustring & f, const IHaveParameters * ps)
{
Buffer sp;
sp.appendf("SAVEPOINT sp%p", this);
diff --git a/project2/sql/sqlMergeTask.cpp b/project2/sql/sqlMergeTask.cpp
index 30d3a59..f98d57e 100644
--- a/project2/sql/sqlMergeTask.cpp
+++ b/project2/sql/sqlMergeTask.cpp
@@ -27,8 +27,6 @@ class SqlMergeInsert : IHaveParameters, public Task {
IHaveParameters(p),
Task(p) {
}
- void loadComplete(const CommonObjects*) {
- }
void execute() const {
unsigned int col = 0;
BOOST_FOREACH(const Parameters::value_type & v, parameters) {
@@ -239,9 +237,6 @@ class Populate : public NoOutputExecute {
cmd(c)
{
}
- virtual void loadComplete(const CommonObjects *)
- {
- }
void execute() const
{
unsigned int idx = 0;
diff --git a/project2/url/urlRows.cpp b/project2/url/urlRows.cpp
index cfacea4..b3abddd 100644
--- a/project2/url/urlRows.cpp
+++ b/project2/url/urlRows.cpp
@@ -19,11 +19,6 @@ UrlRows::~UrlRows()
{
}
-void
-UrlRows::loadComplete(const CommonObjects *)
-{
-}
-
size_t
UrlRows::handleData(ParseState * ps, const char * bytes, size_t bytesLen) const
{
diff --git a/project2/url/urlRows.h b/project2/url/urlRows.h
index cd209c8..9bd4302 100644
--- a/project2/url/urlRows.h
+++ b/project2/url/urlRows.h
@@ -14,7 +14,6 @@ class UrlRows : public StreamRows, VariableCurlHelper {
UrlRows(const xmlpp::Element * p);
~UrlRows();
- virtual void loadComplete(const CommonObjects *);
void execute(const Glib::ustring &, const RowProcessor *) const;
private:
diff --git a/project2/xml/rawView.cpp b/project2/xml/rawView.cpp
index f033542..2070a2f 100644
--- a/project2/xml/rawView.cpp
+++ b/project2/xml/rawView.cpp
@@ -19,11 +19,6 @@ RawView::RawView(const xmlpp::Element * p) :
}
void
-RawView::loadComplete(const CommonObjects *)
-{
-}
-
-void
RawView::execute(const Presenter * p) const
{
BOOST_FOREACH(xmlpp::Node * node, copyRoot->get_children()) {
@@ -41,7 +36,7 @@ RawView::copyNode(const Presenter * p, const xmlpp::Element * n) const
p->setNamespace(n->get_namespace_prefix(), n->get_namespace_uri());
xmlpp::Element::AttributeList al = n->get_attributes();
BOOST_FOREACH(const xmlpp::Attribute * a, al) {
- p->addAttr(a->get_name(), a->get_value());
+ p->addAttribute(a->get_name(), a->get_value());
}
const xmlpp::Node::NodeList ch = n->get_children();
BOOST_FOREACH(const xmlpp::Node * c, ch) {
diff --git a/project2/xml/rawView.h b/project2/xml/rawView.h
index b192c89..87fcd5e 100644
--- a/project2/xml/rawView.h
+++ b/project2/xml/rawView.h
@@ -11,7 +11,7 @@ class RawView : public View {
public:
RawView(const xmlpp::Element * p);
void execute(const Presenter *) const;
- virtual void loadComplete(const CommonObjects *);
+
private:
void copyNode(const Presenter *, const xmlpp::Element *) const;
const xmlpp::Element * copyRoot;
diff --git a/project2/xml/xmlCache.cpp b/project2/xml/xmlCache.cpp
index c79af2c..64e5f86 100644
--- a/project2/xml/xmlCache.cpp
+++ b/project2/xml/xmlCache.cpp
@@ -19,10 +19,6 @@ class XmlCache : public Cache {
{
}
- void loadComplete(const CommonObjects*)
- {
- }
-
RowSetCPtr getCachedRowSet(const Glib::ustring & n, const Glib::ustring & f, const IHaveParameters * ps) const
{
boost::filesystem::path cache = getCacheFile(n, f, ps);
@@ -37,7 +33,7 @@ class XmlCache : public Cache {
return NULL;
}
- PresenterPtr openFor(const Glib::ustring & n, const Glib::ustring &, const IHaveParameters *)
+ RowSetPresenterPtr openFor(const Glib::ustring & n, const Glib::ustring &, const IHaveParameters *)
{
writeTo = new XmlPresenter(n, Glib::ustring(), Glib::ustring());
return writeTo;
diff --git a/project2/xml/xmlDocumentPrefetch.cpp b/project2/xml/xmlDocumentPrefetch.cpp
index cfb5191..9ac912e 100644
--- a/project2/xml/xmlDocumentPrefetch.cpp
+++ b/project2/xml/xmlDocumentPrefetch.cpp
@@ -31,12 +31,6 @@ XmlDocumentPrefetch::execute() const
queue(url(), encoding());
}
-void
-XmlDocumentPrefetch::loadComplete(const CommonObjects *)
-{
-}
-
-
CurlPtr
XmlDocumentPrefetch::newCurl() const
{
diff --git a/project2/xml/xmlDocumentPrefetch.h b/project2/xml/xmlDocumentPrefetch.h
index 902b7be..d8df77b 100644
--- a/project2/xml/xmlDocumentPrefetch.h
+++ b/project2/xml/xmlDocumentPrefetch.h
@@ -15,7 +15,6 @@ class XmlDocumentPrefetch : public View, public Task, XmlDocumentCache, Variable
void execute(const Presenter*) const;
void execute() const;
- void loadComplete(const CommonObjects *);
const Variable html;
const Variable warnings;
diff --git a/project2/xml/xmlPresenter.cpp b/project2/xml/xmlPresenter.cpp
index 58321ba..249e4f4 100644
--- a/project2/xml/xmlPresenter.cpp
+++ b/project2/xml/xmlPresenter.cpp
@@ -77,7 +77,7 @@ XmlPresenter::pushSub(const Glib::ustring & name, const Glib::ustring & ns) cons
}
void
-XmlPresenter::addAttr(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const
+XmlPresenter::addAttribute(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const
{
if (!value.get<Null>()) {
nodeStack.back()->set_attribute(name, value, ns);
diff --git a/project2/xml/xmlPresenter.h b/project2/xml/xmlPresenter.h
index ae40470..bfb3375 100644
--- a/project2/xml/xmlPresenter.h
+++ b/project2/xml/xmlPresenter.h
@@ -18,7 +18,7 @@ class XmlPresenter : public ContentPresenter, public SourceOf<xmlpp::Document>,
void declareNamespace(const Glib::ustring & prefix, const Glib::ustring & ns) const;
void setNamespace(const Glib::ustring & prefix, const Glib::ustring & ns) const;
void pushSub(const Glib::ustring & name, const Glib::ustring & ns) const;
- void addAttr(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const;
+ void addAttribute(const Glib::ustring & name, const Glib::ustring & ns, const VariableType & value) const;
void addText(const VariableType & value) const;
void popSub() const;
diff --git a/project2/xml/xmlRawRows.cpp b/project2/xml/xmlRawRows.cpp
index c227b2c..73685aa 100644
--- a/project2/xml/xmlRawRows.cpp
+++ b/project2/xml/xmlRawRows.cpp
@@ -52,10 +52,6 @@ XmlRawRowsBase::XmlRawRowsBase() :
{
}
-void XmlRawRowsBase::loadComplete(const CommonObjects*)
-{
-}
-
void XmlRawRowsBase::execute(const xmlpp::Document * doc, const RowProcessor * rp) const
{
XmlRowState rs;
diff --git a/project2/xml/xmlRawRows.h b/project2/xml/xmlRawRows.h
index a4e7899..81c04a5 100644
--- a/project2/xml/xmlRawRows.h
+++ b/project2/xml/xmlRawRows.h
@@ -9,8 +9,6 @@ class XmlRawRowsBase : public RowSet {
XmlRawRowsBase(const xmlpp::Element * p);
XmlRawRowsBase();
- void loadComplete(const CommonObjects*);
-
protected:
void execute(const xmlpp::Document *, const RowProcessor * rp) const;
};
diff --git a/project2/xml/xmlRows.cpp b/project2/xml/xmlRows.cpp
index 71cf06c..d648b10 100644
--- a/project2/xml/xmlRows.cpp
+++ b/project2/xml/xmlRows.cpp
@@ -52,11 +52,6 @@ XmlRows::~XmlRows()
{
}
-void
-XmlRows::loadComplete(const CommonObjects *)
-{
-}
-
static
void
store(const XmlRows::Path & position, RowState::FieldValues & values, const XmlRows::Interests & fields, const xmlChar * val)
diff --git a/project2/xml/xmlRows.h b/project2/xml/xmlRows.h
index 6e74377..d9971bc 100644
--- a/project2/xml/xmlRows.h
+++ b/project2/xml/xmlRows.h
@@ -16,7 +16,6 @@ class XmlRows : public RowSet {
~XmlRows();
void execute(const Glib::ustring &, const RowProcessor *) const;
- virtual void loadComplete(const CommonObjects *);
const Variable recordRoot;
const Variable recordTrigger;
diff --git a/project2/xml/xpathRows.cpp b/project2/xml/xpathRows.cpp
index 71a2ce2..7dc9c2b 100644
--- a/project2/xml/xpathRows.cpp
+++ b/project2/xml/xpathRows.cpp
@@ -43,11 +43,6 @@ XPathRows::~XPathRows()
{
}
-void
-XPathRows::loadComplete(const CommonObjects *)
-{
-}
-
bool
XPathRows::asHtml() const
{
diff --git a/project2/xml/xpathRows.h b/project2/xml/xpathRows.h
index 4f1db39..e2c6327 100644
--- a/project2/xml/xpathRows.h
+++ b/project2/xml/xpathRows.h
@@ -18,7 +18,6 @@ class XPathRows : public RowSet, XmlDocumentCache, VariableCurlHelper {
~XPathRows();
void execute(const Glib::ustring &, const RowProcessor *) const;
- virtual void loadComplete(const CommonObjects *);
private:
class FilterViewColumn : public Column {