flatten 20260225
This commit is contained in:
47
tjp/core/file/linux/Directories.cpp
Normal file
47
tjp/core/file/linux/Directories.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
// TJP COPYRIGHT HEADER
|
||||
|
||||
#include "Directories.h"
|
||||
#include "../Path.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace tjp {
|
||||
namespace core {
|
||||
namespace file {
|
||||
namespace linux {
|
||||
|
||||
std::string getHomeDirectory()
|
||||
{
|
||||
const char *homeDir = getenv("HOME");
|
||||
if (homeDir)
|
||||
return homeDir;
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
std::string getExecutablePath ()
|
||||
{
|
||||
return "./";
|
||||
}
|
||||
|
||||
std::string getExecutableDirectory ()
|
||||
{
|
||||
auto path = getExecutablePath();
|
||||
return popFileName(path);
|
||||
}
|
||||
|
||||
std::string getExecutableBundleDirectory ()
|
||||
{
|
||||
return getExecutableDirectory();
|
||||
}
|
||||
|
||||
std::string getExecutableResourceDirectory ()
|
||||
{
|
||||
return getExecutableDirectory();
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
} // namespace
|
||||
} // namespace
|
||||
22
tjp/core/file/linux/Directories.h
Normal file
22
tjp/core/file/linux/Directories.h
Normal file
@@ -0,0 +1,22 @@
|
||||
// TJP COPYRIGHT HEADER
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
namespace tjp {
|
||||
namespace core {
|
||||
namespace file {
|
||||
namespace linux {
|
||||
|
||||
std::string getExecutablePath();
|
||||
std::string getExecutableDirectory();
|
||||
std::string getExecutableBundleDirectory();
|
||||
std::string getExecutableResourceDirectory();
|
||||
std::string getHomeDirectory();
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
} // namespace
|
||||
} // namespace
|
||||
Reference in New Issue
Block a user