format: add specifier detection for fs::path

This commit is contained in:
Danny Robson 2016-01-20 16:36:32 +11:00
parent 4eb10d0c6f
commit 7cd20bb64d
2 changed files with 11 additions and 1 deletions

View File

@ -23,7 +23,8 @@
namespace util { namespace util {
namespace format { namespace format {
template <typename ...Args> template <typename ...Args>
std::string render (const std::string &fmt, Args&&...); std::string
render (const std::string &fmt, Args&&...);
class error : public std::runtime_error class error : public std::runtime_error
{ using runtime_error::runtime_error; }; { using runtime_error::runtime_error; };

View File

@ -25,6 +25,7 @@
#include <sstream> #include <sstream>
#include <stdexcept> #include <stdexcept>
#include <iterator> #include <iterator>
#include <boost/filesystem/path.hpp>
namespace util { namespace util {
namespace detail { namespace format { namespace detail { namespace format {
@ -41,6 +42,7 @@ namespace util {
is_valid_specifier<const char*> (const char *s) is_valid_specifier<const char*> (const char *s)
{ return *s == 's'; } { return *s == 's'; }
//--------------------------------------------------------------------- //---------------------------------------------------------------------
template <> template <>
inline bool inline bool
@ -55,6 +57,13 @@ namespace util {
{ return *s == 's'; } { return *s == 's'; }
//---------------------------------------------------------------------
template <>
inline bool
is_valid_specifier<boost::filesystem::path> (const char *s)
{ return *s == 's'; }
//--------------------------------------------------------------------- //---------------------------------------------------------------------
template <> template <>
inline bool inline bool