wpath対応 その1
Hamigaki.Filesystemをwpathに対応させる改良を始めました。
今日の差分
とりあえず、Windows版のfile_status.cppだけ書き直しました。
実装形式はBoost.Filesystemに揃えています。
例えば、status()の場合、
namespace detail { // 実装用 (非inline) file_status status_api(const std::string& ph, system::error_code& ec); file_status status_api(const std::wstring& ph, system::error_code& ec); } // namespace detail // テンプレート版 (status_api()を呼ぶ) template<class Path> inline typename boost::enable_if<is_basic_path<Path>,file_status>::type status(const Path& ph, system::error_code& ec); template<class Path> inline typename boost::enable_if<is_basic_path<Path>,file_status>::type status(const Path& ph); // オーバーロード版 (テンプレート版を呼ぶ) inline file_status status(const path& ph); inline file_status status(const wpath& ph); inline file_status status(const path& ph, system::error_code& ec); inline file_status status(const wpath& ph, system::error_code& ec);
の三段階になっていて、さらにstatus_api()の中はstringとwstring共用のテンプレートになっています。
しかも、ワイド文字の使えない環境用のworkaroundまであるので、非常に面倒くさいです。