专业财税服务推荐

精选优质财税服务,为企业提供专业、可靠的财税解决方案,助力企业健康发展

零报税代理记账
零申报代理记账
报税做账算帐财务报表老会计做账
代理记账
咨询微信:lhy_happyday
工商营业执照年度年报年检公示
全国个体、企业、公司、合作社工商年审年报服务!
个体/10元/次 企业/20元/次
咨询微信:lhy_happyday
财税咨询服务
一对一专业财税咨询,解决企业财税难题,提供定制方案
咨询微信:lhy_happyday
财务分析服务
小规模个体报税0申报税务年报工商年报月报季报报税代理记账
咨询微信:lhy_happyday
立即咨询专业财税顾问
微信号: lhy_happyday
会计从业9年,管理多家个体工商、小规模、一般纳税人等企业的财务、税务等相关工作!。
扫码或搜索添加微信,备注"财税咨询"获取专属优惠
知方号 知方号

std::filesystem::equivalent stdfilesystempathroot

std::filesystem::equivalent

 C++Compiler supportFreestanding and hostedLanguageStandard libraryStandard library headersNamed requirementsFeature test macros (C++20)Language support libraryConcepts library (C++20)Metaprogramming library (C++11)Diagnostics libraryGeneral utilities libraryStrings libraryContainers libraryIterators libraryRanges library (C++20)Algorithms libraryNumerics libraryLocalizations libraryInput/output libraryFilesystem library (C++17)Regular expressions library (C++11)Concurrency support library (C++11)Technical specificationsSymbols indexExternal libraries[edit] Filesystem libraryClassesfilesystem::pathfilesystem::filesystem_errorfilesystem::directory_entryfilesystem::directory_iteratorfilesystem::recursive_directory_iterator    filesystem::file_statusfilesystem::space_infofilesystem::file_typefilesystem::permsfilesystem::perm_optionsfilesystem::copy_optionsfilesystem::directory_optionsfilesystem::file_time_typeFunctionsfilesystem::absolutefilesystem::canonicalfilesystem::weakly_canonicalfilesystem::relativefilesystem::proximatefilesystem::copyfilesystem::copy_filefilesystem::copy_symlinkfilesystem::create_directoryfilesystem::create_directoriesfilesystem::create_hard_linkfilesystem::create_symlinkfilesystem::create_directory_symlinkfilesystem::current_pathfilesystem::existsfilesystem::equivalentfilesystem::file_sizefilesystem::hard_link_countfilesystem::last_write_timefilesystem::permissionsfilesystem::read_symlinkfilesystem::removefilesystem::remove_allfilesystem::renamefilesystem::resize_filefilesystem::spacefilesystem::statusfilesystem::symlink_statusfilesystem::temp_directory_pathFile typesfilesystem::is_block_filefilesystem::is_character_filefilesystem::is_directoryfilesystem::is_emptyfilesystem::status_knownfilesystem::is_fifofilesystem::is_otherfilesystem::is_regular_filefilesystem::is_socketfilesystem::is_symlink[edit]  Defined in header bool equivalent( const std::filesystem::path& p1,                 const std::filesystem::path& p2 ); (1) (since C++17) bool equivalent( const std::filesystem::path& p1,

                 const std::filesystem::path& p2,

                 std::error_code& ec ) noexcept; (2) (since C++17)

Checks whether the paths p1 and p2 resolve to the same file system entity.

If either p1 or p2 does not exist, an error is reported.

The non-throwing overload returns false on errors.

Contents1 Parameters2 Return value3 Exceptions4 Notes5 Example6 Defect reports7 See also[edit] Parameters p1, p2 - paths to check for equivalence ec - out-parameter for error reporting in the non-throwing overload[edit] Return value

true if the p1 and p2 refer to the same file or directory and their file status is the same. false otherwise.

[edit] Exceptions

Any overload not marked noexcept may throw std::bad_alloc if memory allocation fails.

1) Throws std::filesystem::filesystem_error on underlying OS API errors, constructed with p1 as the first path argument, p2 as the second path argument, and the OS error code as the error code argument.2) Sets a std::error_code& parameter to the OS API error code if an OS API call fails, and executes ec.clear() if no errors occur.[edit] Notes

Two paths are considered to resolve to the same file system entity if the two candidate entities the paths resolve to are located on the same device at the same location. For POSIX, this means that the st_dev and st_ino members of their POSIX stat structure, obtained as if by POSIX stat(), are equal.

In particular, all hard links for the same file or directory are equivalent, and a symlink and its target on the same file system are equivalent.

[edit] ExampleRun this code#include #include #include namespace fs = std::filesystem; int main(){ // hard link equivalency fs::path p1 = "."; fs::path p2 = fs::current_path(); if (fs::equivalent(p1, p2)) std::cout

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至lizi9903@foxmail.com举报,一经查实,本站将立刻删除。