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) 1998-2003 Joel de Guzman Copyright (c) 2001-2003 Hartmut Kaiser 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_NUMERICS_HPP #define BOOST_SPIRIT_NUMERICS_HPP #include
#include
#include
#include
#include
namespace boost { namespace spirit { /////////////////////////////////////////////////////////////////////////// // // uint_parser class // /////////////////////////////////////////////////////////////////////////// template < typename T, int Radix, unsigned MinDigits, int MaxDigits > struct uint_parser : parser
> { typedef uint_parser
self_t; template
struct result { typedef typename match_result
::type type; }; template
typename parser_result
::type parse(ScannerT const& scan) const { typedef impl::uint_parser_impl
impl_t; typedef typename parser_result
::type result_t; return impl::contiguous_parser_parse
(impl_t(), scan, scan); } }; /////////////////////////////////////////////////////////////////////////// // // int_parser class // /////////////////////////////////////////////////////////////////////////// template < typename T, int Radix, unsigned MinDigits, int MaxDigits > struct int_parser : parser
> { typedef int_parser
self_t; template
struct result { typedef typename match_result
::type type; }; template
typename parser_result
::type parse(ScannerT const& scan) const { typedef impl::int_parser_impl
impl_t; typedef typename parser_result
::type result_t; return impl::contiguous_parser_parse
(impl_t(), scan, scan); } }; /////////////////////////////////////////////////////////////////////////// // // uint_parser/int_parser instantiations // /////////////////////////////////////////////////////////////////////////// int_parser
const int_p = int_parser
(); uint_parser
const uint_p = uint_parser
(); uint_parser
const bin_p = uint_parser
(); uint_parser
const oct_p = uint_parser
(); uint_parser
const hex_p = uint_parser
(); /////////////////////////////////////////////////////////////////////////// // // sign_parser class // /////////////////////////////////////////////////////////////////////////// namespace impl { // Utility to extract the prefix sign ('-' | '+') template
bool extract_sign(ScannerT const& scan, std::size_t& count); } struct sign_parser : public parser
{ typedef sign_parser self_t; template
struct result { typedef typename match_result
::type type; }; sign_parser() {} template
typename parser_result
::type parse(ScannerT const& scan) const { if (!scan.at_end()) { std::size_t length; typename ScannerT::iterator_t save(scan.first); bool neg = impl::extract_sign(scan, length); if (length) return scan.create_match(1, neg, save, scan.first); } return scan.no_match(); } }; sign_parser const sign_p = sign_parser(); /////////////////////////////////////////////////////////////////////////// // // default real number policies // /////////////////////////////////////////////////////////////////////////// template
struct ureal_parser_policies { // trailing dot policy suggested suggested by Gustavo Guerra BOOST_STATIC_CONSTANT(bool, allow_leading_dot = true); BOOST_STATIC_CONSTANT(bool, allow_trailing_dot = true); BOOST_STATIC_CONSTANT(bool, expect_dot = false); typedef uint_parser
uint_parser_t; typedef int_parser
int_parser_t; template
static typename match_result
::type parse_sign(ScannerT& scan) { return scan.no_match(); } template
static typename parser_result
::type parse_n(ScannerT& scan) { return uint_parser_t().parse(scan); } template
static typename parser_result
, ScannerT>::type parse_dot(ScannerT& scan) { return ch_p('.').parse(scan); } template
static typename parser_result
::type parse_frac_n(ScannerT& scan) { return uint_parser_t().parse(scan); } template
static typename parser_result
, ScannerT>::type parse_exp(ScannerT& scan) { return as_lower_d['e'].parse(scan); } template
static typename parser_result
::type parse_exp_n(ScannerT& scan) { return int_parser_t().parse(scan); } }; template
struct real_parser_policies : public ureal_parser_policies
{ template
static typename parser_result
::type parse_sign(ScannerT& scan) { return sign_p.parse(scan); } }; /////////////////////////////////////////////////////////////////////////// // // real_parser class // /////////////////////////////////////////////////////////////////////////// template < typename T, typename RealPoliciesT > struct real_parser : public parser
> { typedef real_parser
self_t; template
struct result { typedef typename match_result
::type type; }; real_parser() {} template
typename parser_result
::type parse(ScannerT const& scan) const { typedef typename parser_result
::type result_t; return impl::real_parser_impl
::parse(scan); } }; /////////////////////////////////////////////////////////////////////////// // // real_parser instantiations // /////////////////////////////////////////////////////////////////////////// real_parser
> const ureal_p = real_parser
>(); real_parser
> const real_p = real_parser
>(); /////////////////////////////////////////////////////////////////////////// // // strict reals (do not allow plain integers (no decimal point)) // /////////////////////////////////////////////////////////////////////////// template
struct strict_ureal_parser_policies : public ureal_parser_policies
{ BOOST_STATIC_CONSTANT(bool, expect_dot = true); }; template
struct strict_real_parser_policies : public real_parser_policies
{ BOOST_STATIC_CONSTANT(bool, expect_dot = true); }; real_parser
> const strict_ureal_p = real_parser
>(); real_parser
> const strict_real_p = real_parser
>(); }} // namespace boost::spirit #endif
numerics.hpp
Page URL
File URL
Prev 1/3
Next
Download
( 9 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.