The Battle for Wesnoth  1.19.0-dev
parser.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 - 2024
3  by Iris Morelle <shadowm2006@gmail.com>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #pragma once
17 
18 #include <string>
19 
20 class vconfig;
21 
22 namespace storyscreen
23 {
24 
25 /**
26  * Small helper class to encapsulate the common logic for parsing storyscreen WML.
27  */
29 {
30 public:
31  story_parser() = default;
32  virtual ~story_parser() = default;
33 
34  story_parser(const story_parser&) = delete;
35  story_parser& operator=(const story_parser&) = delete;
36 
37  /** Takes care of initializing and branching properties. */
38  virtual void resolve_wml(const vconfig& cfg);
39 
40  /**
41  * May be implemented by derived classes to perform additional actions
42  * When executing @ref resolve_wml.
43  */
44  virtual bool resolve_wml_helper(const std::string& key, const vconfig& node) = 0;
45 };
46 
47 } // namespace storyscreen
Small helper class to encapsulate the common logic for parsing storyscreen WML.
Definition: parser.hpp:29
virtual ~story_parser()=default
story_parser(const story_parser &)=delete
virtual void resolve_wml(const vconfig &cfg)
Takes care of initializing and branching properties.
Definition: parser.cpp:29
virtual bool resolve_wml_helper(const std::string &key, const vconfig &node)=0
May be implemented by derived classes to perform additional actions When executing resolve_wml.
story_parser & operator=(const story_parser &)=delete
A variable-expanding proxy for the config class.
Definition: variable.hpp:45