MCPcopy Create free account
hub / github.com/YACReader/yacreader / tryValues

Function tryValues

YACReaderLibrary/xml_info_parser.cpp:67–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67bool tryValues(QXmlStreamReader &reader, ComicInfo &info)
68{
69 std::map<QString, QVariant &> stringValues = {
70 { "Number", info.number },
71 { "Title", info.title },
72 { "Volume", info.volume },
73 { "StoryArc", info.storyArc },
74 { "Genre", info.genere },
75 { "Publisher", info.publisher },
76 { "Format", info.format },
77 { "AgeRating", info.ageRating },
78 { "Summary", info.synopsis },
79 { "Notes", info.notes },
80 { "Editor", info.editor },
81 { "Imprint", info.imprint },
82 { "Series", info.series },
83 { "AlternateSeries", info.alternateSeries },
84 { "AlternateNumber", info.alternateNumber },
85 { "LanguageISO", info.languageISO },
86 { "SeriesGroup", info.seriesGroup },
87 { "MainCharacterOrTeam", info.mainCharacterOrTeam },
88 { "Review", info.review },
89 };
90
91 std::map<QString, QVariant &> forcedNumbers = {
92 { "Count", info.count },
93 { "AlternateCount", info.alternateCount },
94 { "Day", info.day },
95 { "Month", info.month },
96 { "Year", info.year },
97 };
98
99 std::map<QString, QVariant &> multiValuedStrings = {
100 { "Writer", info.writer },
101 { "Penciller", info.penciller },
102 { "Inker", info.inker },
103 { "Colorist", info.colorist },
104 { "Letterer", info.letterer },
105 { "CoverArtist", info.coverArtist },
106 { "Characters", info.characters },
107 { "Teams", info.teams },
108 { "Locations", info.locations }
109 };
110
111 for (auto &pair : stringValues) {
112 if (parseField(reader, pair.first, pair.second)) {
113 return true;
114 }
115 }
116
117 for (auto &pair : forcedNumbers) {
118 if (parseFieldNumber(reader, pair.first, pair.second)) {
119 return true;
120 }
121 }
122
123 for (auto &pair : multiValuedStrings) {
124 if (parseField(reader, pair.first, pair.second, true)) {

Callers 1

parseXMLIntoInfoMethod · 0.85

Calls 7

parseFieldFunction · 0.85
parseFieldNumberFunction · 0.85
isValidTextFunction · 0.85
replaceMethod · 0.80
splitMethod · 0.80
QStringClass · 0.70
nameMethod · 0.45

Tested by

no test coverage detected