HoverRace  2.0
Public Member Functions | Private Types | List of all members
HoverRace::Parcel::TrackBundle Class Reference

A source of track parcels. More...

#include <TrackBundle.h>

+ Inheritance diagram for HoverRace::Parcel::TrackBundle:

Public Member Functions

 TrackBundle (const Util::OS::path_t &dir, std::shared_ptr< Bundle > subBundle=std::shared_ptr< Bundle >())
 
virtual ~TrackBundle ()
 
MR_TrackAvail CheckAvail (const std::string &name) const
 Check if a track is available. More...
 
std::shared_ptr< Display::Res< Display::Texture > > LoadMap (std::shared_ptr< const Model::TrackEntry > entry) const
 
std::shared_ptr< RecordFileOpenParcel (const std::string &name, bool writing=false) const override
 Open an existing parcel. More...
 
std::shared_ptr< Model::TrackOpenTrack (const std::string &name) const
 Load a track by name. More...
 
std::shared_ptr< Model::TrackOpenTrack (const std::shared_ptr< const Model::TrackEntry > &entry) const
 Load a track by track header. More...
 
std::shared_ptr< Model::TrackEntryOpenTrackEntry (const std::string &name) const
 Load a track header. More...
 
- Public Member Functions inherited from HoverRace::Parcel::Bundle
 Bundle (const Util::OS::path_t &dir, std::shared_ptr< Bundle > subBundle=std::shared_ptr< Bundle >())
 Constructor. More...
 
virtual ~Bundle ()
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
iterator end ()
 
const_iterator end () const
 

Private Types

using SUPER = Bundle
 

Additional Inherited Members

- Public Types inherited from HoverRace::Parcel::Bundle
using const_iterator = Iterator
 
using iterator = Iterator
 
using value_type = Util::OS::dirEnt_t
 

Detailed Description

A source of track parcels.

Author
Michael Imamura

Member Typedef Documentation

Constructor & Destructor Documentation

HoverRace::Parcel::TrackBundle::TrackBundle ( const Util::OS::path_t dir,
std::shared_ptr< Bundle subBundle = std::shared_ptr<Bundle>() 
)
virtual HoverRace::Parcel::TrackBundle::~TrackBundle ( )
inlinevirtual

Member Function Documentation

MR_TrackAvail HoverRace::Parcel::TrackBundle::CheckAvail ( const std::string &  name) const

Check if a track is available.

Parameters
nameThe name of the track. The ".trk" suffix may be omitted.
Returns
eTrackAvail if the track is available, eTrackNotFound otherwise.
std::shared_ptr< Display::Res< Display::Texture > > HoverRace::Parcel::TrackBundle::LoadMap ( std::shared_ptr< const Model::TrackEntry entry) const
std::shared_ptr< RecordFile > HoverRace::Parcel::TrackBundle::OpenParcel ( const std::string &  name,
bool  writing = false 
) const
overridevirtual

Open an existing parcel.

All parcels, including sub-bundles, will be searched.

Parameters
nameThe name of the parcel.
writingtrue if the parcel will be written to, false if read-only.
Returns
The parcel (may be nullptr if parcel does not exist).

Reimplemented from HoverRace::Parcel::Bundle.

std::shared_ptr< Model::Track > HoverRace::Parcel::TrackBundle::OpenTrack ( const std::string &  name) const

Load a track by name.

Parameters
nameThe name of the track. The ".trk" suffix may be omitted.
Returns
The track or nullptr if the track does not exist.
Exceptions
ObjStreamExnThe track failed to load.
std::shared_ptr< Model::Track > HoverRace::Parcel::TrackBundle::OpenTrack ( const std::shared_ptr< const Model::TrackEntry > &  entry) const

Load a track by track header.

Parameters
entryThe entry for the track (may not be nullptr, see OpenTrackEntry()).
Returns
The track or nullptr if the track does not exist.
Exceptions
ObjStreamExnThe track failed to load.
std::shared_ptr< Model::TrackEntry > HoverRace::Parcel::TrackBundle::OpenTrackEntry ( const std::string &  name) const

Load a track header.

Parameters
nameThe name of the track. The ".trk" suffix may be omitted.
Returns
The track or nullptr if the track does not exist.
Exceptions
ObjStreamExnThe track failed to load.

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