aboutsummaryrefslogtreecommitdiffstats
path: root/src/fs/FileSystem.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-17 23:23:25 +0200
committerMax Kellermann <max@duempel.org>2013-10-17 23:23:25 +0200
commitb3611524f45c2a478f9decd6d22ecd1dbbbb64b9 (patch)
treed15d0c161e24e5db7d77b768458aa11cb6650878 /src/fs/FileSystem.hxx
parenta63613dba0374367907180be5e244db450ff234b (diff)
downloadmpd-b3611524f45c2a478f9decd6d22ecd1dbbbb64b9.tar.gz
mpd-b3611524f45c2a478f9decd6d22ecd1dbbbb64b9.tar.xz
mpd-b3611524f45c2a478f9decd6d22ecd1dbbbb64b9.zip
fs/Path: move definitions to struct PathTraits
Diffstat (limited to '')
-rw-r--r--src/fs/FileSystem.hxx62
1 files changed, 32 insertions, 30 deletions
diff --git a/src/fs/FileSystem.hxx b/src/fs/FileSystem.hxx
index d247f1a75..faa00751a 100644
--- a/src/fs/FileSystem.hxx
+++ b/src/fs/FileSystem.hxx
@@ -21,6 +21,7 @@
#define MPD_FS_FILESYSTEM_HXX
#include "check.h"
+#include "Traits.hxx"
#include "system/fd_util.h"
#include "Path.hxx"
@@ -31,41 +32,42 @@
#include <stdio.h>
namespace FOpenMode {
-/**
- * Open mode for reading text files.
- */
-constexpr Path::const_pointer ReadText = "r";
-
-/**
- * Open mode for reading binary files.
- */
-constexpr Path::const_pointer ReadBinary = "rb";
-
-/**
- * Open mode for writing text files.
- */
-constexpr Path::const_pointer WriteText = "w";
-
-/**
- * Open mode for writing binary files.
- */
-constexpr Path::const_pointer WriteBinary = "wb";
-
-/**
- * Open mode for appending text files.
- */
-constexpr Path::const_pointer AppendText = "a";
-
-/**
- * Open mode for appending binary files.
- */
-constexpr Path::const_pointer AppendBinary = "ab";
+ /**
+ * Open mode for reading text files.
+ */
+ constexpr PathTraits::const_pointer ReadText = "r";
+
+ /**
+ * Open mode for reading binary files.
+ */
+ constexpr PathTraits::const_pointer ReadBinary = "rb";
+
+ /**
+ * Open mode for writing text files.
+ */
+ constexpr PathTraits::const_pointer WriteText = "w";
+
+ /**
+ * Open mode for writing binary files.
+ */
+ constexpr PathTraits::const_pointer WriteBinary = "wb";
+
+ /**
+ * Open mode for appending text files.
+ */
+ constexpr PathTraits::const_pointer AppendText = "a";
+
+ /**
+ * Open mode for appending binary files.
+ */
+ constexpr PathTraits::const_pointer AppendBinary = "ab";
}
/**
* Wrapper for fopen() that uses #Path names.
*/
-static inline FILE *FOpen(const Path &file, Path::const_pointer mode)
+static inline FILE *
+FOpen(const Path &file, PathTraits::const_pointer mode)
{
return fopen(file.c_str(), mode);
}