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
/////////////////////////////////////////////////////////////////////////////// // as_set.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_STATIC_TRANSFORMS_AS_SET_HPP_EAN_04_05_2007 #define BOOST_XPRESSIVE_DETAIL_STATIC_TRANSFORMS_AS_SET_HPP_EAN_04_05_2007 // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif #include
#include
#include
#include
#include
#include
#include
#include
namespace boost { namespace xpressive { namespace detail { template
typename I::next next_(I) { return typename I::next(); } template
struct next : Grammar { next(); template
struct apply : Grammar::template apply
::type::next {}; template
static typename apply
::type call(Expr const &expr, State const &state, Visitor &visitor) { return detail::next_(Grammar::call(expr, state, visitor)); } }; template
struct push_back : Grammar { push_back(); template
static typename Grammar::template apply
::type call(Expr const &expr, State const &state, Visitor &visitor) { visitor.accept(proto::arg(expr)); return Grammar::call(expr, state, visitor); } }; /////////////////////////////////////////////////////////////////////////// // CharLiteral template
struct CharLiteral : proto::or_< proto::terminal
, proto::terminal
> {}; template<> struct CharLiteral
: proto::terminal
{}; /////////////////////////////////////////////////////////////////////////// // ListSet // matches expressions like (set= 'a','b','c') // calculates the size of the set // populates an array of characters template
struct ListSet : proto::transform::left< proto::or_< proto::comma< next
> , push_back
> > , proto::assign< proto::transform::always
> , push_back
> > > > {}; /////////////////////////////////////////////////////////////////////////// // set_fill_visitor template
struct set_fill_visitor { typedef typename Traits::char_type char_type; set_fill_visitor(char_type *buffer, Traits const &traits) : buffer_(buffer) , traits_(traits) {} template
void accept(Char ch) { *this->buffer_++ = this->traits_.translate( char_cast
(ch, this->traits_) ); } char_type *buffer_; Traits const &traits_; }; /////////////////////////////////////////////////////////////////////////////// // as_list_set template
struct as_list_set : Grammar { as_list_set(); template
struct apply { typedef typename Visitor::traits_type traits_type; typedef set_matcher< traits_type , Grammar::template apply
>::type::value > type; }; template
static typename apply
::type call(Expr const &expr, State const &state, Visitor &visitor) { typename apply
::type set; set_fill_visitor
filler(set.set_, visitor.traits()); Grammar::call(expr, state, filler); return set; } }; /////////////////////////////////////////////////////////////////////////////// // charset_context // template
struct charset_context { template
struct eval_ { typedef void result_type; void operator()(Expr const &expr, charset_context const &ctx) const { ctx.set(Grammar::call(expr, end_xpression(), ctx.visitor_)); } }; template
struct eval_
{ typedef void result_type; void operator()(Expr const &expr, charset_context const &ctx) const { proto::eval(proto::left(expr), ctx); proto::eval(proto::right(expr), ctx); } }; // Gah, this is to work around a MSVC bug. template
struct eval : eval_
{}; typedef typename Visitor::traits_type traits_type; typedef typename CharSet::char_type char_type; typedef typename CharSet::icase_type icase_type; explicit charset_context(CharSet &charset, Visitor &visitor) : charset_(charset) , visitor_(visitor) {} template
void set(literal_matcher
const &ch) const { // BUGBUG fixme! BOOST_MPL_ASSERT_NOT((mpl::bool_
)); set_char(this->charset_.charset_, ch.ch_, this->visitor_.traits(), icase_type()); } void set(range_matcher
const &rg) const { // BUGBUG fixme! BOOST_ASSERT(!rg.not_); set_range(this->charset_.charset_, rg.ch_min_, rg.ch_max_, this->visitor_.traits(), icase_type()); } template
void set(set_matcher
const &set_) const { // BUGBUG fixme! BOOST_ASSERT(!set_.not_); for(int i=0; i
charset_.charset_, set_.set_[i], this->visitor_.traits(), icase_type::value); } } void set(posix_charset_matcher
const &posix) const { set_class(this->charset_.charset_, posix.mask_, posix.not_, this->visitor_.traits()); } CharSet &charset_; Visitor &visitor_; }; /////////////////////////////////////////////////////////////////////////////// // template
struct as_set : Grammar { as_set(); template
struct apply { typedef typename Visitor::char_type char_type; // if sizeof(char_type)==1, merge everything into a basic_chset // BUGBUG this is not optimal. typedef typename mpl::if_< is_narrow_char
, basic_chset
, compound_charset
>::type charset_type; typedef charset_matcher< typename Visitor::traits_type , Visitor::icase_type::value , charset_type > type; }; template
static typename apply
::type call(Expr const &expr, State const &, Visitor &visitor) { typedef typename apply
::type set_type; set_type matcher; charset_context
ctx(matcher, visitor); // Walks the tree and fills in the charset proto::eval(expr, ctx); return matcher; } }; }}} #endif
as_set.hpp
Page URL
File URL
Prev
10/10 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.