std::string contents()

in platforms/Windows/CustomActions/SwiftInstaller/Sources/swift_installer.cc [38:45]


std::string contents(const std::filesystem::path &path) noexcept {
  std::ostringstream buffer;
  std::ifstream stream(path);
  if (!stream)
    return {};
  buffer << stream.rdbuf();
  return buffer.str();
}