diff --git a/bin/build_lists_pgm.bat b/bin/build_lists_pgm.bat new file mode 100644 index 0000000..a8a3f70 --- /dev/null +++ b/bin/build_lists_pgm.bat @@ -0,0 +1 @@ +g++ %* -std=c++11 -o bin/lists.exe src/date.cpp src/issues.cpp src/sections.cpp src/mailing_info.cpp src/report_generator.cpp src/file_names.cpp src/lists.cpp diff --git a/bin/build_pgms.bat b/bin/build_pgms.bat index 24e347d..5d1a707 100644 --- a/bin/build_pgms.bat +++ b/bin/build_pgms.bat @@ -1,5 +1,5 @@ echo "Use -m32 switch to force 32-bit build" -g++ %* -std=c++11 -DNDEBUG -O2 -o bin/lists.exe src/date.cpp src/issues.cpp src/sections.cpp src/mailing_info.cpp src/report_generator.cpp src/lists.cpp +g++ %* -std=c++11 -DNDEBUG -O2 -o bin/lists.exe src/date.cpp src/issues.cpp src/sections.cpp src/mailing_info.cpp src/report_generator.cpp src/file_names.cpp src/lists.cpp g++ %* -std=c++11 -o bin/section_data.exe src/section_data.cpp g++ %* -std=c++11 -o bin/toc_diff.exe src/toc_diff.cpp g++ %* -std=c++11 -DNDEBUG -O2 -o bin/list_issues.exe src/date.cpp src/issues.cpp src/sections.cpp src/list_issues.cpp diff --git a/bin/build_pgms.sh b/bin/build_pgms.sh index 5ce5968..4758a60 100755 --- a/bin/build_pgms.sh +++ b/bin/build_pgms.sh @@ -1,6 +1,6 @@ #!/bin/sh echo '"Use -m32 switch to force 32-bit build"' -g++ $* -std=c++11 -DNDEBUG -O2 -o bin/lists src/date.cpp src/issues.cpp src/sections.cpp src/mailing_info.cpp src/report_generator.cpp src/lists.cpp +g++ $* -std=c++11 -DNDEBUG -O2 -o bin/lists src/date.cpp src/issues.cpp src/sections.cpp src/mailing_info.cpp src/report_generator.cpp src/file_names.cpp src/lists.cpp g++ $* -std=c++11 -o bin/section_data src/section_data.cpp g++ $* -std=c++11 -o bin/toc_diff src/toc_diff.cpp g++ $* -std=c++11 -DNDEBUG -O2 -o bin/list_issues src/date.cpp src/issues.cpp src/sections.cpp src/list_issues.cpp diff --git a/getting-started.html b/getting-started.html new file mode 100644 index 0000000..91658a6 --- /dev/null +++ b/getting-started.html @@ -0,0 +1,93 @@ + + + + + + + +Codestin Search App + + + + +

Getting Started with Library Issues List Software

+

This software builds HTML issues lists from XML files. Tables of +contents and index files are also created, also formatted in HTML. There is one input +XML +file for each issue. The file config.xml provides configuration +attributes and text that tailors the output so that the same software works for +the C++ Standard Library itself and also the various library Technical Specifications. It +may also be useful for tracking issues for non-library documents, but most +current use is with library related issues.

+

The code is written in C++ and requires a C++ 14 compiler and library. It is +works on Linux, OS X, and Windows.

+

The source code should not require changes to be set up for a new IS or TS +document. Please contact the maintainers if you need help.

+

Prerequisites

+

Prerequisites for either setting up a new list or maintaining an existing +list:

+ +

Repository organization and workflow

+

A public Git +repository for the software is maintained on the C++ committee's +GitHub account.

+

The +Git Flow +model for repository workflow is at least roughly followed because it works well +and is familiar to many developers. Because this is a simple project, only the +master and develop branches are always active. +Feature branches are used when new features are under development.

+ +

Installation

+ +

POSIX

+
+
cd some-directory
+git clone git@github.com:cplusplus/lib-issues-software.git
+cd lib-issues-software
+bin/build_pgms.sh
+
+

Windows

+
+
cd some-directory
+git clone git@github.com:cplusplus/lib-issues-software.git
+cd lib-issues-software
+bin\build_pgms
+
+

These instructions assume you prefer to interact with GitHub via +SSH.  You can also use https://github.com/cplusplus/lib-issues-software.git +as the URL in the instructions above; this may work better if you are behind a +firewall.

+ +

Directory structure

+

 

+

Setup for a new issues list

+ +

Setup to maintain an existing list

+

 

+ +

history

+ +

Howard Hinnant was the original author. The current maintainer is +Alisdair Meredith, backed up by Beman Dawes and Daniel Krügler.

+ +
+

Revised: +19 March 2014

+

 

+ + + + \ No newline at end of file diff --git a/how-to-docs.html b/how-to-docs.html index 25c5e36..9b3d553 100644 --- a/how-to-docs.html +++ b/how-to-docs.html @@ -10,10 +10,14 @@ -

Revised: -20 May 2013

+

Revised: +19 March 2014

How To Instructions

+ +

Warning: These instructions were originally written for the Standard +Library issues list without any consideration of using the software for other +lists. They have not yet been updated to cover other uses.

These instruction assume you going to keep the issues lists source files in a directory named "issues", and the issues lists generated HTML files in a directory named "issues-gh-pages".

@@ -23,32 +27,34 @@

How To Instructions

Prerequisites

- -

Initial setup

+

Follow the Getting Started with Library Issues List Software +installation instructions. Install the +Prequisites given there first +if necessary and set up the GitHub public repository.

+ +

Working copy setup

Do this once only:

-
cd path-to-where-you-want-to-keep-this-stuff
+
POSIX and Windows:
+cd some-directory
 git clone git@github.com:cplusplus/LWG.git issues
 git clone -b gh-pages git@github.com:cplusplus/LWG.git issues-gh-pages
 cd issues
-mkdir mailing
-
+mkdir mailing -

Build issues software

-

Do this after the initial setup, and then again whenever the source -code (in issues/src) changes.

-
-
cd issues
-bin\build_pgms
+Windows: +mklink /d bin path\library-issues-software\bin + +POSIX: +ln path/library-issues-software/bin bin
+

The final instruction creates a symlink bin to the directory +containing the issues list software. An alternative would be to add that +directory to your path, but the names are fairly generic so that might well +result in unwelcome name clashes.

+

Add or change issues

There is one source file per issue, in issues/xml. The file issues/xml/lwg-template.xml can be used as a template to start a @@ -192,4 +198,4 @@

Publish Issues Lists for a Mailing

  • Notify any collaborators to pull the updated master branch - the main list is open for business again
  • -
      +
      \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..43d464d --- /dev/null +++ b/index.html @@ -0,0 +1,24 @@ + + + + + + + +Codestin Search App + + + + +

    Library Issues List Software Documentation

    +

    Getting Started gives an overview and +instructions for setting up a new issues list.

    +

    Usage Instructions explain how to maintain an +existing issues list.

    +
    +

    Revised: +19 March 2014

    + + + + diff --git a/src/file_names.cpp b/src/file_names.cpp new file mode 100644 index 0000000..9a681fd --- /dev/null +++ b/src/file_names.cpp @@ -0,0 +1,29 @@ +#include "file_names.h" + +namespace lwg { + file_names::file_names(lwg::mailing_info const& config) + { + _active = config.get_attribute("active_name"); + _closed = config.get_attribute("closed_name"); + _defects = config.get_attribute("defects_name"); + _toc = config.get_attribute("toc_name"); + _old_toc = config.get_attribute("old_toc_name"); + _status_index = config.get_attribute("status_index_name"); // not "index_name") to avoid name clash + _status_date_index = config.get_attribute("status_date_index_name"); + _section_index = config.get_attribute("section_index_name"); + _unresolved_toc = config.get_attribute("unresolved_toc_name"); + _unresolved_status_index = config.get_attribute("unresolved_status_index_name"); + _unresolved_status_date_index = config.get_attribute("unresolved_status_date_index_name"); + _unresolved_section_index = config.get_attribute("unresolved_section_index_name"); + _unresolved_prioritized_index = config.get_attribute("unresolved_prioritized_index_name"); + _votable_toc = config.get_attribute("votable_toc_name"); + _votable_status_index = config.get_attribute("votable_status_index_name"); + _votable_status_date_index = config.get_attribute("votable_status_date_index_name"); + _votable_section_index = config.get_attribute("votable_section_index_name"); + _open_index = config.get_attribute("open_index_name"); + _tentative = config.get_attribute("tentative_name"); + _unresolved = config.get_attribute("unresolved_name"); + _immediate = config.get_attribute("immediate_name"); + _issues_for_editor = config.get_attribute("issues_for_editor_name"); + } +} diff --git a/src/file_names.h b/src/file_names.h new file mode 100644 index 0000000..63c06b9 --- /dev/null +++ b/src/file_names.h @@ -0,0 +1,60 @@ +#ifndef INCLUDE_FILE_NAMES_H +#define INCLUDE_FILE_NAMES_H + +#include +#include "mailing_info.h" + +namespace lwg { + + class file_names { + public: + file_names(lwg::mailing_info const& config); + auto active_name() const -> const std::string& {return _active;} + auto closed_name() const -> const std::string& {return _closed;} + auto defects_name() const -> const std::string& {return _defects;} + auto toc_name() const -> const std::string& {return _toc;} + auto old_toc_name() const -> const std::string& {return _old_toc;} + auto status_index_name() const -> const std::string& {return _status_index;} + auto status_date_index_name() const -> const std::string& {return _status_date_index;} + auto section_index_name() const -> const std::string& {return _section_index;} + auto unresolved_toc_name() const -> const std::string& {return _unresolved_toc;} + auto unresolved_status_index_name() const -> const std::string& {return _unresolved_status_index;} + auto unresolved_status_date_index_name() const -> const std::string& {return _unresolved_status_date_index;} + auto unresolved_section_index_name() const -> const std::string& {return _unresolved_section_index;} + auto unresolved_prioritized_index_name() const -> const std::string& {return _unresolved_prioritized_index;} + auto votable_toc_name() const -> const std::string& {return _votable_toc;} + auto votable_status_index_name() const -> const std::string& {return _votable_status_index;} + auto votable_status_date_index_name() const -> const std::string& {return _votable_status_date_index;} + auto votable_section_index_name() const -> const std::string& {return _votable_section_index;} + auto open_index_name() const -> const std::string& {return _open_index ;} + auto tentative_name() const -> const std::string& {return _tentative;} + auto unresolved_name() const -> const std::string& {return _unresolved;} + auto immediate_name() const -> const std::string& {return _immediate;} + auto issues_for_editor_name() const -> const std::string& {return _issues_for_editor;} + private: + std::string _active; + std::string _closed; + std::string _defects; + std::string _toc; + std::string _old_toc; + std::string _status_index; + std::string _status_date_index; + std::string _section_index; + std::string _unresolved_toc; + std::string _unresolved_status_index; + std::string _unresolved_status_date_index; + std::string _unresolved_section_index; + std::string _unresolved_prioritized_index; + std::string _votable_toc; + std::string _votable_status_index; + std::string _votable_status_date_index; + std::string _votable_section_index; + std::string _open_index; + std::string _tentative; + std::string _unresolved; + std::string _immediate; + std::string _issues_for_editor; + }; +} // namespace lwg + +#endif // INCLUDE_FILE_NAMES_H diff --git a/src/issues.cpp b/src/issues.cpp index 3ac07e4..7653a11 100644 --- a/src/issues.cpp +++ b/src/issues.cpp @@ -15,9 +15,9 @@ #include // plan to factor this dependency out namespace { -static constexpr char const * LWG_ACTIVE {"lwg-active.html" }; -static constexpr char const * LWG_CLOSED {"lwg-closed.html" }; -static constexpr char const * LWG_DEFECTS{"lwg-defects.html"}; + char const * LWG_ACTIVE; + char const * LWG_CLOSED; + char const * LWG_DEFECTS; // date utilites may factor out again auto parse_month(std::string const & m) -> gregorian::month { @@ -68,6 +68,12 @@ auto report_date_file_last_modified(std::string const & filename) -> gregorian:: } // close unnamed namespace +void lwg::initialize_issues(file_names const & names) { + LWG_ACTIVE = names.active_name().c_str(); + LWG_CLOSED = names.closed_name().c_str(); + LWG_DEFECTS = names.defects_name().c_str(); +} + // functions to relate the status of an issue to its relevant published list document auto lwg::filename_for_status(std::string stat) -> std::string { // Tentative issues are always active diff --git a/src/issues.h b/src/issues.h index 0c43475..e81ecc8 100644 --- a/src/issues.h +++ b/src/issues.h @@ -9,10 +9,13 @@ // solution specific headers #include "date.h" +#include "file_names.h" namespace lwg { +void initialize_issues(file_names const & names); + using section_tag = std::string; struct issue { diff --git a/src/list_issues.cpp b/src/list_issues.cpp index a865346..0e721e9 100644 --- a/src/list_issues.cpp +++ b/src/list_issues.cpp @@ -1,5 +1,5 @@ // This program reads all the issues in the issues directory passed as the first command line argument. -// If all documents are successfully parsed, it will generate the standard LWG Issues List documents +// If all documents are successfully parsed, it will generate the standard Issues List documents // for an ISO SC22 WG21 mailing. // Based on code originally donated by Howard Hinnant @@ -110,7 +110,7 @@ auto read_file_into_string(std::string const & filename) -> std::string { void filter_issues(std::string const & issues_path, lwg::section_map & section_db, std::function predicate) { // Open the specified directory, 'issues_path', and iterate all the '.xml' files - // it contains, parsing each such file as an LWG issue document. Write to 'out' + // it contains, parsing each such file as an issue document. Write to 'out' // the number of every issue that satisfies the 'predicate'. // // The current implementation relies directly on POSIX headers, but the preferred diff --git a/src/lists.cpp b/src/lists.cpp index d6b5d29..5275cef 100644 --- a/src/lists.cpp +++ b/src/lists.cpp @@ -1,5 +1,5 @@ // This program reads all the issues in the issues directory passed as the first command line argument. -// If all documents are successfully parsed, it will generate the standard LWG Issues List documents +// If all documents are successfully parsed, it will generate the standard Issues List documents // for an ISO SC22 WG21 mailing. // Based on code originally donated by Howard Hinnant @@ -33,7 +33,7 @@ // string_view // Its coding style assumes a standard library optimized with move-semantics -// The only known compiler to support all of this today is the experimental gcc trunk (4.6) +// The only known compiler to support all of this today is the experimental gcc trunk (4.9) // TODO // . Better handling of TR "sections", and grouping of issues in "Clause X" @@ -82,6 +82,7 @@ #include "mailing_info.h" #include "report_generator.h" #include "sections.h" +#include "file_names.h" #if 0 @@ -110,7 +111,8 @@ auto read_file_into_string(std::string const & filename) -> std::string { if (!infile.is_open()) { throw std::runtime_error{"Unable to open file " + filename}; } - + // TODO: turn the next line on via command line option: + //else std::cout << "Reading file " + filename << std::endl; std::istreambuf_iterator first{infile}, last{}; return std::string {first, last}; } @@ -120,7 +122,7 @@ auto read_file_into_string(std::string const & filename) -> std::string { auto read_issues(std::string const & issues_path, lwg::section_map & section_db) -> std::vector { // Open the specified directory, 'issues_path', and iterate all the '.xml' files - // it contains, parsing each such file as an LWG issue document. Return the set + // it contains, parsing each such file as an issue document. Return the set // of issues as a vector. // // The current implementation relies directly on POSIX headers, but the preferred @@ -679,7 +681,7 @@ void check_is_directory(std::string const & directory) { int main(int argc, char* argv[]) { try { std::string path; - std::cout << "Preparing new LWG issues lists..." << std::endl; + std::cout << "Preparing new issues lists..." << std::endl; if (argc == 2) { path = argv[1]; } @@ -718,13 +720,11 @@ int main(int argc, char* argv[]) { std::cout << temp << ' ' << elem.second << '\n'; } #endif - - auto const old_issues = read_issues_from_toc(read_file_into_string(path + "meta-data/lwg-toc.old.html")); auto const issues_path = path + "xml/"; - lwg::mailing_info lwg_issues_xml = [&issues_path](){ - std::string filename{issues_path + "lwg-issues.xml"}; + lwg::mailing_info config = [&issues_path](){ + std::string filename{issues_path + "config.xml"}; std::ifstream infile{filename}; if (!infile.is_open()) { throw std::runtime_error{"Unable to open " + filename}; @@ -733,15 +733,20 @@ int main(int argc, char* argv[]) { return lwg::mailing_info{infile}; }(); - //lwg::mailing_info lwg_issues_xml{issues_path}; + //lwg::mailing_info config{issues_path}; + lwg::file_names names(config); + lwg::initialize_issues(names); + + auto const old_issues = read_issues_from_toc(read_file_into_string( + path + "meta-data/" + names.old_toc_name())); std::cout << "Reading issues from: " << issues_path << std::endl; auto issues = read_issues(issues_path, section_db); prepare_issues(issues, section_db); - lwg::report_generator generator{lwg_issues_xml, section_db}; + lwg::report_generator generator{config, section_db, names}; // issues must be sorted by number before making the mailing list documents @@ -783,32 +788,32 @@ int main(int argc, char* argv[]) { // Now we have a parsed and formatted set of issues, we can write the standard set of HTML documents // Note that each of these functions is going to re-sort the 'issues' vector for its own purposes - generator.make_sort_by_num (issues, {target_path + "lwg-toc.html"}); - generator.make_sort_by_status (issues, {target_path + "lwg-status.html"}); - generator.make_sort_by_status_mod_date(issues, {target_path + "lwg-status-date.html"}); // this report is useless, as git checkouts touch filestamps - generator.make_sort_by_section (issues, {target_path + "lwg-index.html"}); + generator.make_sort_by_num (issues, {target_path + names.toc_name()}); + generator.make_sort_by_status (issues, {target_path + names.status_index_name()}); + generator.make_sort_by_status_mod_date(issues, {target_path + names.status_date_index_name()}); // this report is useless, as git checkouts touch filestamps + generator.make_sort_by_section (issues, {target_path + names.section_index_name()}); - // Note that this additional document is very similar to unresolved-index.html below - generator.make_sort_by_section (issues, {target_path + "lwg-index-open.html"}, true); + // Note that this additional document is very similar to unresolved-section-index below + generator.make_sort_by_section (issues, {target_path + names.open_index_name()}, true); // Make a similar set of index documents for the issues that are 'live' during a meeting - // Note that these documents want to reference each other, rather than lwg- equivalents, + // Note that these documents want to reference each other, rather than unfiltered equivalents, // although it may not be worth attempting fix-ups as the per-issue level // During meetings, it would be good to list newly-Ready issues here - generator.make_sort_by_num (unresolved_issues, {target_path + "unresolved-toc.html"}); - generator.make_sort_by_status (unresolved_issues, {target_path + "unresolved-status.html"}); - generator.make_sort_by_status_mod_date(unresolved_issues, {target_path + "unresolved-status-date.html"}); - generator.make_sort_by_section (unresolved_issues, {target_path + "unresolved-index.html"}); - generator.make_sort_by_priority (unresolved_issues, {target_path + "unresolved-prioritized.html"}); + generator.make_sort_by_num (unresolved_issues, {target_path + names.unresolved_toc_name()}); + generator.make_sort_by_status (unresolved_issues, {target_path + names.unresolved_status_index_name()}); + generator.make_sort_by_status_mod_date(unresolved_issues, {target_path + names.unresolved_status_date_index_name()}); + generator.make_sort_by_section (unresolved_issues, {target_path + names.unresolved_section_index_name()}); + generator.make_sort_by_priority (unresolved_issues, {target_path + names.unresolved_prioritized_index_name()}); // Make another set of index documents for the issues that are up for a vote during a meeting - // Note that these documents want to reference each other, rather than lwg- equivalents, + // Note that these documents want to reference each other, rather than unfiltered equivalents, // although it may not be worth attempting fix-ups as the per-issue level // Between meetings, it would be good to list Ready issues here - generator.make_sort_by_num (votable_issues, {target_path + "votable-toc.html"}); - generator.make_sort_by_status (votable_issues, {target_path + "votable-status.html"}); - generator.make_sort_by_status_mod_date(votable_issues, {target_path + "votable-status-date.html"}); - generator.make_sort_by_section (votable_issues, {target_path + "votable-index.html"}); + generator.make_sort_by_num (votable_issues, {target_path + names.votable_toc_name()}); + generator.make_sort_by_status (votable_issues, {target_path + names.votable_status_index_name()}); + generator.make_sort_by_status_mod_date(votable_issues, {target_path + names.votable_status_date_index_name()}); + generator.make_sort_by_section (votable_issues, {target_path + names.votable_section_index_name()}); std::cout << "Made all documents\n"; } diff --git a/src/mailing_info.cpp b/src/mailing_info.cpp index f93fba2..108bf92 100644 --- a/src/mailing_info.cpp +++ b/src/mailing_info.cpp @@ -5,6 +5,7 @@ #include #include #include +#include namespace { @@ -12,7 +13,7 @@ void replace_all_irefs(std::vector const & issues, std::string & s) // Replace all tagged "issues references" in string 's' with an HTML anchor-link to the live issue // in its appropriate issue list, as determined by the issue's status. // Format of an issue reference: - // Format of anchor: ISS + // Format of anchor: ISS for (auto i = s.find("', i); @@ -73,7 +74,27 @@ namespace lwg mailing_info::mailing_info(std::istream & stream) : m_data{std::istreambuf_iterator{stream}, std::istreambuf_iterator{}} - { +{ + // replace all text in the form: + // + // with the attribute-value for that attribute-name + + std::string::size_type first, last, pos = 0; + while ((first = m_data.find("", first + 10); + if (last == std::string::npos) + { + std::string msg{std::string{"error in config.xml: failed to find close for: "} + + m_data.substr(first, first + 32).c_str() + "... "}; + throw std::runtime_error{msg.c_str()}; + return; + } + //std::cout << "***attribute-name is " << m_data.substr(first+10, last-(first+10)) << std::endl; + //std::cout << " attribute-value is " << get_attribute(m_data.substr(first+10, last-(first+10))) << std::endl; + m_data.replace(first, last+3-first, get_attribute(m_data.substr(first+10, last-(first+10)))); + pos = last; + } } auto mailing_info::get_doc_number(std::string doc) const -> std::string { @@ -93,6 +114,16 @@ auto mailing_info::get_doc_number(std::string doc) const -> std::string { return get_attribute(doc); } +auto mailing_info::get_doc_name() const -> std::string +{ + return get_attribute("doc_name"); +} + +auto mailing_info::get_doc_reference() const -> std::string +{ + return get_attribute("doc_reference"); +} + auto mailing_info::get_intro(std::string doc) const -> std::string { if (doc == "active") { doc = ""; @@ -109,12 +140,12 @@ auto mailing_info::get_intro(std::string doc) const -> std::string { auto i = m_data.find(doc); if (i == std::string::npos) { - throw std::runtime_error{"Unable to find intro in lwg-issues.xml"}; + throw std::runtime_error{"Unable to find intro in config.xml"}; } i += doc.size(); auto j = m_data.find("", i); if (j == std::string::npos) { - throw std::runtime_error{"Unable to parse intro in lwg-issues.xml"}; + throw std::runtime_error{"Unable to parse intro in config.xml"}; } return m_data.substr(i, j-i); } @@ -124,12 +155,12 @@ auto mailing_info::get_maintainer() const -> std::string { std::string r = get_attribute("maintainer"); auto m = r.find("<"); if (m == std::string::npos) { - throw std::runtime_error{"Unable to parse maintainer email address in lwg-issues.xml"}; + throw std::runtime_error{"Unable to parse maintainer email address in config.xml"}; } m += sizeof("<") - 1; auto me = r.find(">", m); if (me == std::string::npos) { - throw std::runtime_error{"Unable to parse maintainer email address in lwg-issues.xml"}; + throw std::runtime_error{"Unable to parse maintainer email address in config.xml"}; } std::string email = r.substr(m, me-m); // < lwgchair@gmail.com > @@ -146,13 +177,13 @@ auto mailing_info::get_revision() const -> std::string { auto mailing_info::get_revisions(std::vector const & issues, std::string const & diff_report) const -> std::string { auto i = m_data.find(""); if (i == std::string::npos) { - throw std::runtime_error{"Unable to find in lwg-issues.xml"}; + throw std::runtime_error{"Unable to find in config.xml"}; } i += sizeof("") - 1; auto j = m_data.find("", i); if (j == std::string::npos) { - throw std::runtime_error{"Unable to find in lwg-issues.xml"}; + throw std::runtime_error{"Unable to find in config.xml"}; } auto s = m_data.substr(i, j-i); j = 0; @@ -193,13 +224,13 @@ auto mailing_info::get_revisions(std::vector const & issues, std::string auto mailing_info::get_statuses() const -> std::string { auto i = m_data.find(""); if (i == std::string::npos) { - throw std::runtime_error{"Unable to find statuses in lwg-issues.xml"}; + throw std::runtime_error{"Unable to find statuses in config.xml"}; } i += sizeof("") - 1; auto j = m_data.find("", i); if (j == std::string::npos) { - throw std::runtime_error{"Unable to parse statuses in lwg-issues.xml"}; + throw std::runtime_error{"Unable to parse statuses in config.xml"}; } return m_data.substr(i, j-i); } @@ -209,12 +240,12 @@ auto mailing_info::get_attribute(std::string const & attribute_name) const -> st std::string search_string{attribute_name + "=\""}; auto i = m_data.find(search_string); if (i == std::string::npos) { - throw std::runtime_error{"Unable to find " + attribute_name + " in lwg-issues.xml"}; + throw std::runtime_error{"Unable to find " + attribute_name + " in config.xml"}; } i += search_string.size(); auto j = m_data.find('\"', i); if (j == std::string::npos) { - throw std::runtime_error{"Unable to parse " + attribute_name + " in lwg-issues.xml"}; + throw std::runtime_error{"Unable to parse " + attribute_name + " in config.xml"}; } return m_data.substr(i, j-i); } diff --git a/src/mailing_info.h b/src/mailing_info.h index 54342c9..f68afbc 100644 --- a/src/mailing_info.h +++ b/src/mailing_info.h @@ -19,13 +19,15 @@ struct mailing_info { auto get_revision() const -> std::string; auto get_revisions(std::vector const & issues, std::string const & diff_report) const -> std::string; auto get_statuses() const -> std::string; + auto get_doc_name() const -> std::string; // Examples: "C++ Standard Library" or "File System Technical Specification" + auto get_doc_reference() const -> std::string; // Examples: "ISO/IEC IS 14882:2011(E)" or "ISO/IEC TS 18822" -private: auto get_attribute(std::string const & attribute_name) const -> std::string; // Return the value of the first xml attibute having the specified 'attribute_name' // in the stored XML string, 'm_data', without regard to which element holds that // attribute. +private: std::string m_data; // 'm_data' is reparsed too many times in practice, and memory use is not a major concern. // Should cache each of the reproducible calls in additional member strings, either at diff --git a/src/report_generator.cpp b/src/report_generator.cpp index 69e36de..8d69609 100644 --- a/src/report_generator.cpp +++ b/src/report_generator.cpp @@ -126,9 +126,9 @@ auto major_section(lwg::section_num const & sn) -> std::string { } auto remove_square_brackets(lwg::section_tag const & tag) -> lwg::section_tag { - assert(tag.size() > 2); - assert(tag.front() == '['); - assert(tag.back() == ']'); + //assert(tag.size() > 2); + //assert(tag.front() == '['); + //assert(tag.back() == ']'); return tag.substr(1, tag.size()-2); } @@ -154,14 +154,21 @@ void print_list(std::ostream & out, Container const & source, char const * separ void print_file_header(std::ostream& out, std::string const & title) { out << + + // removed : p {text-align:justify} + // li{text-align:justify} + // I have no idea what the rationale for those was, but they badly + // mess up spacing of issues list Discussions and P/R's that have long + // ... sequencess with no spaces. + // --Beman + R"( + Codestin Search App