28 int main(
int argc,
char *argv[]){
31 for (
int arg = 1; arg != argc; ++arg) {
36 else if ((val ==
"--schema" || val ==
"-s") && arg+1 != argc) {
37 default_schema = argv[++arg];
39 else if ((val ==
"--input" || val ==
"-i") && arg+1 != argc) {
42 else if (val ==
"--help" || val ==
"-h") {
43 std::cout <<
"usage: " << argv[0]
44 <<
" [-hV] [-i <input_file>] [-s <schema_file>]\n"
45 <<
" -h, --help\t\t\t"
46 <<
"Shows this usage message.\n"
47 <<
" -s, --schema <schema_file>\t"
48 <<
"Select the file with schema information.\n"
49 <<
" -i, --input <input_file>\t"
50 <<
"Select the config file.\n"
51 <<
" -V, --version\t\t\t"
52 <<
"Version of tool\n";
54 }
else if (val ==
"--version" || val ==
"-V") {
55 std::cout <<
"Battle for Wesnoth schema validator tool, version "
61 if (input.empty()) input =
"./data/gui/default.cfg";
62 std::cout <<
"Processing "<< input <<
"\n";
69 read(cfg, *stream, &validator);
static config_cache & instance()
Get reference to the singleton object.
GLenum GLenum GLenum input
GLuint const GLfloat * val
Definitions for the interface to Wesnoth Markup Language (WML).
std::map< std::string, preproc_define > preproc_map
One of the realizations of serialization/validator.hpp abstract validator.
Declarations for File-IO.
void read(config &cfg, std::istream &in, abstract_validator *validator)
std::istream * preprocess_file(std::string const &fname, preproc_map *defines)
Realization of serialization/validator.hpp abstract validator.
A config object defines a single node in a WML file, with access to child nodes.
GLsizei const GLcharARB ** string