Skip to content
Snippets Groups Projects
Commit 6e618282 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

generalize fct FileSystemUtils::jointPath

parent d33c9133
No related branches found
No related tags found
1 merge request!49comments and minor simplifications in loader context
......@@ -71,9 +71,11 @@ std::vector<std::string> FileSystemUtils::filesInDirectory(const std::string& di
std::string FileSystemUtils::jointPath(const std::string& path1, const std::string& path2)
{
ASSERT(path1 != "");
ASSERT(path2 != "");
if (path1 == "")
return fs::path(path2).string();
return (fs::path(path1) / fs::path(path2)).string();
}
......
......@@ -44,7 +44,7 @@ bool createDirectories(const std::string& dir_name);
//! Returns filenames of files in directory
std::vector<std::string> filesInDirectory(const std::string& dir_name);
//! Returns joint path name.
//! Returns joint path name. Argument path1 may be empty, argument path2 not.
std::string jointPath(const std::string& path1, const std::string& path2);
//! Returns path without directory part ("Foo/Bar/Doz.int.gz" -> "Doz.int.gz")
......
......@@ -14,8 +14,6 @@
#include "GUI/coregui/mainwindow/SaveLoadInterface.h"
SaveLoadInterface::~SaveLoadInterface() = default;
QString SaveLoadInterface::fileName(const QString& projectDir) const
{
const auto filename = fileName();
......
......@@ -24,7 +24,7 @@
class SaveLoadInterface {
public:
virtual ~SaveLoadInterface();
virtual ~SaveLoadInterface() = default;
//! Loads non-XML data from _projectDir_ and returns success flag.
virtual bool loadData(const QString& projectDir) = 0;
......
......@@ -1310,7 +1310,7 @@ Returns filenames of files in directory.
%feature("docstring") FileSystemUtils::jointPath "std::string FileSystemUtils::jointPath(const std::string &path1, const std::string &path2)
Returns joint path name.
Returns joint path name. Argument path1 may be empty, argument path2 not.
";
%feature("docstring") FileSystemUtils::filename "std::string FileSystemUtils::filename(const std::string &path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment