From b3611524f45c2a478f9decd6d22ecd1dbbbb64b9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 17 Oct 2013 23:23:25 +0200 Subject: fs/Path: move definitions to struct PathTraits --- src/fs/FileSystem.hxx | 62 ++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 30 deletions(-) (limited to 'src/fs/FileSystem.hxx') 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 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); } -- cgit v1.2.3