[Boost-bugs] [Boost C++ Libraries] #5118: replace_extension doesn't work as specified in documentation

Subject: [Boost-bugs] [Boost C++ Libraries] #5118: replace_extension doesn't work as specified in documentation
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-01-25 11:27:49


#5118: replace_extension doesn't work as specified in documentation
-------------------------------------+--------------------------------------
 Reporter: bitfield.alex@… | Owner: bemandawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost 1.45.0 | Severity: Problem
 Keywords: extension |
-------------------------------------+--------------------------------------
 1. From Reference (see
 http://www.boost.org/doc/libs/1_45_0/libs/filesystem/v3/doc/reference.html
 #path-replace_extension):

 {{{
 path& replace_extension(const path& new_extension = path());

 Postcondition: extension() == replacement,
 where replacement is new_extension
   if new_extension.empty() || new_extension[0] == the dot character,
 otherwise replacement is the dot character followed by new_extension.

 Returns: *this
 }}}
 Testing this behavior
 {{{
 path ph("foo.txt");
 std::cout << ph.replace_extension("exe");
 }}}
 Output:
 {{{
 foo
 }}}
 Eather change the Reference or fix it in code.

 2. Current implementation doesn't allow to work with complex extentions.

 {{{
 path ph("foo.txt");
 std::cout << ph.replace_extention(".tar.bz2");
 }}}
 Output:
 {{{
 foo.bz2
 }}}

 3. There is no function to just add extension.
 something like that:
 {{{
 path ph("foo.txt");
 std::cout << ph.add_extension("bz2");
 }}}
 Expected output:
 {{{
 foo.txt.bz2
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5118>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC