|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62146 - in trunk/boost/wave: . util
From: hartmut.kaiser_at_[hidden]
Date: 2010-05-22 11:52:35
Author: hkaiser
Date: 2010-05-22 11:52:34 EDT (Sat, 22 May 2010)
New Revision: 62146
URL: http://svn.boost.org/trac/boost/changeset/62146
Log:
Wave: added file type to iteration context
Text files modified:
trunk/boost/wave/cpp_iteration_context.hpp | 20 +++++++++++++++-----
trunk/boost/wave/util/cpp_iterator.hpp | 4 +++-
trunk/boost/wave/wave_version.hpp | 4 ++--
3 files changed, 20 insertions(+), 8 deletions(-)
Modified: trunk/boost/wave/cpp_iteration_context.hpp
==============================================================================
--- trunk/boost/wave/cpp_iteration_context.hpp (original)
+++ trunk/boost/wave/cpp_iteration_context.hpp 2010-05-22 11:52:34 EDT (Sat, 22 May 2010)
@@ -90,11 +90,18 @@
} // namespace iteration_context_policies
///////////////////////////////////////////////////////////////////////////////
-//
+// Base class for iteration contexts
template <typename ContextT, typename IteratorT>
struct base_iteration_context
{
-public:
+ enum file_type
+ {
+ // this iteration context handles ...
+ main_file, // ... the main preprocessed file
+ system_header, // ... a header file included used #include <>
+ user_header // ... a header file included using #include ""
+ };
+
base_iteration_context(ContextT& ctx_,
BOOST_WAVE_STRINGTYPE const &fname, std::size_t if_block_depth = 0)
: real_filename(fname), real_relative_filename(fname), filename(fname),
@@ -102,7 +109,8 @@
{}
base_iteration_context(ContextT& ctx_,
IteratorT const &first_, IteratorT const &last_,
- BOOST_WAVE_STRINGTYPE const &fname, std::size_t if_block_depth = 0)
+ BOOST_WAVE_STRINGTYPE const &fname, std::size_t if_block_depth = 0,
+ file_type type = main_file)
: first(first_), last(last_), real_filename(fname),
real_relative_filename(fname), filename(fname),
line(1), emitted_lines(0), if_block_depth(if_block_depth), ctx(ctx_)
@@ -118,6 +126,7 @@
unsigned int emitted_lines; // count of emitted newlines
std::size_t if_block_depth; // depth of #if block recursion
ContextT& ctx; // corresponding context<> object
+ file_type type; // the type of the handled file
};
///////////////////////////////////////////////////////////////////////////////
@@ -138,8 +147,9 @@
iteration_context(ContextT& ctx, BOOST_WAVE_STRINGTYPE const &fname,
position_type const &act_pos,
- boost::wave::language_support language_)
- : base_iteration_context<ContextT, IteratorT>(ctx, fname)
+ boost::wave::language_support language_,
+ file_type type = main_file)
+ : base_iteration_context<ContextT, IteratorT>(ctx, fname, type)
{
InputPolicyT::template inner<self_type>::init_iterators(
*this, act_pos, language_);
Modified: trunk/boost/wave/util/cpp_iterator.hpp
==============================================================================
--- trunk/boost/wave/util/cpp_iterator.hpp (original)
+++ trunk/boost/wave/util/cpp_iterator.hpp 2010-05-22 11:52:34 EDT (Sat, 22 May 2010)
@@ -1572,7 +1572,9 @@
// preprocess the opened file
boost::shared_ptr<base_iteration_context_type> new_iter_ctx (
new iteration_context_type(ctx, native_path_str.c_str(), act_pos,
- boost::wave::enable_prefer_pp_numbers(ctx.get_language())));
+ boost::wave::enable_prefer_pp_numbers(ctx.get_language()),
+ is_system ? base_iteration_context_type::system_header :
+ base_iteration_context_type::user_header));
// call the include policy trace function
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
Modified: trunk/boost/wave/wave_version.hpp
==============================================================================
--- trunk/boost/wave/wave_version.hpp (original)
+++ trunk/boost/wave/wave_version.hpp 2010-05-22 11:52:34 EDT (Sat, 22 May 2010)
@@ -16,11 +16,11 @@
// BOOST_WAVE_VERSION & 0x0000FF is the sub-minor version
// BOOST_WAVE_VERSION & 0x00FF00 is the minor version
// BOOST_WAVE_VERSION & 0xFF0000 is the major version
-#define BOOST_WAVE_VERSION 0x020005
+#define BOOST_WAVE_VERSION 0x020006
// The following defines contain the same information as above
#define BOOST_WAVE_VERSION_MAJOR 2
#define BOOST_WAVE_VERSION_MINOR 0
-#define BOOST_WAVE_VERSION_SUBMINOR 5
+#define BOOST_WAVE_VERSION_SUBMINOR 6
#endif // !defined(WAVE_VERSION_H_9D79ABDB_AC54_4C0A_89B1_F70A2DCFE21E_INCLUDED)
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk