forked from cplusplus/LWG
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathissues.h
More file actions
65 lines (56 loc) · 2.43 KB
/
issues.h
File metadata and controls
65 lines (56 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef INCLUDE_LWG_ISSUES_H
#define INCLUDE_LWG_ISSUES_H
// standard headers
#include <chrono>
#include <map>
#include <set>
#include <string>
#include <vector>
// solution specific headers
#include "metadata.h"
#include "status.h"
namespace lwg
{
namespace chrono = std::chrono;
struct issue {
int num; // ID - issue number
std::string stat; // current status of the issue
std::string title; // descriptive title for the issue
std::string doc_prefix; // extracted from title; e.g. filesys.ts
std::vector<section_tag> tags; // section(s) of the standard affected by the issue
std::string submitter; // original submitter of the issue
chrono::year_month_day date; // date the issue was filed
chrono::year_month_day mod_date; // date the issue was last changed
std::set<std::string> duplicates; // sorted list of duplicate issues, stored as html anchor references.
std::string text; // text representing the issue
int priority = 99; // severity, 1 = critical, 4 = minor concern, 0 = trivial to resolve, 99 = not yet prioritised
std::string owner; // person identified as taking ownership of drafting/progressing the issue
std::string resolution; // extracted resolution text (if any), also present in 'text'
bool has_resolution; // 'true' if 'text' contains a proposed resolution
};
auto parse_issue_from_file(std::string file_contents, std::string const & filename, lwg::metadata & meta) -> issue;
// Seems appropriate constructor behavior.
//
// Note that 'section_db' is modifiable as new (unknown) sections may be inserted,
// typically for issues reported against older documents with sections that have
// since been removed, replaced or merged.
//
// The filename is passed only to improve diagnostics.
inline int stoi(const std::string& s)
{
std::size_t idx = 0;
try
{
return std::stoi(s, &idx);
}
catch (const std::out_of_range&)
{
throw std::out_of_range("std::stoi: out of range: \"" + s + '"');
}
catch (const std::invalid_argument&)
{
throw std::invalid_argument("std::stoi: invalid argument: \"" + s + '"');
}
}
} // close namespace lwg
#endif // INCLUDE_LWG_ISSUES_H