Ticket #1313: quickbook-copyrights.patch
File quickbook-copyrights.patch, 5.5 KB (added by , 15 years ago) |
---|
-
tools/quickbook/detail/actions.cpp
1077 1077 << " </author>\n"; 1078 1078 } 1079 1079 1080 void xml_copyright::operator()(std::pair<std::vector<std::string>, std::string> const& copyright) const 1081 { 1082 out << "\n" << " <copyright>\n"; 1083 1084 for_each( 1085 copyright.first.begin() 1086 , copyright.first.end() 1087 , xml_year(out)); 1088 1089 out << " <holder>" << copyright.second << "</holder>\n" 1090 << " </copyright>\n" 1091 << "\n" 1092 ; 1093 } 1094 1080 1095 void xml_year::operator()(std::string const &year) const 1081 1096 { 1082 1097 out << " <year>" << year << "</year>\n"; … … 1151 1166 out << " </authorgroup>\n"; 1152 1167 } 1153 1168 1154 if (!actions.doc_copyright _holder.empty())1169 if (!actions.doc_copyrights.empty()) 1155 1170 { 1156 out << "\n" << " <copyright>\n";1157 1158 1171 for_each( 1159 actions.doc_copyright_years.begin() 1160 , actions.doc_copyright_years.end() 1161 , xml_year(out)); 1162 1163 out << " <holder>" << actions.doc_copyright_holder << "</holder>\n" 1164 << " </copyright>\n" 1165 << "\n" 1166 ; 1172 actions.doc_copyrights.begin() 1173 , actions.doc_copyrights.end() 1174 , xml_copyright(out)); 1167 1175 } 1168 1176 1169 1177 if (qbk_version_n < 103) -
tools/quickbook/detail/actions.hpp
742 742 collector& out; 743 743 }; 744 744 745 struct xml_copyright 746 { 747 // Handles xml copyright 748 749 xml_copyright(collector& out) 750 : out(out) {} 751 752 void operator()(std::pair<std::vector<std::string>, std::string> const ©right) const; 753 754 collector& out; 755 }; 756 745 757 void pre(collector& out, quickbook::actions& actions, bool ignore_docinfo = false); 746 758 void post(collector& out, quickbook::actions& actions, bool ignore_docinfo = false); 747 759 -
tools/quickbook/detail/actions_class.cpp
24 24 , doc_version() 25 25 , doc_id() 26 26 , doc_dirname() 27 , doc_copyright_years() 28 , doc_copyright_holder() 27 , doc_copyrights() 29 28 , doc_purpose() 30 29 , doc_category() 31 30 , doc_authors() -
tools/quickbook/detail/actions_class.hpp
28 28 29 29 typedef std::vector<std::string> string_list; 30 30 typedef std::vector<std::pair<std::string, std::string> > author_list; 31 typedef std::vector<std::pair<string_list, std::string> > copyright_list; 31 32 typedef std::pair<char, int> mark_type; 32 33 static int const max_template_depth = 100; 33 34 … … 37 38 std::string doc_version; 38 39 std::string doc_id; 39 40 std::string doc_dirname; 40 string_list doc_copyright_years; 41 std::string doc_copyright_holder; 41 copyright_list doc_copyrights; 42 42 std::string doc_purpose; 43 43 std::string doc_category; 44 44 author_list doc_authors; -
tools/quickbook/doc_info.hpp
66 66 doc_version 67 67 | doc_id 68 68 | doc_dirname 69 | doc_copyright 69 | doc_copyright [push_back_a(actions.doc_copyrights, copyright)] 70 70 | doc_purpose [actions.extract_doc_purpose] 71 71 | doc_category 72 72 | doc_authors … … 103 103 ; 104 104 105 105 doc_copyright = 106 "copyright" >> hard_space 107 >> +( repeat_p(4)[digit_p] [push_back_a( actions.doc_copyright_years)]106 "copyright" >> hard_space [clear_a(copyright.first)] 107 >> +( repeat_p(4)[digit_p] [push_back_a(copyright.first)] 108 108 >> space 109 109 ) 110 110 >> space 111 >> (*(anychar_p - ']')) [assign_a( actions.doc_copyright_holder)]111 >> (*(anychar_p - ']')) [assign_a(copyright.second)] 112 112 ; 113 113 114 114 doc_purpose = … … 178 178 179 179 bool unused; 180 180 std::pair<std::string, std::string> name; 181 std::pair<std::vector<std::string>, std::string> copyright; 181 182 rule<Scanner> doc_info, doc_title, doc_version, doc_id, doc_dirname, 182 183 doc_copyright, doc_purpose,doc_category, doc_authors, 183 184 doc_author, comment, space, hard_space, doc_license,