1 /************************************************************************
3 ** Copyright (C) 2010 Strahinja Markovic
5 ** This file is part of FlightCrew.
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.
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.
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/>.
20 *************************************************************************/
28 #include "DllExporting.h"
30 #include "exception.h"
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.
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.
44 FC_WIN_DLL_API std::vector< Result > ValidateEpub( const std::string &filepath );
47 * Same as ValidateEpub(), except that it accepts a path to the root folder of an
48 * already extracted epub publication.
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.
55 FC_WIN_DLL_API std::vector< Result > ValidateEpubRootFolder( const std::string &root_folder_path );
58 * Validates the provided OPF file of an epub. The files that are listed in the
59 * OPF are expected to exist.
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.
66 FC_WIN_DLL_API std::vector< Result > ValidateOpf( const std::string &filepath );
69 * Validates the provided NCX file of an epub. The files that are listed in the
70 * NCX are expected to exist.
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.
77 FC_WIN_DLL_API std::vector< Result > ValidateNcx( const std::string &filepath );
80 * Validates the provided XHTML file of an epub. The resources linked from the file
81 * are expected to exist.
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.
88 FC_WIN_DLL_API std::vector< Result > ValidateXhtml( const std::string &filepath );
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
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.
100 FC_WIN_DLL_API std::vector< Result > ValidateCss( const std::string &filepath );
102 } // namespace FlightCrew
104 #endif // FLIGHTCREW_H