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
/////////////////////////////////////////////////////////////////////////////// // peeker.hpp // // Copyright 2007 Eric Niebler. 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) #ifndef BOOST_XPRESSIVE_DETAIL_CORE_PEEKER_HPP_EAN_10_04_2005 #define BOOST_XPRESSIVE_DETAIL_CORE_PEEKER_HPP_EAN_10_04_2005 // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif #include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace boost { namespace xpressive { namespace detail { /////////////////////////////////////////////////////////////////////////////// // peek_next // tell whether or not to keep looking for a peek optimization template
struct peek_next : mpl::bool_
{ }; template<> struct peek_next
: mpl::true_ { }; template<> struct peek_next
: mpl::true_ { }; /////////////////////////////////////////////////////////////////////////////// // xpression_peeker // template
struct peeker_string { Char const *begin_; Char const *end_; bool icase_; }; /////////////////////////////////////////////////////////////////////////////// // char_sink // template
struct char_sink { typedef typename Traits::char_type char_type; char_sink(hash_peek_bitset
&bset, Traits const &traits) : bset_(bset) , traits_(traits) {} void operator()(char_type ch) const { this->bset_.set_char(ch, ICase, this->traits_); } hash_peek_bitset
&bset_; Traits const &traits_; }; /////////////////////////////////////////////////////////////////////////////// // xpression_peeker // template
struct xpression_peeker { template
xpression_peeker(hash_peek_bitset
&bset, Traits const &traits) : bset_(bset) , str_() , line_start_(false) , traits_(0) , traits_type_(0) { this->set_traits(traits); } /////////////////////////////////////////////////////////////////////////////// // accessors peeker_string
const &get_string() const { return this->str_; } bool line_start() const { return this->line_start_; } hash_peek_bitset
const &bitset() const { return this->bset_; } /////////////////////////////////////////////////////////////////////////////// // modifiers void fail(bool do_fail = true) { if(do_fail) { this->bset_.set_all(); } } template
peek_next
accept(Matcher const &) { this->fail(!peek_next
::value); return peek_next
(); } template
mpl::true_ accept(assert_bol_matcher
const &) { this->line_start_ = true; return mpl::true_(); } template
mpl::false_ accept(literal_matcher
const &xpr) { this->bset_.set_char(xpr.ch_, ICase, this->get_traits_
()); return mpl::false_(); } template
mpl::false_ accept(string_matcher
const &xpr) { this->bset_.set_char(xpr.str_[0], ICase, this->get_traits_
()); this->str_.begin_ = detail::data_begin(xpr.str_); this->str_.end_ = detail::data_end(xpr.str_); this->str_.icase_ = ICase; return mpl::false_(); } template
mpl::false_ accept(alternate_matcher
const &xpr) { BOOST_ASSERT(0 != xpr.bset_.count()); this->bset_.set_bitset(xpr.bset_); return mpl::false_(); } template
mpl::false_ accept(attr_matcher
const &xpr) { xpr.sym_.peek(char_sink
(this->bset_, this->get_traits_
())); return mpl::false_(); } template
mpl::false_ accept(optional_matcher
const &) { this->fail(); // a union of xpr and next return mpl::false_(); } template
mpl::false_ accept(optional_mark_matcher
const &) { this->fail(); // a union of xpr and next return mpl::false_(); } //template
//mpl::true_ accept(optional_matcher
const &xpr) //{ // xpr.xpr_.peek(*this); // a union of xpr and next // return mpl::true_(); //} //template
//mpl::true_ accept(optional_mark_matcher
const &xpr) //{ // xpr.xpr_.peek(*this); // a union of xpr and next // return mpl::true_(); //} template
mpl::false_ accept(posix_charset_matcher
const &xpr) { this->bset_.set_class(xpr.mask_, xpr.not_, this->get_traits_
()); return mpl::false_(); } template
typename enable_if
, mpl::false_>::type accept(charset_matcher
> const &xpr) { BOOST_ASSERT(0 != xpr.charset_.base().count()); this->bset_.set_charset(xpr.charset_, ICase); return mpl::false_(); } template
mpl::false_ accept(range_matcher
const &xpr) { this->bset_.set_range(xpr.ch_min_, xpr.ch_max_, xpr.not_, ICase, this->get_traits_
()); return mpl::false_(); } template
mpl::false_ accept(simple_repeat_matcher
const &xpr) { 0 != xpr.min_ ? xpr.xpr_.peek(*this) : this->fail(); // could be a union of xpr and next return mpl::false_(); } template
void set_traits(Traits const &traits) { if(0 == this->traits_) { this->traits_ = &traits; this->traits_type_ = &typeid(Traits); } else if(*this->traits_type_ != typeid(Traits) || this->get_traits_
() != traits) { this->fail(); // traits mis-match! set all and bail } } private: template
Traits const &get_traits_() const { BOOST_ASSERT(!!(*this->traits_type_ == typeid(Traits))); return *static_cast
(this->traits_); } hash_peek_bitset
&bset_; peeker_string
str_; bool str_icase_; bool line_start_; void const *traits_; std::type_info const *traits_type_; }; }}} // namespace boost::xpressive::detail #endif
peeker.hpp
Page URL
File URL
Prev
10/16
Next
Download
( 7 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.