CARLA
载入中...
搜索中...
未找到
LibCarla
source
carla
StringUtil.cpp
浏览该文件的文档.
1
// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2
// de Barcelona (UAB).
3
//
4
// This work is licensed under the terms of the MIT license.
5
// For a copy, see <https://opensource.org/licenses/MIT>.
6
// 引入字符串工具的头文件
7
#include "
carla/StringUtil.h
"
8
// 根据操作系统选择包含的头文件
9
#ifdef _WIN32
10
# include <shlwapi.h>
// Windows 特定的头文件,用于路径匹配
11
#else
12
# include <fnmatch.h>
// POSIX 标准的头文件,用于模式匹配
13
#endif
// _WIN32
14
15
namespace
carla
{
16
// 实现字符串匹配功能
17
bool
StringUtil::Match
(
const
char
*str,
const
char
*test) {
18
#ifdef _WIN32
19
// 在 Windows 上使用 PathMatchSpecA 函数进行字符串匹配
20
return
PathMatchSpecA(str, test);
21
#else
22
// 在其他平台上使用 fnmatch 函数进行模式匹配
23
return
0 == fnmatch(test, str, 0);
24
#endif
// _WIN32
25
}
26
27
}
// namespace carla
StringUtil.h
carla::StringUtil::Match
static bool Match(const char *str, const char *wildcard_pattern)
Match str with the Unix shell-style wildcard_pattern.
Definition
StringUtil.cpp:17
carla
CARLA模拟器的主命名空间。
Definition
Carla.cpp:139
制作者
1.10.0