diff options
| -rw-r--r-- | project2/common/rowView.h | 2 | ||||
| -rw-r--r-- | project2/common/viewGroup.cpp | 27 | ||||
| -rw-r--r-- | project2/xml/xmlScriptParser.cpp | 8 | 
3 files changed, 35 insertions, 2 deletions
diff --git a/project2/common/rowView.h b/project2/common/rowView.h index 9ba4699..534a06f 100644 --- a/project2/common/rowView.h +++ b/project2/common/rowView.h @@ -26,7 +26,7 @@ class RowView : public View, public RowProcessor {  		Columns viewColumns;  		void executeChildren() const; -		typedef ANONSTORAGEOF(View) SubViews; +		typedef ANONORDEREDSTORAGEOF(View) SubViews;  		SubViews subViews;  		typedef ANONSTORAGEOF(ValueAggregate) ValueAggregates;  		ValueAggregates valueAggregates; diff --git a/project2/common/viewGroup.cpp b/project2/common/viewGroup.cpp new file mode 100644 index 0000000..b01f6c8 --- /dev/null +++ b/project2/common/viewGroup.cpp @@ -0,0 +1,27 @@ +#include "view.h" +#include <boost/foreach.hpp> +#include "presenter.h" + +class ViewGroup : public View { +	public: +		ViewGroup(ScriptNodePtr s) : +			SourceObject(s), +			View(s) +		{ +			s->script->loader.addLoadTarget(s, Storer::into<ElementLoader>(&subViews)); +		} + +		void execute(const MultiRowSetPresenter * presenter) const +		{ +			presenter->addNewRowSet(name); +			BOOST_FOREACH(const SubViews::value_type & sq, subViews) { +				sq->execute(presenter); +			} +			presenter->finishRowSet(); +		} + +		typedef ANONORDEREDSTORAGEOF(View) SubViews; +		SubViews subViews; +}; + +DECLARE_LOADER("viewgroup", ViewGroup); diff --git a/project2/xml/xmlScriptParser.cpp b/project2/xml/xmlScriptParser.cpp index ece6701..71c4bb5 100644 --- a/project2/xml/xmlScriptParser.cpp +++ b/project2/xml/xmlScriptParser.cpp @@ -76,7 +76,13 @@ bool  XmlScriptParser::isCurrent() const  {  	BOOST_FOREACH(const Files::value_type & f, files) { -		if (boost::filesystem::last_write_time(f.first) != f.second) { +		try { +			if (boost::filesystem::last_write_time(f.first) != f.second) { +				_root.reset(); +				return false; +			} +		} +		catch (const boost::filesystem::filesystem_error &) {  			_root.reset();  			return false;  		}  | 
