Apollo 10.0
自动驾驶开放平台
apollo::dreamview::util 命名空间参考

class  HMIUtil
 

函数

Map< std::string, std::string > ListFilesAsDict (std::string_view dir, std::string_view extension)
 

函数说明

◆ ListFilesAsDict()

Map< std::string, std::string > apollo::dreamview::util::ListFilesAsDict ( std::string_view  dir,
std::string_view  extension 
)

在文件 hmi_util.cc49 行定义.

50 {
51 Map<std::string, std::string> result;
52 const std::string pattern = absl::StrCat(dir, "/*", extension);
53 for (const std::string &file_path : cyber::common::Glob(pattern)) {
54 // Remove the extension and convert to title case as the file title.
55 const std::string filename = cyber::common::GetFileName(file_path);
56 const std::string file_title = HMIUtil::TitleCase(
57 filename.substr(0, filename.length() - extension.length()));
58 result.insert({file_title, file_path});
59 }
60 return result;
61}