Anypia Programmer's Documentation
ContentsIndexHome
PreviousUpNext
Path::changeExtension Method

Changes the extension of a path string.

C++
static std::string changeExtension(
    const std::string& path, 
    const std::string& extension
);
Parameters 
Description 
const std::string& path 
The path information to modify. 
const std::string& extension 
The new extension (with a leading period). 

The string containing the modified path information.

If the extension argument is empty or consists solely of a period, this function removes any existing extension. Otherwise, if neither path nor extension contains a period, this function adds the period. Then the rest of the extension argument after the period is added.

Copyright (c) 2010. All rights reserved.
What do you think about this topic? Send feedback!