pub struct CatalogLoader { /* private fields */ }Expand description
Catalog file loader that handles file system operations
Implementations§
Source§impl CatalogLoader
impl CatalogLoader
Sourcepub fn with_base_path<P: AsRef<Path>>(base_path: P) -> Self
pub fn with_base_path<P: AsRef<Path>>(base_path: P) -> Self
Create a catalog loader with a specific base path
Sourcepub fn set_base_path<P: AsRef<Path>>(&mut self, base_path: P)
pub fn set_base_path<P: AsRef<Path>>(&mut self, base_path: P)
Set the base path for resolving relative paths
Sourcepub fn discover_catalog_files(
&self,
directory: &Directory,
) -> Result<Vec<PathBuf>>
pub fn discover_catalog_files( &self, directory: &Directory, ) -> Result<Vec<PathBuf>>
Discover all .xosc files in a directory
Sourcepub fn load_catalog_file<P: AsRef<Path>>(&self, file_path: P) -> Result<String>
pub fn load_catalog_file<P: AsRef<Path>>(&self, file_path: P) -> Result<String>
Load and parse a catalog file
Sourcepub fn load_and_parse_catalog_file<P: AsRef<Path>>(
&self,
file_path: P,
) -> Result<CatalogFile>
pub fn load_and_parse_catalog_file<P: AsRef<Path>>( &self, file_path: P, ) -> Result<CatalogFile>
Load and parse a catalog file into a CatalogFile structure
Sourcepub fn parse_catalog_from_string(&self, xml: &str) -> Result<CatalogFile>
pub fn parse_catalog_from_string(&self, xml: &str) -> Result<CatalogFile>
Load and parse a catalog from XML string
Sourcepub fn load_vehicle_catalogs(
&self,
directory: &Directory,
) -> Result<Vec<CatalogVehicle>>
pub fn load_vehicle_catalogs( &self, directory: &Directory, ) -> Result<Vec<CatalogVehicle>>
Load all vehicle catalogs from a directory
Sourcepub fn load_controller_catalogs(
&self,
directory: &Directory,
) -> Result<Vec<CatalogController>>
pub fn load_controller_catalogs( &self, directory: &Directory, ) -> Result<Vec<CatalogController>>
Load all controller catalogs from a directory
Sourcepub fn load_pedestrian_catalogs(
&self,
directory: &Directory,
) -> Result<Vec<CatalogPedestrian>>
pub fn load_pedestrian_catalogs( &self, directory: &Directory, ) -> Result<Vec<CatalogPedestrian>>
Load all pedestrian catalogs from a directory
Sourcepub fn find_entity_in_catalog<P: AsRef<Path>>(
&self,
file_path: P,
entity_name: &str,
) -> Result<Option<String>>
pub fn find_entity_in_catalog<P: AsRef<Path>>( &self, file_path: P, entity_name: &str, ) -> Result<Option<String>>
Find a specific entity in a catalog file
Sourcepub fn load_controller_catalog<P: AsRef<Path>>(
&self,
file_path: P,
) -> Result<ControllerCatalog>
pub fn load_controller_catalog<P: AsRef<Path>>( &self, file_path: P, ) -> Result<ControllerCatalog>
Load a specific controller catalog from a file
Sourcepub fn load_trajectory_catalog<P: AsRef<Path>>(
&self,
file_path: P,
) -> Result<TrajectoryCatalog>
pub fn load_trajectory_catalog<P: AsRef<Path>>( &self, file_path: P, ) -> Result<TrajectoryCatalog>
Load a specific trajectory catalog from a file
Sourcepub fn load_route_catalog<P: AsRef<Path>>(
&self,
file_path: P,
) -> Result<RouteCatalog>
pub fn load_route_catalog<P: AsRef<Path>>( &self, file_path: P, ) -> Result<RouteCatalog>
Load a specific route catalog from a file
Sourcepub fn load_environment_catalog<P: AsRef<Path>>(
&self,
file_path: P,
) -> Result<EnvironmentCatalog>
pub fn load_environment_catalog<P: AsRef<Path>>( &self, file_path: P, ) -> Result<EnvironmentCatalog>
Load a specific environment catalog from a file
Sourcepub fn load_controller_catalogs_from_directory(
&self,
directory: &Directory,
) -> Result<HashMap<String, ControllerCatalog>>
pub fn load_controller_catalogs_from_directory( &self, directory: &Directory, ) -> Result<HashMap<String, ControllerCatalog>>
Load all controller catalogs from a directory and return them as a hashmap
Sourcepub fn load_trajectory_catalogs_from_directory(
&self,
directory: &Directory,
) -> Result<HashMap<String, TrajectoryCatalog>>
pub fn load_trajectory_catalogs_from_directory( &self, directory: &Directory, ) -> Result<HashMap<String, TrajectoryCatalog>>
Load all trajectory catalogs from a directory and return them as a hashmap
Sourcepub fn load_route_catalogs_from_directory(
&self,
directory: &Directory,
) -> Result<HashMap<String, RouteCatalog>>
pub fn load_route_catalogs_from_directory( &self, directory: &Directory, ) -> Result<HashMap<String, RouteCatalog>>
Load all route catalogs from a directory and return them as a hashmap
Sourcepub fn load_environment_catalogs_from_directory(
&self,
directory: &Directory,
) -> Result<HashMap<String, EnvironmentCatalog>>
pub fn load_environment_catalogs_from_directory( &self, directory: &Directory, ) -> Result<HashMap<String, EnvironmentCatalog>>
Load all environment catalogs from a directory and return them as a hashmap
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CatalogLoader
impl RefUnwindSafe for CatalogLoader
impl Send for CatalogLoader
impl Sync for CatalogLoader
impl Unpin for CatalogLoader
impl UnsafeUnpin for CatalogLoader
impl UnwindSafe for CatalogLoader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more