⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hello_world_view2.cpp

📁 C++ web POSIX framewark
💻 CPP
字号:
#line 1 "hello_world_skin2.tmpl"#include "hello_world_view.h" #line 2 "hello_world_skin2.tmpl"namespace view2 {	#line 3 "hello_world_skin2.tmpl"	struct master :public cppcms::base_view	#line 3 "hello_world_skin2.tmpl"	{	#line 3 "hello_world_skin2.tmpl"		view::master &content;	#line 3 "hello_world_skin2.tmpl"		cppcms::transtext::trans const *tr;	#line 3 "hello_world_skin2.tmpl"		master(cppcms::base_view::settings _s,view::master &_content): cppcms::base_view(_s),content(_content)	#line 3 "hello_world_skin2.tmpl"		{	#line 3 "hello_world_skin2.tmpl"			tr=_s.worker->domain_gettext("test");	#line 3 "hello_world_skin2.tmpl"		};		#line 4 "hello_world_skin2.tmpl"		virtual void render() {			#line 6 "hello_world_skin2.tmpl"			cout<<"\n"				"\t\t<html>\n"				"\t\t<title>Skin2:: ";			#line 6 "hello_world_skin2.tmpl"			cout<<escape(content.title);			#line 8 "hello_world_skin2.tmpl"			cout<<"</title>\n"				"\t\t<body>\n"				"\t\t";			#line 8 "hello_world_skin2.tmpl"			body();			#line 11 "hello_world_skin2.tmpl"			cout<<"\n"				"\t\t</body>\n"				"\t\t</html>\n"				"\t";		#line 11 "hello_world_skin2.tmpl"		} // end of template render		#line 12 "hello_world_skin2.tmpl"		virtual void body() {			#line 13 "hello_world_skin2.tmpl"			cout<<"\n"				"\t";		#line 13 "hello_world_skin2.tmpl"		} // end of template body	#line 14 "hello_world_skin2.tmpl"	}; // end of class master#line 15 "hello_world_skin2.tmpl"} // end of namespace view2#line 2 "hello_world_view1.tmpl"namespace view2 {	#line 3 "hello_world_view1.tmpl"	struct hello :public master	#line 3 "hello_world_view1.tmpl"	{	#line 3 "hello_world_view1.tmpl"		view::hello &content;	#line 3 "hello_world_view1.tmpl"		cppcms::transtext::trans const *tr;	#line 3 "hello_world_view1.tmpl"		hello(cppcms::base_view::settings _s,view::hello &_content): master(_s,_content),content(_content)	#line 3 "hello_world_view1.tmpl"		{	#line 3 "hello_world_view1.tmpl"			tr=_s.worker->domain_gettext("test");	#line 3 "hello_world_view1.tmpl"		};		#line 4 "hello_world_view1.tmpl"		virtual void body() {			#line 7 "hello_world_view1.tmpl"			cout<<"\n"				"\t<form action=\"\" method=\"post\">\n"				"\t<ul>\n"				"\t";			#line 7 "hello_world_view1.tmpl"			cout<<content.form.render(cppcms::base_form::as_ul|cppcms::base_form::as_xhtml);			#line 13 "hello_world_view1.tmpl"			cout<<"\n"				"\t</ul>\n"				"\t<input type=\"submit\" value=\"Submit\" />\n"				"\t</form>\n"				"\t<form action=\"\" method=\"post\">\n"				"\t<p>\n"				"\t\t";			#line 13 "hello_world_view1.tmpl"			if(content.form.my_set.widgets.begin()!=content.form.my_set.widgets.end()){				#line 14 "hello_world_view1.tmpl"				cout<<"\n"					"\t\t\t";				#line 14 "hello_world_view1.tmpl"				for(cppcms::widgetset::widgets_t::iterator w_ptr=content.form.my_set.widgets.begin(),w_ptr_end=content.form.my_set.widgets.end();w_ptr!=w_ptr_end;++w_ptr) {				#line 14 "hello_world_view1.tmpl"				cppcms::widgets::base_widget &w=**w_ptr;				#line 14 "hello_world_view1.tmpl"				if(w_ptr!=content.form.my_set.widgets.begin()) {				#line 14 "hello_world_view1.tmpl"				cout<<"<br/>";				#line 14 "hello_world_view1.tmpl"				} // end of separator					#line 15 "hello_world_view1.tmpl"					cout<<"\n"						"\t\t\t\t";					#line 15 "hello_world_view1.tmpl"					if(!(w.msg.empty())) {						#line 15 "hello_world_view1.tmpl"						cout<<escape(w.msg);						#line 15 "hello_world_view1.tmpl"						cout<<":";					#line 15 "hello_world_view1.tmpl"					} // endif					#line 16 "hello_world_view1.tmpl"					cout<<"\n"						"\t\t\t\t";					#line 16 "hello_world_view1.tmpl"					cout<<w.render_input(cppcms::base_form::as_xhtml);					#line 17 "hello_world_view1.tmpl"					cout<<"\n"						"\t\t\t\t";					#line 17 "hello_world_view1.tmpl"					if(!(w.is_valid)) {						#line 17 "hello_world_view1.tmpl"						cout<<":";						#line 17 "hello_world_view1.tmpl"						cout<<w.render_error();					#line 17 "hello_world_view1.tmpl"					} // endif					#line 18 "hello_world_view1.tmpl"					cout<<"\n"						"\t\t\t";				#line 18 "hello_world_view1.tmpl"				} // end of item				#line 19 "hello_world_view1.tmpl"				cout<<"\n"					"\t\t";			#line 19 "hello_world_view1.tmpl"			}			#line 23 "hello_world_view1.tmpl"			cout<<"\n"				"\t\t<input type=\"submit\" value=\"Submit\" />\n"				"\n"				"\t</p>\n"				"\t";			#line 23 "hello_world_view1.tmpl"			if((std::strcmp(tr->gettext("LTR"),"RTL")==0)) {			#line 23 "hello_world_view1.tmpl"			} // endif			#line 24 "hello_world_view1.tmpl"			cout<<"\n"				"\t\t";			#line 24 "hello_world_view1.tmpl"			if(!(content.title.empty())) {				#line 24 "hello_world_view1.tmpl"				cout<<"<h1>";				#line 24 "hello_world_view1.tmpl"				cout<<escape(content.title);				#line 24 "hello_world_view1.tmpl"				cout<<"</h1>";			#line 24 "hello_world_view1.tmpl"			} // endif			#line 25 "hello_world_view1.tmpl"			cout<<"\n"				"\t\t<p>";			#line 25 "hello_world_view1.tmpl"			cout<<escape(content.msg);			#line 26 "hello_world_view1.tmpl"			cout<<"</p>\n"				"\t\t";			#line 26 "hello_world_view1.tmpl"			if(!(content.username.empty())) {				#line 27 "hello_world_view1.tmpl"				cout<<"\n"					"\t\t<p> The form was: nik=";				#line 27 "hello_world_view1.tmpl"				cout<<escape(content.username);				#line 27 "hello_world_view1.tmpl"				cout<<", name=";				#line 27 "hello_world_view1.tmpl"				cout<<escape(content.realname);				#line 27 "hello_world_view1.tmpl"				cout<<", Ok is ";				#line 27 "hello_world_view1.tmpl"				if(!(content.ok)) {					#line 27 "hello_world_view1.tmpl"					cout<<"not";				#line 27 "hello_world_view1.tmpl"				} // endif				#line 28 "hello_world_view1.tmpl"				cout<<" checked,\n"					"\t\t\tpassword=";				#line 28 "hello_world_view1.tmpl"				cout<<escape(content.password);				#line 29 "hello_world_view1.tmpl"				cout<<"</p>\n"					"\t\t";			#line 29 "hello_world_view1.tmpl"			} // endif			#line 30 "hello_world_view1.tmpl"			cout<<"\n"				"\t\t";			#line 30 "hello_world_view1.tmpl"			if(content.numbers.begin()!=content.numbers.end()) {				#line 32 "hello_world_view1.tmpl"				cout<<"\n"					"\t\t\t<ul>\n"					"\t\t\t";				#line 32 "hello_world_view1.tmpl"				for(CPPCMS_TYPEOF(content.numbers.begin()) x_ptr=content.numbers.begin(),x_ptr_end=content.numbers.end();x_ptr!=x_ptr_end;++x_ptr) {				#line 32 "hello_world_view1.tmpl"				CPPCMS_TYPEOF(*x_ptr) &x=*x_ptr;					#line 33 "hello_world_view1.tmpl"					cout<<"\n"						"\t\t\t<li>";					#line 33 "hello_world_view1.tmpl"					cout<<(format(tr->ngettext("passed one day","passed %d days",x)) % escape(x) );					#line 34 "hello_world_view1.tmpl"					cout<<"</li>\n"						"\t\t\t";				#line 34 "hello_world_view1.tmpl"				} // end of item				#line 36 "hello_world_view1.tmpl"				cout<<"\n"					"\t\t\t</ul>\n"					"\t\t";			#line 36 "hello_world_view1.tmpl"			}			#line 37 "hello_world_view1.tmpl"			cout<<"\n"				"\t";		#line 37 "hello_world_view1.tmpl"		} // end of template body	#line 38 "hello_world_view1.tmpl"	}; // end of class hello#line 39 "hello_world_view1.tmpl"} // end of namespace view2#line 40 "hello_world_view1.tmpl"namespace {#line 40 "hello_world_view1.tmpl"	struct loader {#line 40 "hello_world_view1.tmpl"		loader(){#line 40 "hello_world_view1.tmpl"			using namespace cppcms::details;#line 40 "hello_world_view1.tmpl"			views_storage &_VS_ref=views_storage::instance();#line 40 "hello_world_view1.tmpl"			_VS_ref.add_view("view2","master",view_builder<view2::master,view::master>());#line 40 "hello_world_view1.tmpl"			_VS_ref.add_view("view2","hello",view_builder<view2::hello,view::hello>());#line 40 "hello_world_view1.tmpl"		};#line 40 "hello_world_view1.tmpl"		~loader() { #line 40 "hello_world_view1.tmpl"			using namespace cppcms::details;#line 40 "hello_world_view1.tmpl"			views_storage &_VS_ref=views_storage::instance();#line 40 "hello_world_view1.tmpl"			_VS_ref.remove_views("view2");#line 40 "hello_world_view1.tmpl"		}#line 40 "hello_world_view1.tmpl"	} loader_entry;#line 40 "hello_world_view1.tmpl"} // empty namespace #line 40 "hello_world_view1.tmpl"extern "C" { // Dummy extern symbols to insure full link#line 40 "hello_world_view1.tmpl"	void load_view_view2(){}#line 40 "hello_world_view1.tmpl"} // extern C

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -