mirror of
https://github.com/boostorg/quickbook.git
synced 2026-01-26 06:42:27 +00:00
Put the quickbook version numbers in a single header, along with convenience
functions for using them in spirit grammars. [SVN r55910]
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include <boost/filesystem/convenience.hpp>
|
||||
#include <boost/filesystem/fstream.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "./quickbook.hpp"
|
||||
#include "./actions.hpp"
|
||||
#include "./utils.hpp"
|
||||
#include "./markups.hpp"
|
||||
|
||||
@@ -41,9 +41,6 @@ namespace quickbook
|
||||
extern tm* current_time; // the current time
|
||||
extern tm* current_gm_time; // the current UTC time
|
||||
extern bool debug_mode;
|
||||
extern unsigned qbk_major_version;
|
||||
extern unsigned qbk_minor_version;
|
||||
extern unsigned qbk_version_n; // qbk_major_version * 100 + qbk_minor_version
|
||||
extern std::vector<std::string> include_path;
|
||||
|
||||
// forward declarations
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
#include "./quickbook.hpp"
|
||||
#include "./actions_class.hpp"
|
||||
#include "../block.hpp"
|
||||
#include "../doc_info.hpp"
|
||||
|
||||
47
detail/quickbook.hpp
Normal file
47
detail/quickbook.hpp
Normal file
@@ -0,0 +1,47 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Daniel James
|
||||
Copyright (c) 2002 2004 2006 Joel de Guzman
|
||||
Copyright (c) 2004 Eric Niebler
|
||||
http://spirit.sourceforge.net/
|
||||
|
||||
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_QUICKBOOK_QUICKBOOK_HPP)
|
||||
#define BOOST_SPIRIT_QUICKBOOK_QUICKBOOK_HPP
|
||||
|
||||
namespace quickbook
|
||||
{
|
||||
extern unsigned qbk_major_version;
|
||||
extern unsigned qbk_minor_version;
|
||||
extern unsigned qbk_version_n; // qbk_major_version * 100 + qbk_minor_version
|
||||
|
||||
struct quickbook_range {
|
||||
template <typename Arg>
|
||||
struct result
|
||||
{
|
||||
typedef bool type;
|
||||
};
|
||||
|
||||
quickbook_range(unsigned min, unsigned max)
|
||||
: min(min), max(max) {}
|
||||
|
||||
bool operator()() const {
|
||||
return qbk_version_n >= min && qbk_version_n < max;
|
||||
}
|
||||
|
||||
unsigned min, max;
|
||||
};
|
||||
|
||||
inline quickbook_range qbk_since(unsigned min) {
|
||||
return quickbook_range(min, 999);
|
||||
}
|
||||
|
||||
inline quickbook_range qbk_before(unsigned max) {
|
||||
return quickbook_range(0, max);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -11,6 +11,7 @@
|
||||
#define BOOST_SPIRIT_QUICKBOOK_DOC_INFO_HPP
|
||||
|
||||
#include "./phrase.hpp"
|
||||
#include "./detail/quickbook.hpp"
|
||||
#include <boost/spirit/include/classic_core.hpp>
|
||||
#include <boost/spirit/include/classic_actor.hpp>
|
||||
#include <boost/spirit/include/classic_loops.hpp>
|
||||
@@ -19,8 +20,6 @@
|
||||
namespace quickbook
|
||||
{
|
||||
using namespace boost::spirit::classic;
|
||||
extern unsigned qbk_major_version;
|
||||
extern unsigned qbk_minor_version;
|
||||
|
||||
template <typename Actions>
|
||||
struct doc_info_grammar
|
||||
|
||||
Reference in New Issue
Block a user