ExpandFileNameCase - C++ Builder

C++ Builder 参考手册System::SysutilsExpandFileNameCase


把相对路径转为完整路径,并且检查文件是否存在,以及大小写匹配程度

头文件:#include <System.SysUtils.hpp>
命名空间:System::Sysutils
函数原型:

System::UnicodeString __fastcall ExpandFileNameCase(const System::UnicodeString FileName, TFilenameCaseMatch &MatchFound);

参数:

  • FileName:文件名/文件夹名,字符串;
  • MatchFound:返回文件是否存在;

返回值:

  • 函数返回参数 FileName 字符串前面加上完整的路径的字符串;
  • 参数 MatchFound 返回文件是否存在和大小写匹配程度:
    • mkNone:文件不存在;
    • mkExactMatch:文件存在;
    • mkSingleMatch:(区分大小写的系统) 没找到文件,只有 1 个大小写不匹配的文件;
    • mkAmbiguous:(区分大小写的系统) 没找到文件,有多个大小写不匹配的文件;
  • 函数按照当前路径扩展为完整路径:
    • 可以通过 SetCurrentDir 修改当前文件夹位置;
    • 可以通过 GetCurrentDir 获取当前文件夹位置;
  • 由于 ExpandFileNameCase 检查文件是否存在,所以要比 ExpandFileName 函数执行速度慢。

相关:

  • System::Sysutils::ExpandFileName
  • System::Sysutils::ExpandFileNameCase
  • System::Sysutils::ExpandUNCFileName
  • System::Sysutils::GetCurrentDir
  • System::Sysutils::SetCurrentDir
  • System::Sysutils::GetHomePath
  • System::Sysutils::ChangeFileExt
  • System::Sysutils::ChangeFilePath
  • System::Sysutils::ExtractFileDir
  • System::Sysutils::ExtractFileDrive
  • System::Sysutils::ExtractFileExt
  • System::Sysutils::ExtractFileName
  • System::Sysutils::ExtractFilePath
  • System::Sysutils::ExtractRelativePath
  • System::Sysutils::ExtractShortPathName
  • System::Sysutils
  • System::Ioutils::TPath
  • System::Ioutils
  • std::_fullpath, std::_tfullpath, std::_wfullpath
  • std::_makepath, std::_tmakepath, std::_wmakepath
  • std::_splitpath, std::_tsplitpath, std::_wsplitpath
  • <cstdlib>

C++ Builder 参考手册System::SysutilsExpandFileNameCase

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容