#include <iostream>
#include <vector>
#include <algorithm>
//PARSER_H_
#include <iostream>
//SERIESTRUCT_H_
#include <string>
#include <vector>
#ifndef SERIESTRUCT_H_
#define SERIESTRUCT_H_
class Episode
{
public:
Episode(int nr);
Episode(std::string name, int nr);
Episode(std::string name, int nr, bool watched);
std::string getName() const { return _name; }
int getNr() const { return _episodeNr; }
bool getWatched() const { return _watched; }
void setWatched(bool watched) { _watched = watched; }
std::string changeName(std::string newName);
private:
std::string _name;
unsigned int _episodeNr;
bool _watched;
};
class Season
{
using Iter = std::vector<Episode>::iterator;
public:
Season(int nr) : _seasonNr(nr) {}
int getNr() const { return _seasonNr; }
void changeNr(int newNr) { _seasonNr = newNr; }
Iter begin() { return std::begin(_episodes); }
Iter end() { return std::end(_episodes); }
bool addEpisode(std::string name, int nr);
bool addEpisode(std::string name, int nr, bool watched);
bool operator==(const Season&);
private:
std::vector<Episode> _episodes;
int _seasonNr;
};
class Serie
{
using Iter = std::vector<Season>::iterator;
public:
Serie(std::string name) : _name(name) {}
std::string getName() const { return _name; }
void setName(std::string newName){ _name = newName; }
Iter begin() { return std::begin(_seasons); }
Iter end() { return std::end(_seasons); }
bool addSeason(int nr);
private:
std::vector<Season> _seasons;
std::string _name;
};
#endif
#include <string>
#ifndef FILEPARSER_H_
#define FILEPARSER_H_
enum class lineIdentifier{ OPEN, CLOSE, INFO, ERROR };
template<template <class, class> class ContainerT,
typename Allocator>
void parseToSerie(std::istream& is, ContainerT< Serie, Allocator> cont);
struct lineSyntax
{
std::string first;
std::string second;
lineIdentifier state;
};
//FILEPARSER_TPP_
template<template <class, class> class ContainerT,
typename Allocator>
void parseToSerie(std::istream& is, ContainerT<Serie, Allocator> cont)
{
std::cout << "called" << std::endl;
}
#endif
//SERIESTRUCT_H_
#include <string>
#include <vector>
#ifndef SERIESTRUCT_H_
#define SERIESTRUCT_H_
class Episode
{
public:
Episode(int nr);
Episode(std::string name, int nr);
Episode(std::string name, int nr, bool watched);
std::string getName() const { return _name; }
int getNr() const { return _episodeNr; }
bool getWatched() const { return _watched; }
void setWatched(bool watched) { _watched = watched; }
std::string changeName(std::string newName);
private:
std::string _name;
unsigned int _episodeNr;
bool _watched;
};
class Season
{
using Iter = std::vector<Episode>::iterator;
public:
Season(int nr) : _seasonNr(nr) {}
int getNr() const { return _seasonNr; }
void changeNr(int newNr) { _seasonNr = newNr; }
Iter begin() { return std::begin(_episodes); }
Iter end() { return std::end(_episodes); }
bool addEpisode(std::string name, int nr);
bool addEpisode(std::string name, int nr, bool watched);
bool operator==(const Season&);
private:
std::vector<Episode> _episodes;
int _seasonNr;
};
class Serie
{
using Iter = std::vector<Season>::iterator;
public:
Serie(std::string name) : _name(name) {}
std::string getName() const { return _name; }
void setName(std::string newName){ _name = newName; }
Iter begin() { return std::begin(_seasons); }
Iter end() { return std::end(_seasons); }
bool addSeason(int nr);
private:
std::vector<Season> _seasons;
std::string _name;
};
#endif
int main()
{
std::vector < Serie > serien;
parseToSerie(std::cin, serien);
return 0;
}