summaryrefslogtreecommitdiff
path: root/zen/symlink_target.h
diff options
context:
space:
mode:
Diffstat (limited to 'zen/symlink_target.h')
-rw-r--r--zen/symlink_target.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/zen/symlink_target.h b/zen/symlink_target.h
index 083360af..8580a9dd 100644
--- a/zen/symlink_target.h
+++ b/zen/symlink_target.h
@@ -8,6 +8,7 @@
#define SYMLINK_TARGET_H_801783470198357483
#include "file_error.h"
+#include "file_path.h"
#include <unistd.h>
#include <stdlib.h> //realpath
@@ -35,12 +36,14 @@ Zstring getSymlinkResolvedPath(const Zstring& linkPath); //throw FileError
//################################ implementation ################################
+
+namespace zen
+{
namespace
{
//retrieve raw target data of symlink or junction
-zen::SymlinkRawContent getSymlinkRawContent_impl(const Zstring& linkPath) //throw SysError
+SymlinkRawContent getSymlinkRawContent_impl(const Zstring& linkPath) //throw SysError
{
- using namespace zen;
const size_t bufSize = 10000;
std::vector<char> buf(bufSize);
@@ -54,9 +57,8 @@ zen::SymlinkRawContent getSymlinkRawContent_impl(const Zstring& linkPath) //thro
}
-Zstring getResolvedSymlinkPath_impl(const Zstring& linkPath) //throw SysError
+Zstring getSymlinkResolvedPath_impl(const Zstring& linkPath) //throw SysError
{
- using namespace zen;
char* targetPath = ::realpath(linkPath.c_str(), nullptr);
if (!targetPath)
THROW_LAST_SYS_ERROR("realpath");
@@ -66,8 +68,6 @@ Zstring getResolvedSymlinkPath_impl(const Zstring& linkPath) //throw SysError
}
-namespace zen
-{
inline
SymlinkRawContent getSymlinkRawContent(const Zstring& linkPath)
{
@@ -84,7 +84,7 @@ Zstring getSymlinkResolvedPath(const Zstring& linkPath)
{
try
{
- return getResolvedSymlinkPath_impl(linkPath); //throw SysError
+ return getSymlinkResolvedPath_impl(linkPath); //throw SysError
}
catch (const SysError& e) { throw FileError(replaceCpy(_("Cannot determine final path for %x."), L"%x", fmtPath(linkPath)), e.toString()); }
}
bgstack15