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
// Boost string_algo library collection_traits.hpp header file -----------------------// // Copyright Pavol Droba 2002-2003. 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) // See http://www.boost.org for updates, documentation, and revision history. #ifndef BOOST_RANGE_STRING_DETAIL_COLLECTION_TRAITS_HPP #define BOOST_RANGE_STRING_DETAIL_COLLECTION_TRAITS_HPP #include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
// Container traits implementation --------------------------------------------------------- namespace boost { namespace algorithm { namespace detail { // Default collection traits ----------------------------------------------------------------- // Default collection helper /* Wraps std::container compliant containers */ template< typename ContainerT > struct default_container_traits { typedef BOOST_STRING_TYPENAME ContainerT::value_type value_type; typedef BOOST_STRING_TYPENAME ContainerT::iterator iterator; typedef BOOST_STRING_TYPENAME ContainerT::const_iterator const_iterator; typedef BOOST_STRING_TYPENAME ::boost::mpl::if_< ::boost::is_const
, const_iterator, iterator >::type result_iterator; typedef BOOST_STRING_TYPENAME ContainerT::difference_type difference_type; typedef BOOST_STRING_TYPENAME ContainerT::size_type size_type; // static operations template< typename C > static size_type size( const C& c ) { return c.size(); } template< typename C > static bool empty( const C& c ) { return c.empty(); } #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING template< typename C > static iterator begin( C& c ) { return c.begin(); } template< typename C > static const_iterator begin( const C& c ) { return c.begin(); } template< typename C > static iterator end( C& c ) { return c.end(); } template< typename C > static const_iterator end( const C& c ) { return c.end(); } #else // BOOST_NO_FUNCTION_TEMPLATE_ORDERING template< typename C > static result_iterator begin( C& c ) { return c.begin(); } template< typename C > static result_iterator end( C& c ) { return c.end(); } #endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING }; template
struct default_container_traits_selector { typedef default_container_traits
type; }; // Pair container traits --------------------------------------------------------------------- // pair selector template< typename T, typename U > yes_type is_pair_impl( const std::pair
* ); no_type is_pair_impl( ... ); template
struct is_pair { private: static T* t; public: BOOST_STATIC_CONSTANT( bool, value= sizeof(is_pair_impl(t))==sizeof(yes_type) ); }; // pair helper template< typename PairT > struct pair_container_traits { typedef BOOST_STRING_TYPENAME PairT::first_type element_type; typedef BOOST_STRING_TYPENAME ::boost::detail:: iterator_traits
::value_type value_type; typedef std::size_t size_type; typedef BOOST_STRING_TYPENAME ::boost::detail:: iterator_traits
::difference_type difference_type; typedef element_type iterator; typedef element_type const_iterator; typedef element_type result_iterator; // static operations template< typename P > static size_type size( const P& p ) { difference_type diff = std::distance( p.first, p.second ); if ( diff < 0 ) return 0; else return diff; } template< typename P > static bool empty( const P& p ) { return p.first==p.second; } template< typename P > static const_iterator begin( const P& p ) { return p.first; } template< typename P > static const_iterator end( const P& p ) { return p.second; } }; // 'pair_container_helper' template
struct pair_container_traits_selector { typedef pair_container_traits
type; }; // Array container traits --------------------------------------------------------------- #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // array traits ( partial specialization ) template< typename T > struct array_traits; template< typename T, std::size_t sz > struct array_traits
{ // typedef typedef T* iterator; typedef const T* const_iterator; typedef T value_type; typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; // size of the array ( static ); BOOST_STATIC_CONSTANT( size_type, array_size = sz ); }; #else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // array traits ( no partial specialization ) /* without parial specialization we are able to provide support only for a limited number of types. Currently the primitive numeric types are supported */ template< typename T, typename BaseT > struct array_traits_impl { typedef BaseT value_type; typedef BaseT* iterator; typedef const BaseT* const_iterator; typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; // size of the array BOOST_STATIC_CONSTANT( size_type, array_size = sizeof(T)/sizeof(BaseT) ); }; template< typename T, typename BaseT > struct array_traits_impl_selector { typedef array_traits_impl
type; }; struct array_traits_void { typedef void type; }; template< typename T, typename BaseT > struct array_traits_cv_selector { typedef BOOST_STRING_TYPENAME ::boost::mpl::eval_if< ::boost::is_convertible
, array_traits_impl_selector
, ::boost::mpl::eval_if< ::boost::is_convertible
, array_traits_impl_selector
, ::boost::mpl::eval_if< ::boost::is_convertible
, array_traits_impl_selector
, array_traits_impl_selector
> > >::type type; }; template< typename T > struct array_traits_select { template< typename T1, typename T2 > struct apply { typedef BOOST_STRING_TYPENAME ::boost::mpl::eval_if< ::boost::is_convertible
, array_traits_cv_selector
, ::boost::mpl::identity
>::type type; }; }; template< typename T > struct array_traits_selector { private: // supported array base types #ifndef BOOST_NO_INTRINSIC_WCHAR_T typedef BOOST_STRING_TYPENAME ::boost::mpl::vector10< wchar_t, #else // BOOST_NO_INTRINSIC_WCHAR_T typedef BOOST_STRING_TYPENAME ::boost::mpl::vector9< #endif // BOOST_NO_INTRINSIC_WCHAR_T char, signed char, unsigned char, signed short, unsigned short, signed int, unsigned int, signed long, unsigned long >::type array_base_types; public: typedef BOOST_STRING_TYPENAME ::boost::mpl::fold< array_base_types, ::boost::algorithm::detail::array_traits_void, ::boost::algorithm::detail::array_traits_select
>::type type; }; template< typename T > struct array_traits { typedef BOOST_STRING_TYPENAME array_traits_selector
::type traits_type; typedef BOOST_STRING_TYPENAME traits_type::value_type value_type; typedef BOOST_STRING_TYPENAME traits_type::iterator iterator; typedef BOOST_STRING_TYPENAME traits_type::const_iterator const_iterator; typedef BOOST_STRING_TYPENAME traits_type::size_type size_type; typedef BOOST_STRING_TYPENAME traits_type::difference_type difference_type; BOOST_STATIC_CONSTANT( size_type, array_size = traits_type::array_size ); }; #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // array lenght resolving /* Lenght of string contained in a static array could be different from the size of the array. For string processing we need the lenght without terminating 0. Therefore, the lenght is calulated for char and wchar_t using char_traits, rather then simply returning the array size. */ template< typename T > struct array_length_selector { template< typename TraitsT > struct array_length { typedef BOOST_STRING_TYPENAME TraitsT::size_type size_type; BOOST_STATIC_CONSTANT( size_type, array_size=TraitsT::array_size ); template< typename A > static size_type length( const A& ) { return array_size; } template< typename A > static bool empty( const A& ) { return array_size==0; } }; }; // specialization for char template<> struct array_length_selector
{ template< typename TraitsT > struct array_length { typedef BOOST_STRING_TYPENAME TraitsT::size_type size_type; template< typename A > static size_type length( const A& a ) { if ( a==0 ) return 0; else return std::char_traits
::length(a); } template< typename A > static bool empty( const A& a ) { return a==0 || a[0]==0; } }; }; // specialization for wchar_t template<> struct array_length_selector
{ template< typename TraitsT > struct array_length { typedef BOOST_STRING_TYPENAME TraitsT::size_type size_type; template< typename A > static size_type length( const A& a ) { if ( a==0 ) return 0; else return std::char_traits
::length(a); } template< typename A > static bool empty( const A& a ) { return a==0 || a[0]==0; } }; }; template< typename T > struct array_container_traits { private: // resolve array traits typedef array_traits
traits_type; public: typedef BOOST_STRING_TYPENAME traits_type::value_type value_type; typedef BOOST_STRING_TYPENAME traits_type::iterator iterator; typedef BOOST_STRING_TYPENAME traits_type::const_iterator const_iterator; typedef BOOST_STRING_TYPENAME traits_type::size_type size_type; typedef BOOST_STRING_TYPENAME traits_type::difference_type difference_type; typedef BOOST_STRING_TYPENAME ::boost::mpl::if_< ::boost::is_const
, const_iterator, iterator >::type result_iterator; private: // resolve array size typedef BOOST_STRING_TYPENAME ::boost::remove_cv
::type char_type; typedef BOOST_STRING_TYPENAME array_length_selector
:: BOOST_NESTED_TEMPLATE array_length
array_length_type; public: BOOST_STATIC_CONSTANT( size_type, array_size = traits_type::array_size ); // static operations template< typename A > static size_type size( const A& a ) { return array_length_type::length(a); } template< typename A > static bool empty( const A& a ) { return array_length_type::empty(a); } #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING template< typename A > static iterator begin( A& a ) { return a; } template< typename A > static const_iterator begin( const A& a ) { return a; } template< typename A > static iterator end( A& a ) { return a+array_length_type::length(a); } template< typename A > static const_iterator end( const A& a ) { return a+array_length_type::length(a); } #else // BOOST_NO_FUNCTION_TEMPLATE_ORDERING template< typename A > static result_iterator begin( A& a ) { return a; } template< typename A > static result_iterator end( A& a ) { return a+array_length_type::length(a); } #endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING }; template
struct array_container_traits_selector { typedef array_container_traits
type; }; // Pointer container traits --------------------------------------------------------------- template
struct pointer_container_traits { typedef BOOST_STRING_TYPENAME ::boost::remove_pointer
::type value_type; typedef BOOST_STRING_TYPENAME ::boost::remove_cv
::type char_type; typedef ::std::char_traits
char_traits; typedef value_type* iterator; typedef const value_type* const_iterator; typedef std::ptrdiff_t difference_type; typedef std::size_t size_type; typedef BOOST_STRING_TYPENAME ::boost::mpl::if_< ::boost::is_const
, const_iterator, iterator >::type result_iterator; // static operations template< typename P > static size_type size( const P& p ) { if ( p==0 ) return 0; else return char_traits::length(p); } template< typename P > static bool empty( const P& p ) { return p==0 || p[0]==0; } #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING template< typename P > static iterator begin( P& p ) { return p; } template< typename P > static const_iterator begin( const P& p ) { return p; } template< typename P > static iterator end( P& p ) { if ( p==0 ) return p; else return p+char_traits::length(p); } template< typename P > static const_iterator end( const P& p ) { if ( p==0 ) return p; else return p+char_traits::length(p); } #else // BOOST_NO_FUNCTION_TEMPLATE_ORDERING template< typename P > static result_iterator begin( P& p ) { return p; } template< typename P > static result_iterator end( P& p ) { if ( p==0 ) return p; else return p+char_traits::length(p); } #endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING }; template
struct pointer_container_traits_selector { typedef pointer_container_traits
type; }; } // namespace detail } // namespace algorithm } // namespace boost #endif // BOOST_STRING_DETAIL_COLLECTION_HPP
collection_traits_detail.hpp
Page URL
File URL
Prev
4/20
Next
Download
( 21 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.