Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Galarius committed Aug 23, 2023
1 parent 956e04c commit 45e709d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions include/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <algorithm>
#include <array>
#include <cstdint>
#include <memory>
#include <numeric>
#include <optional>
#include <string>
Expand Down Expand Up @@ -52,11 +53,11 @@ inline std::string FormatBool(bool flag)

// --- File Helpers ---

std::string UriToFilePath(const std::string& uri, bool unix);
std::string UriToFilePath(const std::string& uri, bool isUnix);

std::string UriToFilePath(const std::string& uri);

std::optional<std::string> ReadFileContent(std::string_view fileName);
std::optional<std::string> ReadFileContent(const std::string& fileName);

// --- CRC32 ---

Expand Down
6 changes: 3 additions & 3 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ bool EndsWith(const std::string& str, const std::string& suffix)

// --- File Helpers ---

std::string UriToFilePath(const std::string& uri, bool unix)
std::string UriToFilePath(const std::string& uri, bool isUnix)
{
const size_t bytesNeeded = 8 + 3 * uri.length() + 1;
char* fileName = (char*)malloc(bytesNeeded * sizeof(char));
if (unix)
if (isUnix)
{
if (uriUriStringToUnixFilenameA(uri.c_str(), fileName) != URI_SUCCESS)
{
Expand Down Expand Up @@ -142,7 +142,7 @@ std::string UriToFilePath(const std::string& uri)
#endif
}

std::optional<std::string> ReadFileContent(std::string_view fileName)
std::optional<std::string> ReadFileContent(const std::string& fileName)
{
std::string content;
std::ifstream file(fileName);
Expand Down

0 comments on commit 45e709d

Please sign in to comment.