8#include "carla/Version.h"
20 if (path.empty())
return false;
23 if (path[path.size() - 1] !=
'/' && path[path.size() - 1] !=
'\\') {
39 fullpath += ::carla::version();
43 return (stat(fullpath.c_str(), &buffer) == 0);
49 writePath += ::carla::version();
57 std::ofstream out(writePath, std::ios::trunc | std::ios::binary);
58 if(!out.good())
return false;
61 for(
auto file : content) {
72 fullpath += ::carla::version();
76 std::ifstream file(fullpath, std::ios::binary);
77 std::vector<uint8_t> content(std::istreambuf_iterator<char>(file), {});
static void ValidateFilePath(std::string &filepath, const std::string &default_extension="")
Convenient function to validate a path before creating a file.
static std::vector< uint8_t > ReadFile(std::string path)
static bool FileExists(std::string file)
static bool SetFilesBaseFolder(const std::string &path)
static const std::string & GetFilesBaseFolder()
static std::string _filesBaseFolder
static bool WriteFile(std::string path, std::vector< uint8_t > content)
This file contains definitions of common data structures used in traffic manager.