std::experi...ve_filename(3)
πΈ NAME πΈ
okay bestie, welcome to the C++ Standard Libary manual page for std::experi...ve_filename(3) π
. this page is about std::experimental::filesystem::path::remove_filename - std::experimental::filesystem::path::remove_filename. yes, it says it twice, and we respect the lore π.
β¨ Synopsis β¨
path& remove_filename() (1) (filesystem TS)
bestie, this one removes a single filename component. that's the whole job. iconic β¨.
β οΈ the behavior is undefined if the path has no filename component β like,has_filenamereturnsfalseβ so pls don't test fate π.
π Parameters π
(none)β literally no parameters, zero, nada, the void π«Ά.
π Return value π
*thisβ it gives you back*this, periodt.
π₯ Exceptions π₯
- May throw implementation-defined exceptions β implementation gets to decide, iykyk π.
π Example π
// Run this code
#include <experimental/filesystem>
#include <iostream>
namespace fs = std::experimental::filesystem;
int main()
{
std::cout << fs::path("/foo").remove_filename() << '\n'
<< fs::path("/").remove_filename() << '\n';
}
π¬ Output π¬
"/"
""
π¦ See also π¦
filenameβ returns the filename path component (public member function)replace_filenameβ replaces the last path component with another path (public member function)has_filenameβ checks if the corresponding path element is not empty (public member function)
π·οΈ Category π·οΈ
Noindexed pages
made with love from source http://cppreference.com β¨ date/version 2024.06.10 β¨ page std::experi...ve_filename(3) β mwah, bye bestie πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms