美文网首页
ExpandFileNameCase - C++ Builder

ExpandFileNameCase - C++ Builder

作者: 玄坴 | 来源:发表于2021-11-06 12:19 被阅读0次

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

相关文章

网友评论

      本文标题:ExpandFileNameCase - C++ Builder

      本文链接:https://www.haomeiwen.com/subject/wqmdahtx.html