DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
/*============================================================================= Boost.Wave: A Standard compliant C++ preprocessor library Definition of the preprocessor context http://www.boost.org/ Copyright (c) 2001-2008 Hartmut Kaiser. Distributed under 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(CPP_ITERATION_CONTEXT_HPP_00312288_9DDB_4668_AFE5_25D3994FD095_INCLUDED) #define CPP_ITERATION_CONTEXT_HPP_00312288_9DDB_4668_AFE5_25D3994FD095_INCLUDED #include
#include
#if defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS) #include
#endif #include
#include
#include
#include
#include
// make_multi_pass // this must occur after all of the includes and before any code appears #ifdef BOOST_HAS_ABI_HEADERS #include BOOST_ABI_PREFIX #endif /////////////////////////////////////////////////////////////////////////////// namespace boost { namespace wave { namespace iteration_context_policies { /////////////////////////////////////////////////////////////////////////////// // // The iteration_context_policies templates are policies for the // boost::wave::iteration_context which allows to control, how a given input file // is to be represented by a pair of iterators pointing to the begin and // the end of the resulting input sequence. // /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// // // load_file_to_string // // Loads a file into a string and returns the iterators pointing to // the beginning and the end of the loaded string. // /////////////////////////////////////////////////////////////////////////// struct load_file_to_string { template
class inner { public: template
static void init_iterators(IterContextT &iter_ctx, PositionT const &act_pos) { typedef typename IterContextT::iterator_type iterator_type; std::ifstream instream(iter_ctx.filename.c_str()); if (!instream.is_open()) { BOOST_WAVE_THROW_CTX(iter_ctx.ctx, preprocess_exception, bad_include_file, iter_ctx.filename.c_str(), act_pos); return; } instream.unsetf(std::ios::skipws); #if defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS) // this is known to be very slow for large files on some systems std::copy (istream_iterator
(instream), istream_iterator
(), std::inserter(iter_ctx.instring, iter_ctx.instring.end())); #else iter_ctx.instring = std::string( std::istreambuf_iterator
(instream.rdbuf()), std::istreambuf_iterator
()); #endif // defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS) iter_ctx.first = iterator_type(iter_ctx.instring.begin(), iter_ctx.instring.end(), PositionT(iter_ctx.filename), iter_ctx.language); iter_ctx.last = iterator_type(); } private: std::string instring; }; }; /////////////////////////////////////////////////////////////////////////////// // // load_file // // The load_file policy opens a given file and returns the wrapped // istreambuf_iterators. // /////////////////////////////////////////////////////////////////////////////// struct load_file { template
class inner { public: ~inner() { if (instream.is_open()) instream.close(); } template
static void init_iterators(IterContextT &iter_ctx, PositionT const &act_pos) { typedef typename IterContextT::iterator_type iterator_type; iter_ctx.instream.open(iter_ctx.filename.c_str()); if (!iter_ctx.instream.is_open()) { BOOST_WAVE_THROW_CTX(iter_ctx.ctx, preprocess_exception, bad_include_file, iter_ctx.filename.c_str(), act_pos); return; } iter_ctx.instream.unsetf(std::ios::skipws); using boost::spirit::make_multi_pass; iter_ctx.first = iterator_type( make_multi_pass(std::istreambuf_iterator
( iter_ctx.instream.rdbuf())), make_multi_pass(std::istreambuf_iterator
()), PositionT(iter_ctx.filename), iter_ctx.language); iter_ctx.last = iterator_type(); } private: std::ifstream instream; }; }; } // namespace iteration_context_policies /////////////////////////////////////////////////////////////////////////////// // template
struct base_iteration_context { public: base_iteration_context(ContextT& ctx_, BOOST_WAVE_STRINGTYPE const &fname, std::size_t if_block_depth = 0) : real_filename(fname), filename(fname), line(1), emitted_lines(1), if_block_depth(if_block_depth), ctx(ctx_) {} base_iteration_context(ContextT& ctx_, IteratorT const &first_, IteratorT const &last_, BOOST_WAVE_STRINGTYPE const &fname, std::size_t if_block_depth = 0) : first(first_), last(last_), real_filename(fname), filename(fname), line(1), emitted_lines(1), if_block_depth(if_block_depth), ctx(ctx_) {} // the actual input stream IteratorT first; // actual input stream position IteratorT last; // end of input stream BOOST_WAVE_STRINGTYPE real_filename; // real name of the current file BOOST_WAVE_STRINGTYPE filename; // actual processed file unsigned int line; // line counter of underlying stream unsigned int emitted_lines; // count of emitted newlines std::size_t if_block_depth; // depth of #if block recursion ContextT& ctx; // corresponding context<> object }; /////////////////////////////////////////////////////////////////////////////// // template < typename ContextT, typename IteratorT, typename InputPolicyT = typename ContextT::input_policy_type > struct iteration_context : public base_iteration_context
, public InputPolicyT::template inner
> { typedef IteratorT iterator_type; typedef typename IteratorT::token_type::position_type position_type; typedef iteration_context
self_type; iteration_context(ContextT& ctx, BOOST_WAVE_STRINGTYPE const &fname, position_type const &act_pos, boost::wave::language_support language_) : base_iteration_context
(ctx, fname), language(language_) { InputPolicyT::template inner
::init_iterators(*this, act_pos); } boost::wave::language_support language; }; /////////////////////////////////////////////////////////////////////////////// } // namespace wave } // namespace boost // the suffix header occurs after all of the code #ifdef BOOST_HAS_ABI_HEADERS #include BOOST_ABI_SUFFIX #endif #endif // !defined(CPP_ITERATION_CONTEXT_HPP_00312288_9DDB_4668_AFE5_25D3994FD095_INCLUDED)
cpp_iteration_context.hpp
Page URL
File URL
Prev
3/11
Next
Download
( 8 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.