Ticket #4485: patch.diff

File patch.diff, 1.4 KB (added by zhuo.qiang@…, 11 years ago)

another way adding boost::filesystem v3 support

  • boost/iostreams/detail/path.hpp

     
    5050    template<typename Path>
    5151    explicit path(const Path& p, typename Path::external_string_type* = 0)
    5252    {
    53         typedef typename Path::external_string_type string_type;
    54         init(p, boost::type<string_type>());
     53        init(p.external_file_string());
    5554    }
    5655
     56    // Constructor taking a boost::filesystem3::path (boost filesystem v3)
     57    template<typename Path>
     58    explicit path(const Path& p, typename Path::string_type* = 0)
     59    {
     60        init(p.native());
     61    }
     62
    5763    // Copy constructor
    5864    path(const path& p)
    5965        : narrow_(p.narrow_), wide_(p.wide_), is_wide_(p.is_wide_)
     
    111117    path(const std::wstring&);
    112118    path& operator=(const std::wstring&);
    113119
    114     template<typename Path>
    115     void init(const Path& p, boost::type<std::string>)
     120    void init(std::string const& file_path)
    116121    {
    117         narrow_ = p.external_file_string();
     122        narrow_ = file_path;
    118123        wide_.clear();
    119124        is_wide_ = false;
    120125    }
    121126
    122     template<typename Path>
    123     void init(const Path& p, boost::type<std::wstring>)
     127    void init(std::wstring const& file_path)
    124128    {
    125129        narrow_.clear();
    126         wide_ = p.external_file_string();
     130        wide_ = file_path;
    127131        is_wide_ = true;
    128132    }
    129133