mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 12:58:00 +03:00
Apply clang-format to code base
This commit is contained in:
parent
f37d0be806
commit
ddb0522bbf
2199 changed files with 118692 additions and 114392 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue