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) 1999-2003 Jeremiah Willcock Copyright (c) 1999-2003 Jaakko J�rvi Copyright (c) 2001-2006 Joel de Guzman 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(FUSION_MANIP_05052005_1200) #define FUSION_MANIP_05052005_1200 #include
#include
#include
#include
// Tuple I/O manipulators #define FUSION_GET_CHAR_TYPE(T) typename T::char_type #define FUSION_GET_TRAITS_TYPE(T) typename T::traits_type #if defined (BOOST_NO_TEMPLATED_STREAMS) #define FUSION_STRING_OF_STREAM(Stream) std::string #else #define FUSION_STRING_OF_STREAM(Stream) \ std::basic_string< \ FUSION_GET_CHAR_TYPE(Stream) \ , FUSION_GET_TRAITS_TYPE(Stream) \ > #endif //$$$ these should be part of the public API$$$ //$$$ rename tuple_open, tuple_close and tuple_delimiter to // open, close and delimeter and add these synonyms to the // TR1 tuple module. namespace boost { namespace fusion { namespace detail { template
int get_xalloc_index(Tag* = 0) { // each Tag will have a unique index static int index = std::ios::xalloc(); return index; } template
struct stream_data { struct arena { ~arena() { for ( typename std::vector
::iterator i = data.begin() ; i != data.end() ; ++i) { delete *i; } } std::vector
data; }; static void attach(Stream& stream, T const& data) { static arena ar; // our arena ar.data.push_back(new T(data)); stream.pword(get_xalloc_index
()) = ar.data.back(); } static T const* get(Stream& stream) { return (T const*)stream.pword(get_xalloc_index
()); } }; template
class string_ios_manip { public: typedef FUSION_STRING_OF_STREAM(Stream) string_type; typedef stream_data
stream_data_t; string_ios_manip(Stream& str_) : stream(str_) {} void set(string_type const& s) { stream_data_t::attach(stream, s); } void print(char const* default_) const { // print a delimiter string_type const* p = stream_data_t::get(stream); if (p) stream << *p; else stream << default_; } void read(char const* default_) const { // read a delimiter string_type const* p = stream_data_t::get(stream); using namespace std; ws(stream); if (p) { typedef typename string_type::const_iterator iterator; for (iterator i = p->begin(); i != p->end(); ++i) check_delim(*i); } else { while (*default_) check_delim(*default_++); } } private: template
void check_delim(Char c) const { if (!isspace(c)) { if (stream.get() != c) { stream.unget(); stream.setstate(std::ios::failbit); } } } Stream& stream; }; } // detail #if defined (BOOST_NO_TEMPLATED_STREAMS) #define STD_TUPLE_DEFINE_MANIPULATOR(name) \ namespace detail \ { \ struct name##_tag; \ \ struct name##_type \ { \ typedef std::string string_type; \ string_type data; \ name##_type(const string_type& d): data(d) {} \ }; \ \ template
\ Stream& operator>>(Stream& s, const name##_type& m) \ { \ string_ios_manip
(s).set(m.data); \ return s; \ } \ \ template
\ Stream& operator<<(Stream& s, const name##_type& m) \ { \ string_ios_manip
(s).set(m.data); \ return s; \ } \ } #define STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(name) \ inline detail::name##_type \ name(const std::string& s) \ { \ return detail::name##_type(s); \ } \ \ inline detail::name##_type \ name(const char* s) \ { \ return detail::name##_type(std::string(s)); \ } \ \ inline detail::name##_type \ name(char c) \ { \ return detail::name##_type(std::string(1, c)); \ } #else // defined(BOOST_NO_TEMPLATED_STREAMS) #if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) #define STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(name) \ template
\ inline detail::name##_type
\ name(const std::basic_string
& s) \ { \ return detail::name##_type
(s); \ } \ \ inline detail::name##_type
\ name(char const* s) \ { \ return detail::name##_type
(std::basic_string
(s)); \ } \ \ inline detail::name##_type
\ name(wchar_t const* s) \ { \ return detail::name##_type
(std::basic_string
(s)); \ } \ \ inline detail::name##_type
\ name(char c) \ { \ return detail::name##_type
(std::basic_string
(1, c)); \ } \ \ inline detail::name##_type
\ name(wchar_t c) \ { \ return detail::name##_type
(std::basic_string
(1, c)); \ } #else // defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) #define STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(name) \ template
\ inline detail::name##_type
\ name(const std::basic_string
& s) \ { \ return detail::name##_type
(s); \ } \ \ template
\ inline detail::name##_type
\ name(Char s[]) \ { \ return detail::name##_type
(std::basic_string
(s)); \ } \ \ template
\ inline detail::name##_type
\ name(Char const s[]) \ { \ return detail::name##_type
(std::basic_string
(s)); \ } \ \ template
\ inline detail::name##_type
\ name(Char c) \ { \ return detail::name##_type
(std::basic_string
(1, c)); \ } #endif #define STD_TUPLE_DEFINE_MANIPULATOR(name) \ namespace detail \ { \ struct name##_tag; \ \ template
> \ struct name##_type \ { \ typedef std::basic_string
string_type; \ string_type data; \ name##_type(const string_type& d): data(d) {} \ }; \ \ template
\ Stream& operator>>(Stream& s, const name##_type
& m) \ { \ string_ios_manip
(s).set(m.data); \ return s; \ } \ \ template
\ Stream& operator<<(Stream& s, const name##_type
& m) \ { \ string_ios_manip
(s).set(m.data); \ return s; \ } \ } \ #endif // defined(BOOST_NO_TEMPLATED_STREAMS) STD_TUPLE_DEFINE_MANIPULATOR(tuple_open) STD_TUPLE_DEFINE_MANIPULATOR(tuple_close) STD_TUPLE_DEFINE_MANIPULATOR(tuple_delimiter) STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(tuple_open) STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(tuple_close) STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(tuple_delimiter) #undef STD_TUPLE_DEFINE_MANIPULATOR #undef STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS #undef FUSION_STRING_OF_STREAM #undef FUSION_GET_CHAR_TYPE #undef FUSION_GET_TRAITS_TYPE }} #endif
manip.hpp
Page URL
File URL
Prev
2/3
Next
Download
( 15 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.