]> git.donarmstrong.com Git - flightcrew.git/blob - src/FlightCrew/Framework/OpfValidatorsList.cpp
Imported Upstream version 0.7.2+dfsg
[flightcrew.git] / src / FlightCrew / Framework / OpfValidatorsList.cpp
1 /************************************************************************\r
2 **\r
3 **  Copyright (C) 2010  Strahinja Markovic\r
4 **\r
5 **  This file is part of FlightCrew.\r
6 **\r
7 **  FlightCrew is free software: you can redistribute it and/or modify\r
8 **  it under the terms of the GNU Lesser General Public License as published\r
9 **  by the Free Software Foundation, either version 3 of the License, or\r
10 **  (at your option) any later version.\r
11 **\r
12 **  FlightCrew is distributed in the hope that it will be useful,\r
13 **  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
14 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
15 **  GNU Lesser General Public License for more details.\r
16 **\r
17 **  You should have received a copy of the GNU Lesser General Public License\r
18 **  along with FlightCrew.  If not, see <http://www.gnu.org/licenses/>.\r
19 **\r
20 *************************************************************************/\r
21 \r
22 #include <stdafx.h>\r
23 #include "OpfValidatorsList.h"\r
24 #include "Validators/Opf/ContributorAttributesPresent.h"\r
25 #include "Validators/Opf/CoverageAttributesPresent.h"\r
26 #include "Validators/Opf/CreatorAttributesPresent.h"\r
27 #include "Validators/Opf/CreatorOrContributorRoleValid.h"\r
28 #include "Validators/Opf/DateAttributesPresent.h"\r
29 #include "Validators/Opf/DateValid.h"\r
30 #include "Validators/Opf/DCMetadataAllowedChildren.h"\r
31 #include "Validators/Opf/DCMetadataAttributesPresent.h"\r
32 #include "Validators/Opf/DescriptionAttributesPresent.h"\r
33 #include "Validators/Opf/FormatAttributesPresent.h"\r
34 #include "Validators/Opf/GuideAllowedChildren.h"\r
35 #include "Validators/Opf/GuideAttributesPresent.h"\r
36 #include "Validators/Opf/IdentifierAttributesPresent.h"\r
37 #include "Validators/Opf/IdentifierPresent.h"\r
38 #include "Validators/Opf/IdsUnique.h"\r
39 #include "Validators/Opf/IdsValid.h"\r
40 #include "Validators/Opf/ItemAttributesPresent.h"\r
41 #include "Validators/Opf/ItemHrefUnique.h"\r
42 #include "Validators/Opf/ItemHrefValid.h"\r
43 #include "Validators/Opf/ItemLinearValid.h"\r
44 #include "Validators/Opf/ItemPresent.h"\r
45 #include "Validators/Opf/ItemrefAttributesPresent.h"\r
46 #include "Validators/Opf/ItemrefIdrefValid.h"\r
47 #include "Validators/Opf/ItemrefPresent.h"\r
48 #include "Validators/Opf/ItemReqModsOnlyWithReqNS.h"\r
49 #include "Validators/Opf/LanguagePresent.h"\r
50 #include "Validators/Opf/ManifestAllowedChildren.h"\r
51 #include "Validators/Opf/ManifestAttributesPresent.h"\r
52 #include "Validators/Opf/MetaAttributesPresent.h"\r
53 #include "Validators/Opf/MetadataAllowedChildren.h"\r
54 #include "Validators/Opf/MetadataAttributesPresent.h"\r
55 #include "Validators/Opf/OneManifest.h"\r
56 #include "Validators/Opf/OneMetadata.h"\r
57 #include "Validators/Opf/OneSpine.h"\r
58 #include "Validators/Opf/PackageAllowedChildren.h"\r
59 #include "Validators/Opf/PackageAttributesPresent.h"\r
60 #include "Validators/Opf/PackageIsRoot.h"\r
61 #include "Validators/Opf/PackageUniqueIdentifierValid.h"\r
62 #include "Validators/Opf/PackageVersionCorrect.h"\r
63 #include "Validators/Opf/PublisherAttributesPresent.h"\r
64 #include "Validators/Opf/ReferenceAttributesPresent.h"\r
65 #include "Validators/Opf/ReferenceTypeValid.h"\r
66 #include "Validators/Opf/RelationAttributesPresent.h"\r
67 #include "Validators/Opf/RightsAttributesPresent.h"\r
68 #include "Validators/Opf/SiteAttributesPresent.h"\r
69 #include "Validators/Opf/SourceAttributesPresent.h"\r
70 #include "Validators/Opf/SpineAllowedChildren.h"\r
71 #include "Validators/Opf/SpineAttributesPresent.h"\r
72 #include "Validators/Opf/SubjectAttributesPresent.h"\r
73 #include "Validators/Opf/TitleAttributesPresent.h"\r
74 #include "Validators/Opf/TitlePresent.h"\r
75 #include "Validators/Opf/TourAllowedChildren.h"\r
76 #include "Validators/Opf/TourAttributesPresent.h"\r
77 #include "Validators/Opf/ToursAllowedChildren.h"\r
78 #include "Validators/Opf/ToursAttributesPresent.h"\r
79 #include "Validators/Opf/TypeAttributesPresent.h"\r
80 #include "Validators/Opf/XMetadataAllowedChildren.h"\r
81 #include "Validators/Opf/XMetadataAttributesPresent.h"\r
82 #include "Validators/Opf/NcxPresent.h"\r
83 #include "Validators/Opf/SpineTocValid.h"\r
84 #include "Validators/Opf/ItemFilesPresent.h"\r
85 #include "Validators/Opf/ReachabilityAnalysis.h"\r
86 #include "Validators/Opf/ItemMediaTypeValid.h"\r
87 #include "Validators/Opf/ItemrefIdrefUnique.h"\r
88 \r
89 \r
90 namespace FlightCrew\r
91 {\r
92 \r
93 std::vector< boost::shared_ptr< XmlValidator > > GetOpfXmlValidators()\r
94 {\r
95     std::vector< boost::shared_ptr< XmlValidator > > validators;\r
96     validators.push_back( boost::shared_ptr< XmlValidator >( new ContributorAttributesPresent() ) );\r
97     validators.push_back( boost::shared_ptr< XmlValidator >( new CoverageAttributesPresent() ) );\r
98     validators.push_back( boost::shared_ptr< XmlValidator >( new CreatorAttributesPresent() ) );\r
99     validators.push_back( boost::shared_ptr< XmlValidator >( new CreatorOrContributorRoleValid() ) );\r
100     validators.push_back( boost::shared_ptr< XmlValidator >( new DateAttributesPresent() ) );\r
101     validators.push_back( boost::shared_ptr< XmlValidator >( new DateValid() ) );\r
102     validators.push_back( boost::shared_ptr< XmlValidator >( new DCMetadataAllowedChildren() ) );\r
103     validators.push_back( boost::shared_ptr< XmlValidator >( new DCMetadataAttributesPresent() ) );\r
104     validators.push_back( boost::shared_ptr< XmlValidator >( new DescriptionAttributesPresent() ) );\r
105     validators.push_back( boost::shared_ptr< XmlValidator >( new FormatAttributesPresent() ) );\r
106     validators.push_back( boost::shared_ptr< XmlValidator >( new GuideAllowedChildren() ) );\r
107     validators.push_back( boost::shared_ptr< XmlValidator >( new GuideAttributesPresent() ) );\r
108     validators.push_back( boost::shared_ptr< XmlValidator >( new IdentifierAttributesPresent() ) );\r
109     validators.push_back( boost::shared_ptr< XmlValidator >( new IdentifierPresent() ) );\r
110     validators.push_back( boost::shared_ptr< XmlValidator >( new IdsUnique() ) );\r
111     validators.push_back( boost::shared_ptr< XmlValidator >( new IdsValid() ) );\r
112     validators.push_back( boost::shared_ptr< XmlValidator >( new ItemAttributesPresent() ) );\r
113     validators.push_back( boost::shared_ptr< XmlValidator >( new ItemHrefUnique() ) );\r
114     validators.push_back( boost::shared_ptr< XmlValidator >( new ItemHrefValid() ) );\r
115     validators.push_back( boost::shared_ptr< XmlValidator >( new ItemLinearValid() ) );\r
116     validators.push_back( boost::shared_ptr< XmlValidator >( new ItemPresent() ) );\r
117     validators.push_back( boost::shared_ptr< XmlValidator >( new ItemrefAttributesPresent() ) );\r
118     validators.push_back( boost::shared_ptr< XmlValidator >( new ItemrefIdrefValid() ) );\r
119     validators.push_back( boost::shared_ptr< XmlValidator >( new ItemrefPresent() ) );\r
120     validators.push_back( boost::shared_ptr< XmlValidator >( new ItemReqModsOnlyWithReqNS() ) );\r
121     validators.push_back( boost::shared_ptr< XmlValidator >( new LanguagePresent() ) );\r
122     validators.push_back( boost::shared_ptr< XmlValidator >( new ManifestAllowedChildren() ) );\r
123     validators.push_back( boost::shared_ptr< XmlValidator >( new ManifestAttributesPresent() ) );\r
124     validators.push_back( boost::shared_ptr< XmlValidator >( new MetaAttributesPresent() ) );\r
125     validators.push_back( boost::shared_ptr< XmlValidator >( new MetadataAllowedChildren() ) );\r
126     validators.push_back( boost::shared_ptr< XmlValidator >( new MetadataAttributesPresent() ) );\r
127     validators.push_back( boost::shared_ptr< XmlValidator >( new OneManifest() ) );\r
128     validators.push_back( boost::shared_ptr< XmlValidator >( new OneMetadata() ) );\r
129     validators.push_back( boost::shared_ptr< XmlValidator >( new OneSpine() ) );\r
130     validators.push_back( boost::shared_ptr< XmlValidator >( new PackageAllowedChildren() ) );\r
131     validators.push_back( boost::shared_ptr< XmlValidator >( new PackageAttributesPresent() ) );\r
132     validators.push_back( boost::shared_ptr< XmlValidator >( new PackageIsRoot() ) );\r
133     validators.push_back( boost::shared_ptr< XmlValidator >( new PackageUniqueIdentifierValid() ) );\r
134     validators.push_back( boost::shared_ptr< XmlValidator >( new PackageVersionCorrect() ) );\r
135     validators.push_back( boost::shared_ptr< XmlValidator >( new PublisherAttributesPresent() ) );\r
136     validators.push_back( boost::shared_ptr< XmlValidator >( new ReferenceAttributesPresent() ) );\r
137     validators.push_back( boost::shared_ptr< XmlValidator >( new ReferenceTypeValid() ) );\r
138     validators.push_back( boost::shared_ptr< XmlValidator >( new RelationAttributesPresent() ) );\r
139     validators.push_back( boost::shared_ptr< XmlValidator >( new RightsAttributesPresent() ) );\r
140     validators.push_back( boost::shared_ptr< XmlValidator >( new SiteAttributesPresent() ) );\r
141     validators.push_back( boost::shared_ptr< XmlValidator >( new SourceAttributesPresent() ) );\r
142     validators.push_back( boost::shared_ptr< XmlValidator >( new SpineAllowedChildren() ) );\r
143     validators.push_back( boost::shared_ptr< XmlValidator >( new SpineAttributesPresent() ) );\r
144     validators.push_back( boost::shared_ptr< XmlValidator >( new SubjectAttributesPresent() ) );\r
145     validators.push_back( boost::shared_ptr< XmlValidator >( new TitleAttributesPresent() ) );\r
146     validators.push_back( boost::shared_ptr< XmlValidator >( new TitlePresent() ) );\r
147     validators.push_back( boost::shared_ptr< XmlValidator >( new TourAllowedChildren() ) );\r
148     validators.push_back( boost::shared_ptr< XmlValidator >( new TourAttributesPresent() ) );\r
149     validators.push_back( boost::shared_ptr< XmlValidator >( new ToursAllowedChildren() ) );\r
150     validators.push_back( boost::shared_ptr< XmlValidator >( new ToursAttributesPresent() ) );\r
151     validators.push_back( boost::shared_ptr< XmlValidator >( new TypeAttributesPresent() ) );\r
152     validators.push_back( boost::shared_ptr< XmlValidator >( new XMetadataAllowedChildren() ) );\r
153     validators.push_back( boost::shared_ptr< XmlValidator >( new XMetadataAttributesPresent() ) );\r
154     validators.push_back( boost::shared_ptr< XmlValidator >( new NcxPresent() ) );    \r
155     validators.push_back( boost::shared_ptr< XmlValidator >( new SpineTocValid() ) );\r
156     validators.push_back( boost::shared_ptr< XmlValidator >( new ItemFilesPresent() ) );    \r
157     validators.push_back( boost::shared_ptr< XmlValidator >( new ReachabilityAnalysis() ) );\r
158     validators.push_back( boost::shared_ptr< XmlValidator >( new ItemMediaTypeValid() ) );   \r
159     validators.push_back( boost::shared_ptr< XmlValidator >( new ItemrefIdrefUnique() ) );   \r
160     \r
161     return validators;\r
162 }\r
163 \r
164 } // namespace FlightCrew