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

openmc-dev / openmc / 14260484407

04 Apr 2025 07:41AM UTC coverage: 84.589% (-0.3%) from 84.851%
14260484407

Pull #3279

github

web-flow
Merge 33e03305e into 07f533461
Pull Request #3279: Hexagonal mesh model

2 of 332 new or added lines in 3 files covered. (0.6%)

2798 existing lines in 84 files now uncovered.

51799 of 61236 relevant lines covered (84.59%)

38650400.15 hits per line

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

95.65
/src/file_utils.cpp
1
#include "openmc/file_utils.h"
2

3
#include <filesystem>
4

5
namespace openmc {
6

7
bool dir_exists(const std::string& path)
279✔
8
{
9
  std::filesystem::path d(path);
279✔
10
  return std::filesystem::is_directory(d);
558✔
11
}
279✔
12

13
bool file_exists(const std::string& filename)
4,868,948✔
14
{
15
  std::filesystem::path p(filename);
4,868,948✔
16
  if (!std::filesystem::exists(p)) {
4,868,948✔
17
    return false;
33,580✔
18
  }
19
  if (std::filesystem::is_directory(p)) {
4,835,368✔
UNCOV
20
    return false;
×
21
  }
22
  return true;
4,835,368✔
23
}
4,868,948✔
24

25
std::string dir_name(const std::string& filename)
78✔
26
{
27
  std::filesystem::path p(filename);
78✔
28
  return (p.parent_path()).string();
234✔
29
}
78✔
30

31
std::string get_file_extension(const std::string& filename)
7,663✔
32
{
33
  std::filesystem::path p(filename);
7,663✔
34
  auto ext = p.extension();
7,663✔
35
  if (!ext.empty()) {
7,663✔
36
    // path::extension includes the period
37
    return ext.string().substr(1);
15,260✔
38
  }
39
  return "";
33✔
40
}
7,663✔
41

42
} // namespace openmc
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc