OpenMS
Loading...
Searching...
No Matches
XMLValidator.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Marc Sturm $
7// --------------------------------------------------------------------------
8
9#pragma once
10
12
13#include <iostream>
14
15namespace OpenMS
16{
24 class OPENMS_DLLAPI XMLValidator
25 {
26public:
29
42 bool isValid(const std::string& filename, const std::string& schema, std::ostream& os = std::cerr);
43
44protected:
46 bool valid_;
48 std::string filename_;
49 //output stream reference (for error messages)
50 std::ostream* os_;
51
54 void logError_(const std::string& kind, const std::string& message, unsigned long line, unsigned long column);
55
57 friend class XMLValidatorErrorHandler_;
58 };
59
60} // namespace OpenMS
Validator for XML files.
Definition XMLValidator.h:25
std::ostream * os_
Definition XMLValidator.h:50
std::string filename_
File name of validated file (for error messages)
Definition XMLValidator.h:48
bool valid_
Flag if the validated file is valid.
Definition XMLValidator.h:46
bool isValid(const std::string &filename, const std::string &schema, std::ostream &os=std::cerr)
Returns if an XML file is valid for given a schema file.
XMLValidator()
Constructor.
void logError_(const std::string &kind, const std::string &message, unsigned long line, unsigned long column)
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19