2008-08-06 18:36:30 +00:00
|
|
|
// This file is part of BOINC.
|
2005-01-20 23:22:22 +00:00
|
|
|
// http://boinc.berkeley.edu
|
2008-08-06 18:36:30 +00:00
|
|
|
// Copyright (C) 2008 University of California
|
2003-08-14 00:02:15 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
2003-08-14 00:02:15 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
2005-01-20 23:22:22 +00:00
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
2003-08-14 00:02:15 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2003-08-14 00:02:15 +00:00
|
|
|
|
2017-04-08 06:54:49 +00:00
|
|
|
#ifndef BOINC_VALIDATE_UTIL_H
|
|
|
|
#define BOINC_VALIDATE_UTIL_H
|
2003-08-14 00:02:15 +00:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
|
2012-04-10 00:32:35 +00:00
|
|
|
#include "boinc_db_types.h"
|
2006-06-10 21:29:51 +00:00
|
|
|
|
2008-06-30 16:46:05 +00:00
|
|
|
// bit of a misnomer - this actually taken from the <file_ref> elements
|
|
|
|
// of result.xml_doc_in
|
|
|
|
//
|
2012-04-19 08:47:38 +00:00
|
|
|
struct OUTPUT_FILE_INFO {
|
2008-05-29 20:11:43 +00:00
|
|
|
std::string name;
|
|
|
|
std::string path;
|
|
|
|
bool optional;
|
2014-10-14 17:25:28 +00:00
|
|
|
// sample_bitwise_validator: not an error if this file is missing
|
2008-06-30 16:46:05 +00:00
|
|
|
bool no_validate;
|
2014-10-14 17:25:28 +00:00
|
|
|
// sample_bitwise_validator: don't compare this file
|
2008-05-29 20:11:43 +00:00
|
|
|
|
|
|
|
int parse(XML_PARSER&);
|
|
|
|
};
|
|
|
|
|
2014-10-22 05:14:57 +00:00
|
|
|
extern int get_output_file_info(RESULT const& result, OUTPUT_FILE_INFO&);
|
2017-04-08 06:54:49 +00:00
|
|
|
extern int get_output_file_infos(
|
|
|
|
RESULT const& result, std::vector<OUTPUT_FILE_INFO>&
|
|
|
|
);
|
2014-10-22 05:14:57 +00:00
|
|
|
extern int get_output_file_path(RESULT const& result, std::string&);
|
2017-04-08 06:54:49 +00:00
|
|
|
extern int get_output_file_paths(
|
|
|
|
RESULT const& result, std::vector<std::string>&
|
|
|
|
);
|
2008-05-29 21:54:18 +00:00
|
|
|
extern int get_logical_name(
|
|
|
|
RESULT& result, std::string& path, std::string& name
|
|
|
|
);
|
|
|
|
|
2008-08-07 22:50:05 +00:00
|
|
|
extern int get_credit_from_wu(WORKUNIT&, std::vector<RESULT>& results, double&);
|
2012-04-19 08:47:38 +00:00
|
|
|
|
|
|
|
extern bool standalone;
|
2014-10-14 17:25:28 +00:00
|
|
|
// if set, look for output files in the current directory,
|
|
|
|
// not the upload hierarchy.
|
|
|
|
// used by validator_test.
|
2015-11-20 03:29:30 +00:00
|
|
|
extern void remove_random_from_filename(const char* in, char* out);
|
|
|
|
|
2016-08-16 09:06:14 +00:00
|
|
|
extern int validate_handler_init(int argc, char** argv);
|
|
|
|
extern void validate_handler_usage();
|
|
|
|
|
2003-08-14 00:02:15 +00:00
|
|
|
#endif
|