CARLA
载入中...
搜索中...
未找到
LibCarla
source
test
client
LibCarla/source/test/client/OpenDrive.cpp
浏览该文件的文档.
1
// Copyright (c) 2019 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 "
OpenDrive.h
"
8
9
#ifndef LIBCARLA_TEST_CONTENT_FOLDER
10
# error Please define LIBCARLA_TEST_CONTENT_FOLDER.
11
#endif
12
13
#include <
carla/FileSystem.h
>
14
15
#include <fstream>
16
#include <streambuf>
17
18
namespace
util
{
19
20
std::vector<std::string>
OpenDrive::GetAvailableFiles
() {
21
return
carla::FileSystem::ListFolder
(
22
LIBCARLA_TEST_CONTENT_FOLDER
"/OpenDrive/"
,
23
"*.xodr"
);
24
}
25
26
std::string
OpenDrive::Load
(
const
std::string &filename) {
27
const
std::string opendrive_folder = LIBCARLA_TEST_CONTENT_FOLDER
"/OpenDrive/"
;
28
std::ifstream file(opendrive_folder + filename);
29
return
std::string{std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>()};
30
}
31
32
}
// namespace util
FileSystem.h
OpenDrive.h
carla::FileSystem::ListFolder
static std::vector< std::string > ListFolder(const std::string &folder_path, const std::string &wildcard_pattern)
List (not recursively) regular files at folder_path matching wildcard_pattern.
Definition
FileSystem.cpp:33
util::OpenDrive::GetAvailableFiles
static std::vector< std::string > GetAvailableFiles()
Definition
LibCarla/source/test/client/OpenDrive.cpp:20
util::OpenDrive::Load
static std::string Load(const std::string &filename)
Definition
LibCarla/source/test/client/OpenDrive.cpp:26
util
Definition
test/Buffer.cpp:14
制作者
1.10.0