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
/*============================================================================= Copyright (c) 2001-2003 Daniel Nuffer 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) =============================================================================*/ #ifndef BOOST_SPIRIT_ESCAPE_CHAR_HPP #define BOOST_SPIRIT_ESCAPE_CHAR_HPP /////////////////////////////////////////////////////////////////////////////// #include
#include
#include
#include
#include
#include
#include
/////////////////////////////////////////////////////////////////////////////// namespace boost { namespace spirit { /////////////////////////////////////////////////////////////////////////////// // // escape_char_action class // // Links an escape char parser with a user defined semantic action. // The semantic action may be a function or a functor. A function // should be compatible with the interface: // // void f(CharT ch); // // A functor should have a member operator() with a compatible signature // as above. The matching character is passed into the function/functor. // This is the default class that character parsers use when dealing with // the construct: // // p[f] // // where p is a parser and f is a function or functor. // /////////////////////////////////////////////////////////////////////////////// template < typename ParserT, typename ActionT, unsigned long Flags, typename CharT > struct escape_char_action : public unary
> > { typedef escape_char_action
self_t; typedef action_parser_category parser_category_t; typedef unary
> base_t; template
struct result { typedef typename match_result
::type type; }; escape_char_action(ParserT const& p, ActionT const& a) : base_t(p), actor(a) {} template
typename parser_result
::type parse(ScannerT const& scan) const { return impl::escape_char_action_parse
:: parse(scan, *this); } ActionT const& predicate() const { return actor; } private: ActionT actor; }; /////////////////////////////////////////////////////////////////////////////// // // escape_char_parser class // // The escape_char_parser helps in conjunction with the escape_char_action // template class (see above) in parsing escaped characters. There are two // different variants of this parser: one for parsing C style escaped // characters and one for parsing LEX style escaped characters. // // The C style escaped character parser is generated, when the template // parameter 'Flags' is equal to 'c_escapes' (a constant defined in the // file impl/escape_char.ipp). This parser recognizes all valid C escape // character sequences: '\t', '\b', '\f', '\n', '\r', '\"', '\'', '\\' // and the numeric style escapes '\120' (octal) and '\x2f' (hexadecimal) // and converts these to their character equivalent, for instance the // sequence of a backslash and a 'b' is parsed as the character '\b'. // All other escaped characters are rejected by this parser. // // The LEX style escaped character parser is generated, when the template // parameter 'Flags' is equal to 'lex_escapes' (a constant defined in the // file impl/escape_char.ipp). This parser recognizes all the C style // escaped character sequences (as described above) and additionally // does not reject all other escape sequences. All not mentioned escape // sequences are converted by the parser to the plain character, for // instance '\a' will be parsed as 'a'. // // All not escaped characters are parsed without modification. // /////////////////////////////////////////////////////////////////////////////// template
struct escape_char_action_parser_gen; template
struct escape_char_parser : public parser
> { // only the values c_escapes and lex_escapes are valid for Flags BOOST_STATIC_ASSERT(Flags == c_escapes || Flags == lex_escapes); typedef escape_char_parser
self_t; typedef escape_char_action_parser_gen
action_parser_generator_t; template
struct result { typedef typename match_result
::type type; }; template
escape_char_action
operator[](ActionT const& actor) const { return escape_char_action
(*this, actor); } template
typename parser_result
::type parse(ScannerT const &scan) const { return impl::escape_char_parse
::parse(scan, *this); } }; template
struct escape_char_action_parser_gen { template
static escape_char_action
generate (ParserT const &p, ActionT const &actor) { typedef escape_char_action
action_parser_t; return action_parser_t(p, actor); } }; /////////////////////////////////////////////////////////////////////////////// // // predefined escape_char_parser objects // // These objects should be used for generating correct escaped character // parsers. // /////////////////////////////////////////////////////////////////////////////// const escape_char_parser
lex_escape_ch_p = escape_char_parser
(); const escape_char_parser
c_escape_ch_p = escape_char_parser
(); /////////////////////////////////////////////////////////////////////////////// }} // namespace boost::spirit #endif
escape_char.hpp
Page URL
File URL
Prev
7/19
Next
Download
( 6 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.