anfo  1.0
Anime.h
Go to the documentation of this file.
1 #ifndef _ANFO_ANIME_
2 #define _ANFO_ANIME_
3 
4 #include <iostream>
5 #include <fstream>
6 #include <string>
7 #include <list>
8 #include <anfo/Season.h>
9 #include <anfo/Constants.h>
10 
12 
17 namespace anfo
18 {
20 
25  class Anime
26  {
27  private:
28  // Public Information
30  std::string name;
31 
33  std::string secondName;
34 
36  std::string coverName;
37 
39  std::list<Season> seasons;
40 
41  public:
42  // Basic functions
44 
47  Anime();
48 
50 
55  Anime(std::string filename);
56 
58 
63  void load(std::string filename);
64 
66 
70  void save();
71 
73 
78  void save(std::string filename);
79 
80  // Manipulating functions
82 
85  std::string getName() const;
86 
88 
91  std::string getSecondName() const;
92 
94 
99  std::string getCoverName() const;
100 
102 
105  std::list<Season>& getSeasonList();
106 
108 
111  unsigned int getSeasonCount();
112 
114 
117  void setName(std::string _name);
118 
120 
125  void setSecondName(std::string _secondName);
126 
128 
131  void setCoverName(std::string _coverName);
132  };
133 
134 
135 
137 
144  {
145  private:
147  char anfoMark[4];
148 
150  unsigned int versionMajor;
151 
153  unsigned int versionMinor;
154 
156  unsigned int sizeOfName;
157 
159  unsigned int sizeOfSecondName;
160 
162  unsigned int sizeOfCoverName;
163 
165  unsigned int numberOfSeasons;
166 
168  char reserved[128];
169 
171  char anvaluesMark[8];
172 
173  public:
175 
178  AnimeHeader();
179 
181 
185  AnimeHeader(Anime *anime);
186 
188 
191  unsigned int getVersionMajor();
192 
194 
197  unsigned int getVersionMinor();
198 
200 
203  unsigned int getSizeOfName();
204 
206 
209  unsigned int getSizeOfSecondName();
210 
212 
215  unsigned int getSizeOfCoverName();
216 
218 
221  unsigned int getNumberOfSeasons();
222 
224 
227  bool checkMarks();
228  };
229 };
230 
231 #endif
Anime()
Empty constructor.
unsigned int getVersionMinor()
Get the minor version.
unsigned int getSeasonCount()
Returns the number of seasons.
unsigned int versionMajor
The major version of the file.
Definition: Anime.h:150
AnimeHeader()
Empty constructor.
bool checkMarks()
Check the header of errors.
unsigned int getSizeOfName()
Get the size of the name string (with the zero byte)
void save()
Methode to save an anfo file.
unsigned int getSizeOfCoverName()
Get the size of the cover file name (with the zero byte)
void load(std::string filename)
Methode to load an anfo file.
unsigned int sizeOfCoverName
The size of the cover name.
Definition: Anime.h:162
void setCoverName(std::string _coverName)
Sets the name of the cover file.
unsigned int versionMinor
The minor version of the file.
Definition: Anime.h:153
std::string getName() const
Returns the name of the anime.
char anfoMark[4]
The mark to beginning of an file. Needs to be 'ANFO'.
Definition: Anime.h:147
std::list< Season > & getSeasonList()
Returns a list with the seasons.
std::string coverName
The name of the cover file (for example 'cover.jpg')
Definition: Anime.h:36
unsigned int getSizeOfSecondName()
Get the size of the second name string (with the zero byte)
unsigned int numberOfSeasons
The number of seasons.
Definition: Anime.h:165
unsigned int sizeOfName
The size of the name.
Definition: Anime.h:156
void setSecondName(std::string _secondName)
Sets the second name of the anime.
char anvaluesMark[8]
The mark of the beginning of the string values. Needs to be 'ANVALUE'.
Definition: Anime.h:171
Class to manage animes.
Definition: Anime.h:25
std::string name
The name of the anime.
Definition: Anime.h:30
void setName(std::string _name)
Sets the name of the anime.
std::string getSecondName() const
Returns the second name of the anime.
unsigned int getVersionMajor()
Get the major version.
unsigned int getNumberOfSeasons()
Get the number of seasons.
std::string getCoverName() const
Returns the name of the cover file.
Anime header in the file.
Definition: Anime.h:143
char reserved[128]
Reserved bytes for future versions.
Definition: Anime.h:168
unsigned int sizeOfSecondName
The size of the second name.
Definition: Anime.h:159
std::list< Season > seasons
The seasons/specials/ova's of the anime.
Definition: Anime.h:39
std::string secondName
An alternative name, the japanese name for example.
Definition: Anime.h:33