Leosac  0.8.0
Open Source Access Control
Leosac::Tools::XmlScheduleLoader Class Reference

Load a list of schedules from a boost::property_tree. More...

#include <XmlScheduleLoader.hpp>

+ Collaboration diagram for Leosac::Tools::XmlScheduleLoader:

Public Member Functions

bool load (const boost::property_tree::ptree &t)
 Load all schedules from a tree and stores them in the map. More...
 
const std::map< std::string, ISchedulePtr > & schedules () const
 Access the map of stored schedules. More...
 

Static Public Member Functions

static int week_day_to_int (const std::string &day)
 Helper function. More...
 

Private Member Functions

bool extract_one (const boost::property_tree::ptree &node)
 Adds a new schedule to the map. More...
 

Private Attributes

std::map< std::string, ISchedulePtrschedules_
 

Detailed Description

Load a list of schedules from a boost::property_tree.

The format is defined here. This class was introduced to avoid code duplication.

Definition at line 36 of file XmlScheduleLoader.hpp.

Member Function Documentation

◆ extract_one()

bool XmlScheduleLoader::extract_one ( const boost::property_tree::ptree &  node)
private

Adds a new schedule to the map.

Definition at line 71 of file XmlScheduleLoader.cpp.

◆ load()

bool XmlScheduleLoader::load ( const boost::property_tree::ptree &  t)

Load all schedules from a tree and stores them in the map.

Definition at line 49 of file XmlScheduleLoader.cpp.

◆ schedules()

const std::map< std::string, ISchedulePtr > & XmlScheduleLoader::schedules ( ) const

Access the map of stored schedules.

Definition at line 111 of file XmlScheduleLoader.cpp.

◆ week_day_to_int()

int XmlScheduleLoader::week_day_to_int ( const std::string &  day)
static

Helper function.

Definition at line 29 of file XmlScheduleLoader.cpp.

Member Data Documentation

◆ schedules_

std::map<std::string, ISchedulePtr> Leosac::Tools::XmlScheduleLoader::schedules_
private

Definition at line 60 of file XmlScheduleLoader.hpp.


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