Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .github/workflows/generate-preview-links.yml

This file was deleted.

2 changes: 1 addition & 1 deletion docs/mfc/how-to-update-user-interface-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ helpviewer_keywords: ["menus [MFC], updating as context changes", "user interfac

Typically, menu items and toolbar buttons have more than one state. For example, a menu item is grayed (dimmed) if it is unavailable in the present context. Menu items can also be checked or unchecked. A toolbar button can also be disabled if unavailable, or it can be checked.

Who updates the state of these items as program conditions change? Logically, if a menu item generates a command that is handled by, say, a document, it makes sense to have the document update the menu item. The document probably contains the information on which the update is based.
Who updates the state of these items as program conditions change? Logically, if a menu item generates a command that a document handles, it makes sense to have the document update the menu item. The document probably contains the information on which the update is based.

If a command has multiple user-interface objects (perhaps a menu item and a toolbar button), both are routed to the same handler function. This encapsulates your user-interface update code for all of the equivalent user-interface objects in a single place.

Expand Down
551 changes: 437 additions & 114 deletions docs/standard-library/directory-entry-class.md

Large diffs are not rendered by default.

26 changes: 16 additions & 10 deletions docs/standard-library/directory-iterator-class.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: directory_iterator Class"
title: "directory_iterator Class"
ms.date: 04/28/2023
ms.date: 08/27/2026
f1_keywords: ["filesystem/std::filesystem::directory_iterator", "filesystem/std::filesystem::_Directory_iterator::_Directory_iterator", "filesystem/std::filesystem::directory_iterator::directory_iterator", "filesystem/std::filesystem::directory_iterator::increment", "filesystem/std::filesystem::directory_iterator::operator=", "filesystem/std::filesystem::directory_iterator::operator==", "filesystem/std::filesystem::directory_iterator::operator!=", "filesystem/std::filesystem::directory_iterator::operator*", "filesystem/std::filesystem::directory_iterator::operator->", "filesystem/std::filesystem::directory_iterator::operator++"]
ms.assetid: dca2ecf8-3e69-4644-a83d-705061e10cc8
helpviewer_keywords: ["std::filesystem::directory_iterator", "std::filesystem::_Directory_iterator::_Directory_iterator", "std::filesystem::directory_iterator", "std::filesystem::directory_iterator::directory_iterator", "std::filesystem::directory_iterator::increment", "std::filesystem::directory_iterator::operator=", "std::filesystem::directory_iterator::operator==", "std::filesystem::directory_iterator::operator!=", "std::filesystem::directory_iterator::operator*", "std::filesystem::directory_iterator::operator->", "std::filesystem::directory_iterator::operator++"]
helpviewer_keywords: ["std::filesystem::directory_iterator", "std::filesystem::_Directory_iterator::_Directory_iterator", "std::filesystem::directory_iterator::directory_iterator", "std::filesystem::directory_iterator::increment", "std::filesystem::directory_iterator::operator=", "std::filesystem::directory_iterator::operator==", "std::filesystem::directory_iterator::operator!=", "std::filesystem::directory_iterator::operator*", "std::filesystem::directory_iterator::operator->", "std::filesystem::directory_iterator::operator++"]
ms.custom: devdivchpfy22
---

Expand Down Expand Up @@ -59,15 +58,14 @@ class directory_iterator;

## <a name="directory_iterator"></a> `directory_iterator::directory_iterator`

The first constructor produces an end-of-sequence iterator. The second and third constructors store *`pval`* in `mydir`, then attempt to open and read `mydir` as a directory. If successful, they store the first filename in the directory in `myentry`; otherwise they produce an end-of-sequence iterator.

The default constructor behaves as expected.
The first constructor produces an end-of-sequence iterator. The constructors that take a *`pval`* argument store it in `mydir`, then attempt to open and read `mydir` as a directory. If successful, they store the first filename in the directory in `myentry`; otherwise they produce an end-of-sequence iterator. The overloads that take an *`options`* argument control how the directory is enumerated. The overloads that take an *`ec`* argument report errors in *`ec`* instead of throwing an exception. The copy and move constructors behave as expected.

```cpp
directory_iterator() noexcept;
explicit directory_iterator(const path& pval);

directory_iterator(const path& pval, directory_options options);
directory_iterator(const path& pval, error_code& ec) noexcept;
directory_iterator(const path& pval, directory_options options, error_code& ec) noexcept;
directory_iterator(const directory_iterator&) = default;
directory_iterator(directory_iterator&&) noexcept = default;
```
Expand All @@ -77,6 +75,9 @@ directory_iterator(directory_iterator&&) noexcept = default;
*`pval`*\
The stored file name path.

*`options`*\
The `directory_options` value that controls how the directory is enumerated. The default is `directory_options::none`.

*`ec`*\
The status error code.

Expand All @@ -88,9 +89,14 @@ The stored object.
The function attempts to advance to the next filename in the directory. If successful, it stores that filename in `myentry`; otherwise it produces an end-of-sequence iterator.

```cpp
directory_iterator& increment(error_code& ec) noexcept;
directory_iterator& increment(error_code& ec);
```

### Parameters

*`ec`*\
The status error code.

## <a name="op_neq"></a> `directory_iterator::operator!=`

The member operator returns `!(*this == right)`.
Expand Down Expand Up @@ -153,13 +159,13 @@ The first member function calls `increment()`, then returns **`*this`**. The sec

```cpp
directory_iterator& operator++();
directory_iterator& operator++(int);
directory_iterator operator++(int);
```

### Parameters

*`int`*\
The number of increments.
Dummy argument. It's a C++ convention used only to distinguish the postfix increment operator from the prefix increment operator. The C++ standard requires the postfix form to take a dummy int parameter.

## See also

Expand Down
272 changes: 272 additions & 0 deletions docs/standard-library/experimental-filesystem-directory-entry-class.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@
---
description: "Learn more about: <experimental/filesystem> directory_entry class"
title: "<experimental/filesystem> directory_entry class"
ms.date: 08/27/2026
f1_keywords: ["filesystem/std::experimental::filesystem::directory_entry", "filesystem/std::experimental::filesystem::directory_entry::operator const std::experimental::filesystem::path &", "filesystem/std::experimental::filesystem::directory_entry::directory_entry", "filesystem/std::experimental::filesystem::directory_entry::operator=", "filesystem/std::experimental::filesystem::directory_entry::assign", "filesystem/std::experimental::filesystem::directory_entry::replace_filename", "filesystem/std::experimental::filesystem::directory_entry::path", "filesystem/std::experimental::filesystem::directory_entry::status", "filesystem/std::experimental::filesystem::directory_entry::symlink_status", "filesystem/std::experimental::filesystem::directory_entry::operator<", "filesystem/std::experimental::filesystem::directory_entry::operator==", "filesystem/std::experimental::filesystem::directory_entry::operator!=", "filesystem/std::experimental::filesystem::directory_entry::operator<=", "filesystem/std::experimental::filesystem::directory_entry::operator>", "filesystem/std::experimental::filesystem::directory_entry::operator>="]
helpviewer_keywords: ["std::experimental::filesystem::directory_entry", "std::experimental::filesystem::directory_entry::operator const std::experimental::filesystem::path &", "std::experimental::filesystem::directory_entry::directory_entry", "std::experimental::filesystem::directory_entry::operator=", "std::experimental::filesystem::directory_entry::assign", "std::experimental::filesystem::directory_entry::replace_filename", "std::experimental::filesystem::directory_entry::path", "std::experimental::filesystem::directory_entry::status", "std::experimental::filesystem::directory_entry::symlink_status", "std::experimental::filesystem::directory_entry::operator<", "std::experimental::filesystem::directory_entry::operator==", "std::experimental::filesystem::directory_entry::operator!=", "std::experimental::filesystem::directory_entry::operator<=", "std::experimental::filesystem::directory_entry::operator>", "std::experimental::filesystem::directory_entry::operator>="]
ms.custom: devdivchpfy22
---

# `<experimental/filesystem>` `directory_entry` class

> [!IMPORTANT]
> This article describes the prestandard `std::experimental::filesystem` implementation of `directory_entry`. This implementation is based on the File System Technical Specification, found in [ISO/IEC JTC 1/SC 22/WG 21 N4100](https://wg21.link/n4100). It isn't `std::filesystem`, and it isn't compatible with the C++17 `std::filesystem` implementation. The experimental implementation was removed starting in MSVC toolset version 14.51. For the current C++17 `std::filesystem` version, see [`directory_entry` class](../standard-library/directory-entry-class.md).

Describes an object that is returned by `*X`, where *X* is a [`directory_iterator`](../standard-library/experimental-filesystem-directory-iterator-class.md) or a [`recursive_directory_iterator`](../standard-library/experimental-filesystem-recursive-directory-iterator-class.md).

## Syntax

```cpp
class directory_entry;
```

## Remarks

The class stores an object of type [`path`](../standard-library/experimental-filesystem-path-class.md). The stored `path` can be an instance of the `path` class or of a type that is derived from `path`. It also stores two [`file_type`](../standard-library/experimental-filesystem-enumerations.md#file_type) values. One value represents the status of the stored file name. The other represents the symbolic link status of the file name.

### Constructors

|Constructor|Description|
|-|-|
|[`directory_entry`](#directory_entry)|The defaulted constructors behave as expected. The fourth constructor initializes `mypath` to *pval*, `mystat` to *stat_arg*, and `mysymstat` to *symstat_arg*.|

### Member functions

|Member function|Description|
|-|-|
|[`assign`](#assign)|The member function assigns *pval* to `mypath`, *stat* to `mystat`, and *symstat* to `mysymstat`.|
|[`path`](#path)|The member function returns `mypath`.|
|[`replace_filename`](#replace_filename)|The member function replaces `mypath` with `mypath.parent_path()` / *pval*, `mystat` with *stat_arg*, and `mysymstat` with *symstat_arg*|
|[`status`](#status)|Both member functions return `mystat` possibly first altered.|
|[`symlink_status`](#symlink_status)|Both member functions return `mysymstat` possibly first altered.|

### Operators

|Operator|Description|
|-|-|
|[`operator!=`](#op_neq)|Returns `!(*this == right)`.|
|[`operator=`](#op_as)|The defaulted member assignment operators behave as expected.|
|[`operator==`](#op_eq)|Returns `mypath == right.mypath`.|
|[`operator<`](#op_lt)|Returns `mypath < right.mypath`.|
|[`operator<=`](#op_lteq)|Returns `!(right < *this)`.|
|[`operator>`](#op_gt)|Returns `right < *this`.|
|[`operator>=`](#op_gteq)|Returns `!(*this < right)`.|
|[`operator const path_type&`](#path_type)|Returns `mypath`.|

## Requirements

**Header:** `<experimental/filesystem>`

**Namespace:** `std::experimental::filesystem`

## <a name="assign"></a> assign

The member function assigns *pval* to `mypath`, *stat_arg* to `mystat`, and *symstat_arg* to `mysymstat`.

```cpp
void assign(const std::experimental::filesystem::path& pval,
file_status stat_arg = file_status(),
file_status symstat_arg = file_status());
```

### Parameters

*pval*\
The stored file name path.

*stat_arg*\
The status of the stored file name.

*symstat_arg*\
The symbolic link status of the stored file name.

## <a name="directory_entry"></a> directory_entry

The defaulted constructors behave as expected. The fourth constructor initializes `mypath` to *pval*, `mystat` to *stat_arg*, and `mysymstat` to *symstat_arg*.

```cpp
directory_entry() = default;
directory_entry(const directory_entry&) = default;
directory_entry(directory_entry&&) noexcept = default;
explicit directory_entry(const std::experimental::filesystem::path& pval,
file_status stat_arg = file_status(),
file_status symstat_arg = file_status());
```

### Parameters

*pval*\
The stored file name path.

*stat_arg*\
The status of the stored file name.

*symstat_arg*\
The symbolic link status of the stored file name.

## <a name="op_neq"></a> operator!=

The member function returns `!(*this == right)`.

```cpp
bool operator!=(const directory_entry& right) const noexcept;
```

### Parameters

*right*\
The [directory_entry](../standard-library/experimental-filesystem-directory-entry-class.md) being compared to the `directory_entry`.

## <a name="op_as"></a> operator=

The defaulted member assignment operators behave as expected.

```cpp
directory_entry& operator=(const directory_entry&) = default;
directory_entry& operator=(directory_entry&&) noexcept = default;
```

### Parameters

*right*\
The [directory_entry](../standard-library/experimental-filesystem-directory-entry-class.md) being copied into the `directory_entry`.

## <a name="op_eq"></a> operator==

The member function returns `mypath == right.mypath`.

```cpp
bool operator==(const directory_entry& right) const noexcept;
```

### Parameters

*right*\
The [directory_entry](../standard-library/experimental-filesystem-directory-entry-class.md) being compared to the `directory_entry`.

## <a name="op_lt"></a> `operator<`

The member function returns `mypath < right.mypath`.

```cpp
bool operator<(const directory_entry& right) const noexcept;
```

### Parameters

*right*\
The [directory_entry](../standard-library/experimental-filesystem-directory-entry-class.md) being compared to the `directory_entry`.

## <a name="op_lteq"></a> `operator<=`

The member function returns `!(right < *this)`.

```cpp
bool operator<=(const directory_entry& right) const noexcept;
```

### Parameters

*right*\
The [directory_entry](../standard-library/experimental-filesystem-directory-entry-class.md) being compared to the `directory_entry`.

## <a name="op_gt"></a> `operator>`

The member function returns `right < *this`.

```cpp
bool operator>(const directory_entry& right) const noexcept;
```

### Parameters

*right*\
The [directory_entry](../standard-library/experimental-filesystem-directory-entry-class.md) being compared to the `directory_entry`.

## <a name="op_gteq"></a> `operator>=`

The member function returns `!(*this < right)`.

```cpp
bool operator>=(const directory_entry& right) const noexcept;
```

### Parameters

*right*\
The [directory_entry](../standard-library/experimental-filesystem-directory-entry-class.md) being compared to the `directory_entry`.

## <a name="path_type"></a> operator const path_type&

The member operator returns `mypath`.

```cpp
operator const std::experimental::filesystem::path&() const;
```

## <a name="path"></a> path

The member function returns `mypath`.

```cpp
const std::experimental::filesystem::path& path() const noexcept;
```

## <a name="replace_filename"></a> replace_filename

The member function replaces `mypath` with `mypath.parent_path()` / *pval*, `mystat` with *stat_arg*, and `mysymstat` with *symstat_arg*

```cpp
void replace_filename(
const std::experimental::filesystem::path& pval,
file_status stat_arg = file_status(),
file_status symstat_arg = file_status());
```

### Parameters

*pval*\
The stored file name path.

*stat_arg*\
The status of the stored file name.

*symstat_arg*\
The symbolic link status of the stored file name.

## <a name="status"></a> status

Both member functions return `mystat` possibly first altered as follows:

1. If `status_known(mystat)` then do nothing.

1. Otherwise, if `!status_known(mysymstat) && !is_symlink(mysymstat)` then `mystat = mysymstat`.

```cpp
file_status status() const;
file_status status(error_code& ec) const noexcept;
```

### Parameters

*ec*\
The status error code.

## <a name="symlink_status"></a> symlink_status

Both member functions return `mysymstat` possibly first altered as follows: If `status_known(mysymstat)` then do nothing. Otherwise, `mysymstat = symlink_status(mypval)`.

```cpp
file_status symlink_status() const;
file_status symlink_status(error_code& ec) const noexcept;
```

### Parameters

*ec*\
The status error code.

## See also

[`<experimental/filesystem>`](../standard-library/experimental-filesystem.md)\
[`path` class](../standard-library/experimental-filesystem-path-class.md)
Loading