Ticket #964: i18n.html.patch
File i18n.html.patch, 8.5 KB (added by , 15 years ago) |
---|
-
.html
old new 34 34 </li> 35 35 <li><a href="#Preservation">Preservation</a> of existing user code whenever 36 36 possible.<br> 37 37 </li> 38 38 <li><a href="#More_efficient">More efficient operations</a> when iterating over directories.<br> 39 39 </li> 40 <li>A <a href="convenience.htm#basic_recursive_directory_iterator">recursive 40 <li>A 41 <a href="tr2_proposal.html#Class-template-basic_recursive_directory_iterator">recursive 41 42 directory iterator</a> is now provided. </li> 42 43 </ul> 43 44 <p><a href="#Rationale">Rationale</a> for some of the changes is also provided.</p> 44 45 <h2><a name="Internationalization">Internationalization</a></h2> 45 46 <p>Cass templates <i>basic_path</i>, <i>basic_filesystem_error</i>, and <i> 46 47 basic_directory_iterator</i> provide the basic mechanisms for … … 64 65 types is performed by path traits classes. The specific conversions for <i>path</i> 65 66 and <i>wpath</i> is implementation defined, with normative encouragement to use 66 67 the operating system's preferred file system encoding. For many modern POSIX-based 67 68 file systems the <i>wpath</i> external encoding is <a href="design.htm#Kuhn"> 68 69 UTF-8</a>, while for modern Windows file systems such as NTFS it is 69 70 <a href="http://en.wikipedia.org/wiki/UTF-16">UTF-16</a>.</p> 70 <p>The <a href=" operations.htm">operational functions</a> in71 <p>The <a href="tr2_proposal.html#Operations-functions">operational functions</a> in 71 72 <a href="../../../boost/filesystem/operations.hpp">operations.hpp</a> are provided with overloads for 72 73 <i>path</i>, <i>wpath</i>, and user-defined <i>basic_path</i>'s. A 73 <a href=" operations.htm#Do-the-right-thing">"do-the-right-thing" rule</a>74 <a href="tr2_proposal.html#Requirements-on-implementations">"do-the-right-thing" rule</a> 74 75 applies to implementations, ensuring that the correct overload will be chosen.</p> 75 76 <h2><a name="Simplification">Simplification</a> of path interface</h2> 76 77 <p>Prior versions of the library required users of class <i>path</i> to identify 77 78 the format (native or generic) and name error-checking policy, either via a 78 79 second constructor argument or via a default mechanism. That approach caused 79 80 complaints, particularly from users not needing the name checking features. The … … 85 86 These constructors are only provided to ease the transition of existing code.<br> 86 87 </li> 87 88 <li>Path name checking functionality has been moved out of class path and into 88 89 separate free-functions. This still provides name checking for those who need 89 90 it, but with much less impact on those who don't need it.</li> 90 91 </ul> 91 <p>Additionally, <a href="exception.htm">basic_filesystem_error</a> has been put 92 <p>Additionally, 93 <a href="tr2_proposal.html#Class-template-basic_filesystem_error">basic_filesystem_error</a> has been put 92 94 on a diet and generally simplified.</p> 93 95 <p>Error codes have been simplified and aligned with [POSIX-01]. A supporting 94 96 header <a href="../../../boost/filesystem/cerrno.hpp"> 95 97 <boost/filesystem/cerrno.hpp></a> is also provided.</p> 96 98 <p><code>"//:"</code> has been introduced as a path escape prefix to identify 97 99 native paths. Rationale: simplifies basic_path constructor interfaces, easier … … 107 109 what the expectations were for true and false values of the various predicates. 108 110 See the <a href="#table">table</a> below.</p> 109 111 <h3>status()</h3> 110 112 <p>As part of the predicate discussions, particularly with Rob Stewart, it 111 113 became obvious that sometimes applications need access to raw status information 112 114 without any possibility of an exception being thrown. The 113 <a href=" operations.htm#status">status()</a> function was added to meet this115 <a href="tr2_proposal.html#Status-functions">status()</a> function was added to meet this 114 116 need. It also proved clearer to specify the semantics of predicate functions in 115 117 terms of status().</p> 116 118 <h3><a name="is_file">is_file</a>()</h3> 117 119 <p>About the same time, Jeff Garland suggested that an 118 <a href="operations.htm#is_file">is_file()</a> predicate would 119 compliment 120 <a href="operations.htm#is_directory">is_directory()</a>. In working on the analysis below, it became obvious 120 <a href="tr2_proposal.html#Predicate-functions">is_file()</a> predicate would 121 compliment <a href="tr2_proposal.html#Predicate-functions">is_directory()</a>. In working on the analysis below, it became obvious 121 122 that the expectations for is_file() were different from the expectations for !is_directory(), 122 123 so is_file() was added. </p> 123 124 <h3><a name="is_other">is_other</a>()</h3> 124 125 <p>On some operating systems, it is possible to have a directory entry which is 125 not for either a directory or a file. The <a href="operations.htm">is_other()</a> 126 not for either a directory or a file. The 127 <a href="tr2_proposal.html#Predicate-functions">is_other()</a> 126 128 function identifies such cases.</p> 127 129 <h3>Should predicates throw on errors?</h3> 128 130 <p>Some conditions reported by operating systems as errors (see 129 131 <a href="#Footnote">footnote</a>) clearly simply indicate that the predicate is 130 132 false, rather than indicating serious failure. But other errors represent 131 133 serious hardware or network problems, or permissions problems.</p> 132 134 <p>Some people, particularly Rob Stewart, argue that in a function like 133 <a href=" operations.htm#is_directory">is_directory()</a>, any error should simply cause the function to return false. If135 <a href="tr2_proposal.html#Predicate-functions">is_directory()</a>, any error should simply cause the function to return false. If 134 136 there is actually an underlying problem, it will be detected it due course when 135 137 a directory_iterator or fstream operation is attempted.</p> 136 138 <p>That view is was rejected because of the following considerations:</p> 137 139 <ul> 138 140 <li>As a general principle, the earlier errors can be reported, the better. 139 141 The rationale being that it is often much cheaper to fix errors sooner rather … … 385 387 conversions could cause incorrect results, that conversions best left to the 386 388 operating system would be performed, and that the technical complexity was too 387 389 great in relation to perceived benefits. User-defined types would only make 388 390 the problem worse.<br> 389 391 </li> 390 392 </ul> 391 <h3>No versions of <a href=" operations.htm#status">status()</a> which throw exceptions on393 <h3>No versions of <a href="tr2_proposal.html#Status-functions">status()</a> which throw exceptions on 392 394 errors</h3> 393 395 <p>The rationale for not including versions of status() 394 396 which throw exceptions on errors is that (1) the primary purpose of this 395 397 function is to perform queries at a very low-level, where exceptions are usually 396 398 unwanted, and (2) exceptions on errors are already provided by the predicate 397 399 functions. There would be little or no efficiency gain from providing a throwing 398 400 version of status().</p> 399 <h3>Symlink identifying version of <a href=" operations.htm#status">status()</a> function</h3>401 <h3>Symlink identifying version of <a href="tr2_proposal.html#Status-functions">status()</a> function</h3> 400 402 <p>A symlink identifying version of the status() function is distinguished by a 401 403 second argument. Often separately named functions are more appropriate than 402 404 overloading when behavior 403 405 differs, which is the case here, while overloads are more appropriate when 404 406 behavior is the same but argument types differ (Iain Hanson). Overloading was 405 407 chosen in this particular case because a subjective judgment that a single … … 412 414 characters, the default conversion should not depend on the operating system 413 415 alone, but on the std::locale("") default. For example, the usual encoding 414 416 for Russian on Linux (and Russian web sites) is KOI8-R (RFC1489). The ability to safely specify a different locale 415 417 is also provided, to meet unforeseen needs.</p> 416 418 <hr> 417 419 <p>Revised 418 <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan --> 16 December, 2005<!--webbot bot="Timestamp" endspan i-checksum="38518" --></p>420 <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->03 June, 2007<!--webbot bot="Timestamp" endspan i-checksum="19946" --></p> 419 421 <p>© Copyright Beman Dawes, 2005</p> 420 422 <p>Distributed under the Boost Software License, Version 1.0. 421 423 (See accompanying file <a href="../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or 422 424 copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</p> 423 425 424 426 </body> 425 427 426 428 </html>