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