]> git.donarmstrong.com Git - flightcrew.git/blob - src/FlightCrew/flightcrew.h
Imported Upstream version 0.7.2+dfsg
[flightcrew.git] / src / FlightCrew / flightcrew.h
1 /************************************************************************
2 **
3 **  Copyright (C) 2010  Strahinja Markovic
4 **
5 **  This file is part of FlightCrew.
6 **
7 **  FlightCrew is free software: you can redistribute it and/or modify
8 **  it under the terms of the GNU Lesser General Public License as published
9 **  by the Free Software Foundation, either version 3 of the License, or
10 **  (at your option) any later version.
11 **
12 **  FlightCrew is distributed in the hope that it will be useful,
13 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 **  GNU Lesser General Public License for more details.
16 **
17 **  You should have received a copy of the GNU Lesser General Public License
18 **  along with FlightCrew.  If not, see <http://www.gnu.org/licenses/>.
19 **
20 *************************************************************************/
21
22 #pragma once
23 #ifndef FLIGHTCREW_H
24 #define FLIGHTCREW_H
25
26 #include <vector>
27 #include <string>
28 #include "DllExporting.h"
29 #include "Result.h"
30 #include "exception.h"
31
32 namespace FlightCrew
33 {
34
35 /**
36  * Validates the provided epub file, running all the checks that FlightCrew 
37  * can perform. This includes all the OPF, NCX, XHTML and CSS checks.
38  *
39  * @param filepath A UTF-8 encoded path to the epub file to validate.
40  *                 The path can be either absolute or relative to the 
41  *                 current working directory.
42  * @return A vector of Results, sorted by internal file and then by line number.
43  */
44 FC_WIN_DLL_API std::vector< Result > ValidateEpub( const std::string &filepath );
45
46 /**
47  * Same as ValidateEpub(), except that it accepts a path to the root folder of an
48  * already extracted epub publication.
49  *
50  * @param filepath A UTF-8 encoded path to the epub root folder to validate.
51  *                 The path can be either absolute or relative to the 
52  *                 current working directory.
53  * @return A vector of Results, sorted by internal file and then by line number.
54  */
55 FC_WIN_DLL_API std::vector< Result > ValidateEpubRootFolder( const std::string &root_folder_path );
56
57 /**
58  * Validates the provided OPF file of an epub. The files that are listed in the
59  * OPF are expected to exist.
60  *
61  * @param filepath A UTF-8 encoded path to the OPF file to validate.
62  *                 The path can be either absolute or relative to the 
63  *                 current working directory.
64  * @return A vector of Results, sorted by internal file and then by line number.
65  */
66 FC_WIN_DLL_API std::vector< Result > ValidateOpf( const std::string &filepath );
67
68 /**
69  * Validates the provided NCX file of an epub. The files that are listed in the
70  * NCX are expected to exist.
71  *
72  * @param filepath A UTF-8 encoded path to the NCX file to validate.
73  *                 The path can be either absolute or relative to the 
74  *                 current working directory.
75  * @return A vector of Results, sorted by internal file and then by line number.
76  */
77 FC_WIN_DLL_API std::vector< Result > ValidateNcx( const std::string &filepath );
78
79 /**
80  * Validates the provided XHTML file of an epub. The resources linked from the file
81  * are expected to exist.
82  *
83  * @param filepath A UTF-8 encoded path to the XHTML file to validate.
84  *                 The path can be either absolute or relative to the 
85  *                 current working directory.
86  * @return A vector of Results, sorted by internal file and then by line number.
87  */
88 FC_WIN_DLL_API std::vector< Result > ValidateXhtml( const std::string &filepath );
89
90 /**
91  * Validates the provided CSS file of an epub. The resources linked from the file
92  * are expected to exist. NOTE: this function is currently a stub. It doesn't really
93  * do anything (yet).
94  *
95  * @param filepath A UTF-8 encoded path to the CSS file to validate.
96  *                 The path can be either absolute or relative to the 
97  *                 current working directory.
98  * @return A vector of Results, sorted by internal file and then by line number.
99  */
100 FC_WIN_DLL_API std::vector< Result > ValidateCss( const std::string &filepath );
101
102 } // namespace FlightCrew
103
104 #endif // FLIGHTCREW_H