docs(cxx): add a section about std::filesystem limitations

Co-authored-by: Shen Meng Jing <shenmengjing@espressif.com>
This commit is contained in:
Ivan Grokhotkov
2024-10-29 12:40:22 +01:00
parent e3f5a5a347
commit da2c883622
2 changed files with 32 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ The following C++ features are supported:
- :ref:`cplusplus_multithreading`
- :ref:`cplusplus_rtti`
- :doc:`thread-local-storage` (``thread_local`` keyword)
- :ref:`cplusplus_filesystem`
- All C++ features implemented by GCC, except for some :ref:`cplusplus_limitations`. See `GCC documentation <https://gcc.gnu.org/projects/cxx-status.html>`_ for details on features implemented by GCC.
@@ -94,6 +95,21 @@ Enabling this option compiles all C++ files with RTTI support enabled, which all
See :example:`cxx/rtti` for an example of using RTTI in ESP-IDF. Specifically, this example demonstrates how to use the RTTI feature in ESP-IDF, enabling compile time support for RTTI, and showing how to print demangled type names of objects and functions, and how dynamic_cast behaves with objects of two classes derived from a common base class.
.. _cplusplus_filesystem:
Filesystem Library
------------------
C++ Filesystem library (``#include <filesystem>``) features are supported in ESP-IDF, with the following exceptions:
- Since symbolic and hard links are not supported in ESP-IDF, related functions are not implemented.
- ``std::filesystem::space`` is not implemented.
- ``std::filesystem::resize_file`` is not implemented.
- ``std::filesystem::current_path`` always returns ``/``. Setting the current path is not supported.
- ``std::filesystem::permissions`` doesn't support setting file permissions.
Note that the choice of the filesystem also affects the behavior of the filesystem library. For example, SPIFFS filesystem has limited support for directories, therefore the related std::filesystem functions may not work as they do on a filesystem which does support directories.
Developing in C++
-----------------