summaryrefslogtreecommitdiff
path: root/tools/quickbook/src/state_save.hpp
blob: f8b53e7c8e66cc56df938a5cbe32f32bd81b6c02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*=============================================================================
    Copyright (c) 2002 2004 2006 Joel de Guzman
    Copyright (c) 2004 Eric Niebler
    Copyright (c) 2011 Daniel James

    Use, modification and distribution is subject to the Boost Software
    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
    http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(BOOST_SPIRIT_ACTIONS_STATE_HPP)
#define BOOST_SPIRIT_ACTIONS_STATE_HPP

#include "state.hpp"

namespace quickbook
{
    // State savers
    //
    // Defined in state.cpp

    struct file_state
    {
        enum scope_flags {
            scope_none = 0,
            scope_macros = 1,
            scope_templates = 2,
            scope_output = 4,
            scope_callables = scope_macros + scope_templates,
            scope_all = scope_callables + scope_output
        };

        explicit file_state(quickbook::state&, scope_flags);
        ~file_state();

        quickbook::state& state;
        scope_flags scope;
        unsigned qbk_version;
        bool imported;
        std::string doc_type;
        file_ptr current_file;
        fs::path filename_relative;
        fs::path xinclude_base;
        std::string source_mode;
        string_symbols macro;
    private:
        file_state(file_state const&);
        file_state& operator=(file_state const&);
    };

    struct template_state : file_state
    {
        explicit template_state(quickbook::state&);
        ~template_state();

        int template_depth;
        int min_section_level;
    };
}

#endif // BOOST_SPIRIT_ACTIONS_STATE_HPP