Symphony Of Empires
Eng3D::IO::PackageManager Class Reference

#include <io.hpp>

Public Member Functions

 PackageManager ()=delete
 
 PackageManager (Eng3D::State &s, const std::vector< std::string > &pkg_paths)
 
 ~PackageManager ()=default
 
void recursive_filesystem_walk (Eng3D::IO::Package &package, const std::string &root, const std::string &current)
 
std::shared_ptr< Eng3D::IO::Asset::Baseget_unique (const Eng3D::IO::Path &path)
 Obtaining an unique asset means the "first-found" policy applies. More...
 
std::vector< std::shared_ptr< Eng3D::IO::Asset::Base > > get_multiple (const Eng3D::IO::Path &path)
 Obtains multiple assets iff they share a common path (useful for concating files that might clash, such as lua scripts) More...
 
std::vector< std::shared_ptr< Eng3D::IO::Asset::Base > > get_multiple_prefix (const Eng3D::IO::Path &path)
 Obtains all assets starting with a given prefix. More...
 
std::vector< std::string > get_paths (void) const
 Obtain all the paths that are currently under the management of a package, that is return the absolute root directory of all packages. More...
 

Public Attributes

std::vector< Packagepackages
 

Detailed Description

Definition at line 132 of file io.hpp.

Constructor & Destructor Documentation

◆ PackageManager() [1/2]

Eng3D::IO::PackageManager::PackageManager ( )
delete

◆ PackageManager() [2/2]

Eng3D::IO::PackageManager::PackageManager ( Eng3D::State s,
const std::vector< std::string > &  pkg_paths 
)

Definition at line 117 of file io.cpp.

◆ ~PackageManager()

Eng3D::IO::PackageManager::~PackageManager ( )
default

Member Function Documentation

◆ get_multiple()

std::vector< std::shared_ptr< Eng3D::IO::Asset::Base > > Eng3D::IO::PackageManager::get_multiple ( const Eng3D::IO::Path path)

Obtains multiple assets iff they share a common path (useful for concating files that might clash, such as lua scripts)

Parameters
path
Returns
std::vector<std::shared_ptr<Eng3D::IO::Asset::Base>>

Definition at line 157 of file io.cpp.

◆ get_multiple_prefix()

std::vector< std::shared_ptr< Eng3D::IO::Asset::Base > > Eng3D::IO::PackageManager::get_multiple_prefix ( const Eng3D::IO::Path prefix)

Obtains all assets starting with a given prefix.

Parameters
prefixThe prefix to check for
Returns
std::vector<std::shared_ptr<Eng3D::IO::Asset::Base>>

Definition at line 169 of file io.cpp.

Here is the caller graph for this function:

◆ get_paths()

std::vector< std::string > Eng3D::IO::PackageManager::get_paths ( void  ) const

Obtain all the paths that are currently under the management of a package, that is return the absolute root directory of all packages.

Returns
std::vector<std::string> The list of paths

Definition at line 181 of file io.cpp.

◆ get_unique()

std::shared_ptr< Eng3D::IO::Asset::Base > Eng3D::IO::PackageManager::get_unique ( const Eng3D::IO::Path path)

Obtaining an unique asset means the "first-found" policy applies.

Parameters
pathThe path to obtain
Returns
std::shared_ptr<Eng3D::IO::Asset::Base> Obtained asset object

Definition at line 146 of file io.cpp.

Here is the caller graph for this function:

◆ recursive_filesystem_walk()

void Eng3D::IO::PackageManager::recursive_filesystem_walk ( Eng3D::IO::Package package,
const std::string &  root,
const std::string &  current 
)

Definition at line 87 of file io.cpp.

Member Data Documentation

◆ packages

std::vector<Package> Eng3D::IO::PackageManager::packages

Definition at line 144 of file io.hpp.


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