Go to the documentation of this file.
3 #include <boost/filesystem.hpp>
8 namespace fs = boost::filesystem;
12 std::string extension(
const std::string& path) {
return fs::path(path).extension().string(); }
14 template <
typename ExceptionT>
16 if (targetErrs !=
nullptr) {
18 }
else if (!errors.empty()) {
19 throw ExceptionT(errors);
31 if (!fs::exists(fs::path(filename))) {
37 handleErrorsOrThrow<ParseError>(err, errors);
41 std::unique_ptr<LaneletMap>
load(
const std::string& filename,
const std::string& parserName,
const Origin& origin,
46 std::unique_ptr<LaneletMap>
load(
const std::string& filename,
const std::string& parserName,
const Projector& projector,
48 if (!fs::exists(fs::path(filename))) {
53 handleErrorsOrThrow<ParseError>(err, errors);
68 handleErrorsOrThrow<WriteError>(err, errors);
75 void write(
const std::string& filename,
const LaneletMap& map,
const std::string& writerName,
79 handleErrorsOrThrow<WriteError>(err, errors);
static std::vector< std::string > availableExtensions()
returns all available extensions as vector
std::vector< std::string > ErrorMessages
std::vector< std::string > supportedWriters()
returns the names of the currently registered writing (writers from plugins included)
static std::vector< std::string > availableParsers()
returns all available parsers as vector
static Parser::Ptr createFromExtension(const std::string &extension, const Projector &projector, const io::Configuration &config=io::Configuration())
creates a matching parser for the given file extension
std::map< std::string, Attribute > Configuration
std::vector< std::string > supportedWriterExtensions()
returns the names of the currently supported extensions for writing (including the dot)
static Writer::Ptr create(const std::string &writerName, const Projector &projector, const io::Configuration &config=io::Configuration())
creates a writer that matches the given name.
std::unique_ptr< LaneletMap > load(const std::string &filename, const Origin &origin=Origin::defaultOrigin(), ErrorMessages *errors=nullptr, const io::Configuration ¶ms=io::Configuration())
Loads a lanelet map from a file.
Error for not existent filepaths.
void write(const std::string &filename, const lanelet::LaneletMap &map, const Origin &origin=Origin::defaultOrigin(), ErrorMessages *errors=nullptr, const io::Configuration ¶ms=io::Configuration())
writes a map to a file
static Writer::Ptr createFromExtension(const std::string &extension, const Projector &projector, const io::Configuration &config=io::Configuration())
creates a matching writer for the given file extension
static Parser::Ptr create(const std::string &parserName, const Projector &projector, const io::Configuration &config=io::Configuration())
creates a parser that matches the given name.
std::vector< std::string > supportedParserExtensions()
DefaultProjector defaultProjection(Origin origin=Origin::defaultOrigin())
static std::vector< std::string > availableExtensions()
returns all available extensions as vector
static std::vector< std::string > availableWriters()
returns all available writers as vector
std::vector< std::string > supportedParsers()
returns the names of the currently registered parsers (parsers from plugins included)
lanelet2_io
Author(s): Fabian Poggenhans
autogenerated on Thu Mar 6 2025 03:26:03