ParseAuthorAndStore(*items[0], author.get());
- // TODO(t.iwanek): don't skip it when preloaded apps will be fixed.
- if (author->name().empty())
- return true;
-
*output = std::static_pointer_cast<parser::ManifestData>(author);
return true;
}
-bool AuthorHandler::Validate(
- const parser::ManifestData& data,
- const parser::ManifestDataMap& /*handlers_output*/,
- std::string* error) const {
- const AuthorInfo& author =
- static_cast<const AuthorInfo&>(data);
-
- if (author.email().empty()) {
- *error = "The email child element of author element is obligatory";
- return false;
- }
-
- // TODO(t.iwanek): validate email address when preloaded apps will be fixed.
-
-
- const std::string& href = author.href();
- if (href.empty()) {
- *error =
- "The href child element of author element is obligatory";
- return false;
- }
-
- const std::string& name = author.name();
- if (name.empty()) {
- *error =
- "The name child element of author element is obligatory";
- return false;
- }
- return true;
-}
-
std::string AuthorInfo::Key() {
return kAuthorKey;
}
const parser::Manifest& manifest,
std::shared_ptr<parser::ManifestData>* output,
std::string* error) override;
- bool Validate(
- const parser::ManifestData& data,
- const parser::ManifestDataMap& handlers_output,
- std::string* error) const override;
std::string Key() const override;
};