Boost C++ Libraries: Ticket #4485: boost.filesysten v3 breaks boost:::iostream::mapped_file https://svn.boost.org/trac10/ticket/4485 <p> boost:::iostream::mapped_file has been design so that when passing file path to the constructor or open(), it only accepts 3 types: std::string, boost::filesystem::path, boost::filesystem::wpath. </p> <p> due to the late update to boost::filesystem v3, boost::filesystem::path is no longer templated, and wpath is gone. and as Windows uses UTF16, when a path is converted from utf16 to a certain ANSI/OEM code page(CP), causes information loss, for example, "Apress ©" in unicode would be converted to "Apress ?" in CP936, where code point 0x00a9(©) is lost, though it's a legal character in file name. </p> <p> it amounts to that support for std::wstring in boost:::iostream::mapped_file is gone. </p> <p> a patch is needed to remove the dependence on boost.filesystem v2, and revert to the support of std::wstring, which can be get from path.wstring() in boost::filesystem v3. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4485 Trac 1.4.3 Steven Watanabe Thu, 29 Jul 2010 14:25:19 GMT component changed; owner set https://svn.boost.org/trac10/ticket/4485#comment:1 https://svn.boost.org/trac10/ticket/4485#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Jonathan Turkanis</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">iostreams</span> </li> </ul> Ticket Jeff Flinn <jflinn@…> Wed, 02 Mar 2011 20:53:16 GMT attachment set https://svn.boost.org/trac10/ticket/4485 https://svn.boost.org/trac10/ticket/4485 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">filesystem_v3_path_adapter.hpp</span> </li> </ul> <p> workaround to adapt filesystem vs path for use with file_descriptor and mapped_file </p> Ticket Jeff Flinn <jflinn@…> Wed, 02 Mar 2011 21:07:53 GMT <link>https://svn.boost.org/trac10/ticket/4485#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4485#comment:2</guid> <description> <p> The previously attached filesystem_v3_path_adapter.hpp file allows boost filesystem V3 path to be used with file_descriptor* and mapped_file* classes. I've tested this on Windows MSVC8 &amp; Mac XCode 3.1.2/gcc 4.0.1 with utf8 paths. On windows it makes the wide CreateFileW interface accessible for opening unicode path'd files. Example usage: </p> <p> #include &lt;boost/iostreams/device/mapped_file.hpp&gt; #include &lt;boost/iostreams/filesystem_v3_path_adapter.hpp&gt; </p> <p> ... </p> <p> boost::filesystem::path p(...); </p> <p> namespace io = boost::iostreams; </p> <p> io::mapped_file_source mf_src(io::filesystem_v3_path_adapter(p)); </p> <p> ... </p> </description> <category>Ticket</category> </item> <item> <author>zhuo.qiang@…</author> <pubDate>Wed, 01 Jun 2011 07:14:31 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4485 https://svn.boost.org/trac10/ticket/4485 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">patch.diff</span> </li> </ul> <p> another way adding boost::filesystem v3 support </p> Ticket zhuo.qiang@… Wed, 01 Jun 2011 07:18:16 GMT <link>https://svn.boost.org/trac10/ticket/4485#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4485#comment:3</guid> <description> <p> Another way for adding Filesystem v3 support is to make boost::iostreams::detail::path be constructable from boost::filesystem3::path </p> <p> See the attachment for the <a class="ext-link" href="https://svn.boost.org/trac/boost/attachment/ticket/4485/patch.diff"><span class="icon">​</span>patch</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Fri, 03 Jun 2011 23:30:01 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4485#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4485#comment:4</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/72382" title="Iostreams: Support filesystem3 paths. Refs #4485. Based on Zhuo ...">[72382]</a>) Iostreams: Support filesystem3 paths. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4485" title="#4485: Patches: boost.filesysten v3 breaks boost:::iostream::mapped_file (closed: fixed)">#4485</a>. </p> <p> Based on Zhuo Qiang's patch with added tests and support for <code>operator=</code>. </p> <p> I also used <code>codecvt_type</code> to detect <code>filesystem3::path</code> instead of <code>string_type</code>. Using <code>string_type</code> made <code>filesystem2::path</code> ambiguous because it has both <code>string_type</code> and <code>external_string_type</code> members. </p> <p> The member types are a bit arbitrary, but a more precise distinction would probably also be more expensive. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Fri, 03 Jun 2011 23:33:03 GMT</pubDate> <title>keywords, owner, status, milestone changed https://svn.boost.org/trac10/ticket/4485#comment:5 https://svn.boost.org/trac10/ticket/4485#comment:5 <ul> <li><strong>keywords</strong> filesystem added; filesysten removed </li> <li><strong>owner</strong> changed from <span class="trac-author">Jonathan Turkanis</span> to <span class="trac-author">Daniel James</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.44.0</span> → <span class="trac-field-new">To Be Determined</span> </li> </ul> Ticket anonymous Fri, 29 Jul 2011 19:43:41 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4485#comment:6 https://svn.boost.org/trac10/ticket/4485#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> This was fixed in <a class="changeset" href="https://svn.boost.org/trac10/changeset/72491" title="Iostreams: merge `filesystem3::path` support. ">[72491]</a> and <a class="changeset" href="https://svn.boost.org/trac10/changeset/72774" title="Iostreams: Use sfinae workaround in Visual C++ 8, as well as 7.1. ...">[72774]</a>, and released in 1.47.0. </p> Ticket