Apply clang-format to code base

This commit is contained in:
clang-format-bot 2022-09-22 21:26:05 +03:00 committed by ζeh Matt
parent f37d0be806
commit ddb0522bbf
No known key found for this signature in database
GPG key ID: 18CE582C71A225B0
2199 changed files with 118692 additions and 114392 deletions

View file

@ -6,33 +6,33 @@
namespace Version
{
Version getOpenmwVersion(const std::filesystem::path &resourcePath)
{
std::ifstream stream (resourcePath / "version");
Version v;
std::getline(stream, v.mVersion);
std::getline(stream, v.mCommitHash);
std::getline(stream, v.mTagHash);
return v;
}
std::string Version::describe() const
{
std::string str = "OpenMW version " + mVersion;
std::string rev = mCommitHash;
if (!rev.empty())
Version getOpenmwVersion(const std::filesystem::path& resourcePath)
{
rev = rev.substr(0, 10);
str += "\nRevision: " + rev;
std::ifstream stream(resourcePath / "version");
Version v;
std::getline(stream, v.mVersion);
std::getline(stream, v.mCommitHash);
std::getline(stream, v.mTagHash);
return v;
}
return str;
}
std::string getOpenmwVersionDescription(const std::filesystem::path &resourcePath)
{
Version v = getOpenmwVersion(resourcePath);
return v.describe();
}
std::string Version::describe() const
{
std::string str = "OpenMW version " + mVersion;
std::string rev = mCommitHash;
if (!rev.empty())
{
rev = rev.substr(0, 10);
str += "\nRevision: " + rev;
}
return str;
}
std::string getOpenmwVersionDescription(const std::filesystem::path& resourcePath)
{
Version v = getOpenmwVersion(resourcePath);
return v.describe();
}
}

View file

@ -1,8 +1,8 @@
#ifndef VERSION_HPP
#define VERSION_HPP
#include <string>
#include <filesystem>
#include <string>
namespace Version
{
@ -17,13 +17,11 @@ namespace Version
};
/// Read OpenMW version from the version file located in resourcePath.
Version getOpenmwVersion(const std::filesystem::path &resourcePath);
Version getOpenmwVersion(const std::filesystem::path& resourcePath);
/// Helper function to getOpenmwVersion and describe() it
std::string getOpenmwVersionDescription(const std::filesystem::path &resourcePath);
std::string getOpenmwVersionDescription(const std::filesystem::path& resourcePath);
}
#endif // VERSION_HPP