CARLA
Static Public Member Functions | List of all members
carla::FileSystem Class Reference

Static functions for accessing the file system. More...

#include <FileSystem.h>

Static Public Member Functions

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. More...
 
static void ValidateFilePath (std::string &filepath, const std::string &default_extension="")
 Convenient function to validate a path before creating a file. More...
 

Detailed Description

Static functions for accessing the file system.

Warning
Using this file requires linking against boost_filesystem.

Definition at line 17 of file FileSystem.h.

Member Function Documentation

◆ ListFolder()

std::vector< std::string > carla::FileSystem::ListFolder ( const std::string &  folder_path,
const std::string &  wildcard_pattern 
)
static

List (not recursively) regular files at folder_path matching wildcard_pattern.

Exceptions
std::invalid_argumentif folder does not exist.
Todo:
Do permission check.

Definition at line 33 of file FileSystem.cpp.

References carla::StringUtil::Match(), and carla::throw_exception().

Referenced by util::OpenDrive::GetAvailableFiles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ValidateFilePath()

void carla::FileSystem::ValidateFilePath ( std::string &  filepath,
const std::string &  default_extension = "" 
)
static

Convenient function to validate a path before creating a file.

1) Ensures all the parent directories are created if missing. 2) If filepath is missing the extension, default_extension is appended to the path.

Definition at line 18 of file FileSystem.cpp.

Referenced by carla::pointcloud::PointCloudIO::SaveToDisk(), carla::image::io::detail::io_resolver::write_view(), and carla::client::FileTransfer::WriteFile().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: