std::experimental::filesystem::path:: remove_filename
From cppreference.net
<
cpp
|
experimental
|
fs
|
path
C++
Experimental
| Technical Specification | ||||
| Filesystem library (filesystem TS) | ||||
| Library fundamentals (library fundamentals TS) | ||||
| Library fundamentals 2 (library fundamentals TS v2) | ||||
| Library fundamentals 3 (library fundamentals TS v3) | ||||
| Extensions for parallelism (parallelism TS) | ||||
| Extensions for parallelism 2 (parallelism TS v2) | ||||
| Extensions for concurrency (concurrency TS) | ||||
| Extensions for concurrency 2 (concurrency TS v2) | ||||
| Concepts (concepts TS) | ||||
| Ranges (ranges TS) | ||||
| Reflection (reflection TS) | ||||
| Mathematical special functions (special functions TR) | ||||
| Experimental Non-TS | ||||
| Pattern Matching | ||||
| Linear Algebra | ||||
| std::execution | ||||
| Contracts | ||||
| 2D Graphics |
Filesystem library
| Classes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| File types | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
path
| Member functions | ||||
| Path decomposition | ||||
| Non-member functions | ||||
|
path
&
remove_filename
(
)
|
(1) | (filesystem TS) |
単一のファイル名コンポーネントを削除します。
ファイル名コンポーネントを持たないパスの場合、動作は未定義です ( has_filename が false を返す場合)。
目次 |
パラメータ
(なし)
戻り値
* this
例外
実装定義の例外をスローする可能性があります。
例
このコードを実行
#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'; }
出力:
"/" ""
関連項目
|
ファイル名パスコンポーネントを返す
(公開メンバ関数) |
|
|
最後のパスコンポーネントを別のパスで置き換える
(公開メンバ関数) |
|
|
対応するパス要素が空でないかチェックする
(公開メンバ関数) |