CARLA
载入中...
搜索中...
未找到
LibCarla
source
carla
FileSystem.h
浏览该文件的文档.
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
#pragma once
8
9
#include <string>
10
#include <vector>
11
12
namespace
carla
{
13
14
/// 用于访问文件系统的静态函数。
15
///
16
/// @warning 使用此文件需要链接 boost_filesystem。
17
class
FileSystem
{
18
public
:
19
20
///在创建文件之前验证路径的方便函数。
21
///
22
/// 1) 确保所有缺失的父目录被创建。
23
/// 2) 如果 @a filepath 缺少扩展名,则将 @a default_extension
24
/// 附加到路径上。
25
static
void
ValidateFilePath
(
26
std::string &filepath,
27
const
std::string &default_extension =
""
);
28
29
///列出 @a folder_path 中匹配 @a wildcard_pattern 的常规文件
30
/// (不递归)。
31
///
32
/// @throw std::invalid_argument 如果文件夹不存在。
33
///
34
/// @todo 进行权限检查。
35
static
std::vector<std::string>
ListFolder
(
36
const
std::string &folder_path,
37
const
std::string &wildcard_pattern);
38
};
39
40
}
// namespace carla
carla::FileSystem
用于访问文件系统的静态函数。
Definition
FileSystem.h:17
carla::FileSystem::ListFolder
static std::vector< std::string > ListFolder(const std::string &folder_path, const std::string &wildcard_pattern)
列出 folder_path 中匹配 wildcard_pattern 的常规文件 (不递归)。
Definition
FileSystem.cpp:46
carla::FileSystem::ValidateFilePath
static void ValidateFilePath(std::string &filepath, const std::string &default_extension="")
在创建文件之前验证路径的方便函数。
Definition
FileSystem.cpp:27
carla
CARLA模拟器的主命名空间。
Definition
Carla.cpp:139
制作者
1.10.0