• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ParadoxGameConverters / Vic3ToHoI4 / 33332375723

30 Aug 2026 07:59PM UTC coverage: 92.418% (-0.05%) from 92.469%
33332375723

push

github

web-flow
Add more clang-tidy rules (#835)

* Speed up clang-tidy

* Update workflow

* Add new rules

* Add helper for fix

* Formatting

* Fixes from tests

* Remove prepare step from workflow

* Revert change

1478 of 1515 new or added lines in 240 files covered. (97.56%)

1 existing line in 1 file now uncovered.

26791 of 28989 relevant lines covered (92.42%)

54666.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

82.0
/src/vic3_world/database/database_parser.cpp
1
#include "src/vic3_world/database/database_parser.h"
2

3
#include <external/commonItems/CommonRegexes.h>
4
#include <external/commonItems/ParserHelpers.h>
5

6

7

8
namespace vic3
9
{
10

NEW
11
DatabaseParser::DatabaseParser()
×
12
{
13
   this->db_entry_parser_.registerRegex(commonItems::integerRegex,
×
14
       []([[maybe_unused]] const std::string& key, [[maybe_unused]] std::istream& stream) {
×
15
          return;
×
16
       });
17
   this->db_entry_parser_.IgnoreUnregisteredItems();
×
18
   this->registerKeyword("database", db_entry_parser_);
×
19
   this->IgnoreAndLogUnregisteredItems();
×
20
}
×
21

22
void SkipSpaces(std::istream& stream)
83✔
23
{
24
   while (stream.peek() == ' ')
83✔
25
   {
26
      stream.get();
×
27
   }
28
}
83✔
29

30
DatabaseParser::DatabaseParser(commonItems::parsingFunctionStreamOnly single_element_func)
17✔
31

32
{
33
   this->db_entry_parser_.registerRegex(commonItems::integerRegex,
51✔
34
       [single_element_func](std::string key, std::istream& stream) {
34✔
35
          // i have a mouth and i must scream
36
          SkipSpaces(stream);
36✔
37
          const auto next = static_cast<char>(stream.get());
36✔
38
          const auto next_next = static_cast<char>(stream.peek());
36✔
39
          if (next_next == ' ')
36✔
40
          {
41
             stream.get();
20✔
42
          }
43
          if (stream.peek() == '{')
36✔
44
          {
45
             if (next_next == ' ')
31✔
46
             {
47
                stream.putback(next_next);
16✔
48
             }
49
             stream.putback(next);
31✔
50
             single_element_func(stream);
31✔
51
          }
52
          else
53
          {
54
             commonItems::ignoreItem(key, stream);
5✔
55
          }
56
       });
36✔
57
   this->db_entry_parser_.IgnoreAndLogUnregisteredItems();
17✔
58

59
   this->registerKeyword("database", this->db_entry_parser_);
51✔
60
   this->IgnoreAndLogUnregisteredItems();
17✔
61
}
17✔
62

63
DatabaseParser::DatabaseParser(commonItems::parsingFunction multi_element_func)
26✔
64

65
{
66
   this->db_entry_parser_.registerRegex(commonItems::integerRegex,
78✔
67
       [multi_element_func](std::string key, std::istream& stream) {
52✔
68
          // i have a mouth and i must scream
69
          SkipSpaces(stream);
47✔
70
          const auto next = static_cast<char>(stream.get());
47✔
71
          const auto next_next = static_cast<char>(stream.peek());
47✔
72
          if (next_next == ' ')
47✔
73
          {
74
             stream.get();
19✔
75
          }
76
          if (stream.peek() == '{')
47✔
77
          {
78
             if (next_next == ' ')
45✔
79
             {
80
                stream.putback(next_next);
19✔
81
             }
82
             stream.putback(next);
45✔
83
             multi_element_func(key, stream);
45✔
84
          }
85
          else
86
          {
87
             commonItems::ignoreItem(key, stream);
2✔
88
          }
89
       });
47✔
90
   this->db_entry_parser_.IgnoreAndLogUnregisteredItems();
26✔
91

92
   this->registerKeyword("database", this->db_entry_parser_);
78✔
93
   this->IgnoreAndLogUnregisteredItems();
26✔
94
}
26✔
95
}  // namespace vic3
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc