Ejemplo n.º 1
0
	/**
	 * Test whether the widget exists if the widget is mandatory.
	 *
	 * @param window              The window containing the widget.
	 */
	void validate_widget(twindow& window)
	{
		if(!is_mandatory()) {
			return;
		}
		find_widget<const W>(&window, id(), false);
	}
Ejemplo n.º 2
0
	std::ostream &section_schema::write_additional_info(std::ostream &os) const
	{
		// write comment
		auto comment_lines = string_utils::split(get_comment(), '\n');
		for (auto &comment_line : comment_lines) {
			os << ";" << comment_line << std::endl;
		}

		// optional/mandatory
		std::string info_line = is_mandatory() ? "mandatory" : "optional";
		os << ";<" << info_line << ">" << std::endl;

		return os;
	}