anfo  1.0
Season.h
Go to the documentation of this file.
1 #ifndef _ANFO_SEASON_
2 #define _ANFO_SEASON_
3 
4 #include <iostream>
5 #include <fstream>
6 #include <string>
7 #include <list>
8 #include <anfo/Exception.h>
9 
11 
16 namespace anfo
17 {
19 
24  class Season
25  {
26  private:
27  // Generally Information
29  unsigned int seasonNumber;
30 
32  unsigned int type;
33 
35  unsigned int episodes;
36 
38  unsigned int ageLimit;
39 
41  std::string name;
42 
44  std::string secondName;
45 
47  std::string genre;
48 
50  std::string description;
51 
53  std::string language;
54 
56  std::string subtitle;
57 
59  std::string foldername;
60 
61  // Personally Information
63  unsigned int watched;
64 
66  std::list<std::string> seenEpisodes;
67 
69  unsigned char rating;
70 
71  public:
72  enum
73  {
75  SEASON = 1,
76 
79 
81  OVA,
82 
85 
86  // A invalid type
88  };
89 
90  // Basic functions
91 
93 
96  Season();
97 
99 
105 
107 
110  void saveToFile(std::ofstream &saveStream);
111 
113 
117  void loadFromFile(std::ifstream &loadStream);
118 
119  // Manipulating functions
120 
122 
125  unsigned int getSeasonNumber();
126 
128 
132  unsigned int getType();
133 
135 
138  unsigned int getEpisodes();
139 
141 
144  unsigned int getAgeLimit();
145 
147 
150  std::string getName();
151 
153 
156  std::string getSecondName();
157 
159 
162  std::string getGenre();
163 
165 
168  std::string getDescription();
169 
171 
174  std::string getLanguage();
175 
177 
180  std::string getSubtitle();
181 
183 
186  std::string getFoldername();
187 
189 
192  unsigned int getWatched();
193 
195 
198  std::list<std::string> &getSeenEpisodes();
199 
201 
204  unsigned char getRating();
205 
207 
210  void setSeasonNumber(unsigned int _seasonNumber);
211 
213 
217  void setType(unsigned int _type);
218 
220 
223  void setEpisodes(unsigned int _episodes);
224 
226 
229  void setAgeLimit(unsigned int _ageLimit);
230 
232 
235  void setName(std::string _name);
236 
238 
241  void setSecondName(std::string _secondName);
242 
244 
247  void setGenre(std::string _genre);
248 
250 
253  void setDescription(std::string _description);
254 
256 
259  void setLanguage(std::string _language);
260 
262 
265  void setSubtitle(std::string _subtitle);
266 
268 
271  void setFoldername(std::string _foldername);
272 
274 
277  void setWatched(unsigned int _watched);
278 
280 
283  void setSeenEpisodes(std::list<std::string> _seenEpisodes);
284 
286 
289  void addSeenEpisode(std::string _seenEpisode);
290 
292 
295  void setRating(unsigned char _rating);
296  };
297 
299 
305  {
306  private:
308  char anseasonMark[8];
309 
311  unsigned int sizeOfName;
312 
314  unsigned int sizeOfSecondName;
315 
317  unsigned int sizeOfGenre;
318 
320  unsigned int sizeOfDescription;
321 
323  unsigned int sizeOfLanguage;
324 
326  unsigned int sizeOfSubtitle;
327 
329  unsigned int sizeOfFoldername;
330 
332  unsigned int sizeOfSeenEpisodes;
333 
335  char anvaluesMark[8];
336 
337  public:
339 
342  SeasonHeader();
343 
345 
349  SeasonHeader(Season *season);
350 
352 
355  unsigned int getSizeOfName();
356 
358 
361  unsigned int getSizeOfSecondName();
362 
364 
367  unsigned int getSizeOfGenre();
368 
370 
373  unsigned int getSizeOfDescription();
374 
376 
379  unsigned int getSizeOfLanguage();
380 
382 
385  unsigned int getSizeOfSubtitle();
386 
388 
391  unsigned int getSizeOfFoldername();
392 
394 
397  unsigned int getSizeOfSeenEpisodes();
398 
400 
403  bool checkMarks();
404  };
405 };
406 
407 #endif
unsigned int getSizeOfSeenEpisodes()
Get the string length of the seen episodes.
std::string getLanguage()
Get the language of the videos of this season.
unsigned int sizeOfName
The string length of the name (with the zero byte)
Definition: Season.h:311
void setName(std::string _name)
Set the name of this season.
unsigned int getSizeOfLanguage()
Get the string length of the language.
std::string getSubtitle()
Get the language of the subtitles of the season.
unsigned int sizeOfFoldername
The string length of the folder name (with the zero byte)
Definition: Season.h:329
void setGenre(std::string _genre)
Set the genre of this season.
A season.
Definition: Season.h:75
std::string genre
The genre(s) of the season.
Definition: Season.h:47
std::string name
The name of this season.
Definition: Season.h:41
std::string getFoldername()
Get the Foldername where the video files are stored.
char anseasonMark[8]
The mark of the beginning of a season header. Needs to be 'ANSEASON'.
Definition: Season.h:308
std::string getGenre()
Get the genre of this season.
SeasonHeader()
Empty constructor.
unsigned int seasonNumber
The season number (e.g. season 1, season 2, ...)
Definition: Season.h:29
unsigned int sizeOfLanguage
The string length of the language (with the zero byte)
Definition: Season.h:323
void setSubtitle(std::string _subtitle)
Set the subtitles language of this season.
void setRating(unsigned char _rating)
Set a rating for this season.
unsigned int sizeOfGenre
The string length of the genre (with the zero byte)
Definition: Season.h:317
std::string language
The language(s) of the video files of the season.
Definition: Season.h:53
void clearPersonallyInformations()
Deletes the personally informations.
void loadFromFile(std::ifstream &loadStream)
Loads the season from a file stream.
void setDescription(std::string _description)
Set the description of this season.
unsigned int sizeOfSeenEpisodes
The string length of seen episodes (with the zero byte)
Definition: Season.h:332
std::string description
A description about the season.
Definition: Season.h:50
std::list< std::string > seenEpisodes
List of the seen Episodes (File names)
Definition: Season.h:66
Season header in the file.
Definition: Season.h:304
void setSeenEpisodes(std::list< std::string > _seenEpisodes)
Set the list of seen episodes.
unsigned int getSizeOfFoldername()
Get the string length of the folder name.
void addSeenEpisode(std::string _seenEpisode)
Add a seen episode to this list.
unsigned int sizeOfSecondName
The string length of the second name (with the zero byte)
Definition: Season.h:314
unsigned int getSizeOfDescription()
Get the string length of the description.
unsigned int getType()
Get the Type.
unsigned char rating
A rating from 0 (0.0, worst) until 100 (10.0, best)
Definition: Season.h:69
void setSeasonNumber(unsigned int _seasonNumber)
Set the season number.
void setFoldername(std::string _foldername)
Set the folder name, where the files are stored.
unsigned int type
The season type (OVA, Movie, Season, ...)
Definition: Season.h:32
unsigned int getSizeOfSecondName()
Get the string length of the second name.
unsigned int getSeasonNumber()
Get the season number.
unsigned int getSizeOfName()
Get the string length of the name.
unsigned int getEpisodes()
Get the number of episodes in this season.
unsigned int episodes
The number of episodes in this season (0, if unknown or continued)
Definition: Season.h:35
std::string getSecondName()
Get the alternative name of this season.
void saveToFile(std::ofstream &saveStream)
Saves the season to a file stream.
A folder with ovas.
Definition: Season.h:81
unsigned int getWatched()
Get the number of seen episodes.
unsigned char getRating()
Get the rating of this season.
std::string subtitle
The language(s) of the subtitles of the season.
Definition: Season.h:56
std::string foldername
The folder where the video files are stored.
Definition: Season.h:59
bool checkMarks()
Check the header of errors.
Class to manage seasons.
Definition: Season.h:24
unsigned int getSizeOfSubtitle()
Get the string length of the subtitles.
unsigned int sizeOfDescription
The string length of the description (with the zero byte)
Definition: Season.h:320
void setLanguage(std::string _language)
Set the language of this season.
std::string secondName
An alternative name, the japanese name for example.
Definition: Season.h:44
std::string getDescription()
Get the Description of this season.
void setType(unsigned int _type)
Set the type of this season.
void setAgeLimit(unsigned int _ageLimit)
Set the age limit of this season.
A folder with special episodes.
Definition: Season.h:78
void setSecondName(std::string _secondName)
Set the alternative name of this season.
std::list< std::string > & getSeenEpisodes()
Get the list of seen episodes.
char anvaluesMark[8]
The mark on the beginning of the string block. Needs to be 'ANVALUES'.
Definition: Season.h:335
Season()
Constructor.
void setEpisodes(unsigned int _episodes)
Set the number of episodes this season contains.
unsigned int getSizeOfGenre()
Get the string length of the genre.
unsigned int getAgeLimit()
Get the minimum age to watch this anime.
A folder with movies.
Definition: Season.h:84
unsigned int ageLimit
The minimum age for watching this anime.
Definition: Season.h:38
unsigned int watched
0 = unwatched, else = unixtime you have watched it
Definition: Season.h:63
unsigned int sizeOfSubtitle
The string length of the subtitle language (with the zero byte)
Definition: Season.h:326
void setWatched(unsigned int _watched)
Set if the season is watched.
std::string getName()
Get the name of this season.