update boost
This commit is contained in:
@@ -248,26 +248,26 @@ inline typename boost::lazy_enable_if_c<
|
||||
}
|
||||
|
||||
#define BOOST_LOG_MAKE_EXCEPTION_HANDLER_INTERNAL(z, n, data)\
|
||||
template< BOOST_PP_ENUM_PARAMS(n, typename T), typename HandlerT >\
|
||||
template< BOOST_PP_ENUM_PARAMS_Z(z, n, typename T), typename HandlerT >\
|
||||
inline exception_handler<\
|
||||
BOOST_PP_CAT(mpl::vector, n)< BOOST_PP_ENUM_PARAMS(n, T) >,\
|
||||
BOOST_PP_CAT(mpl::vector, n)< BOOST_PP_ENUM_PARAMS_Z(z, n, T) >,\
|
||||
HandlerT\
|
||||
> make_exception_handler(HandlerT const& handler)\
|
||||
{\
|
||||
typedef exception_handler<\
|
||||
BOOST_PP_CAT(mpl::vector, n)< BOOST_PP_ENUM_PARAMS(n, T) >,\
|
||||
BOOST_PP_CAT(mpl::vector, n)< BOOST_PP_ENUM_PARAMS_Z(z, n, T) >,\
|
||||
HandlerT\
|
||||
> eh_t;\
|
||||
return eh_t(handler);\
|
||||
}\
|
||||
template< BOOST_PP_ENUM_PARAMS(n, typename T), typename HandlerT >\
|
||||
template< BOOST_PP_ENUM_PARAMS_Z(z, n, typename T), typename HandlerT >\
|
||||
inline nothrow_exception_handler<\
|
||||
BOOST_PP_CAT(mpl::vector, n)< BOOST_PP_ENUM_PARAMS(n, T) >,\
|
||||
BOOST_PP_CAT(mpl::vector, n)< BOOST_PP_ENUM_PARAMS_Z(z, n, T) >,\
|
||||
HandlerT\
|
||||
> make_exception_handler(HandlerT const& handler, std::nothrow_t const&)\
|
||||
{\
|
||||
typedef nothrow_exception_handler<\
|
||||
BOOST_PP_CAT(mpl::vector, n)< BOOST_PP_ENUM_PARAMS(n, T) >,\
|
||||
BOOST_PP_CAT(mpl::vector, n)< BOOST_PP_ENUM_PARAMS_Z(z, n, T) >,\
|
||||
HandlerT\
|
||||
> eh_t;\
|
||||
return eh_t(handler);\
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
#include <boost/type_traits/is_scalar.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#include <boost/log/detail/config.hpp>
|
||||
#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
|
||||
#include <string_view>
|
||||
#endif
|
||||
#include <boost/log/detail/attachable_sstream_buf.hpp>
|
||||
#include <boost/log/detail/code_conversion.hpp>
|
||||
#include <boost/log/utility/string_literal_fwd.hpp>
|
||||
@@ -45,34 +48,52 @@ namespace aux {
|
||||
|
||||
template< typename T, typename R >
|
||||
struct enable_if_streamable_char_type {};
|
||||
template< typename T, typename R >
|
||||
struct disable_if_streamable_char_type { typedef R type; };
|
||||
template< typename R >
|
||||
struct enable_if_streamable_char_type< char, R > { typedef R type; };
|
||||
template< typename R >
|
||||
struct disable_if_streamable_char_type< char, R > {};
|
||||
template< typename R >
|
||||
struct enable_if_streamable_char_type< wchar_t, R > { typedef R type; };
|
||||
template< typename R >
|
||||
struct disable_if_streamable_char_type< wchar_t, R > {};
|
||||
#if !defined(BOOST_LOG_NO_CXX11_CODECVT_FACETS)
|
||||
#if !defined(BOOST_NO_CXX11_CHAR16_T)
|
||||
template< typename R >
|
||||
struct enable_if_streamable_char_type< char16_t, R > { typedef R type; };
|
||||
template< typename R >
|
||||
struct disable_if_streamable_char_type< char16_t, R > {};
|
||||
#endif
|
||||
#if !defined(BOOST_NO_CXX11_CHAR32_T)
|
||||
template< typename R >
|
||||
struct enable_if_streamable_char_type< char32_t, R > { typedef R type; };
|
||||
template< typename R >
|
||||
struct disable_if_streamable_char_type< char32_t, R > {};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
template< typename StreamT, typename T, bool ByValueV, typename R >
|
||||
struct enable_formatting_ostream_generic_operator {};
|
||||
|
||||
template< typename CharT, typename TraitsT, typename AllocatorT, typename T, typename R >
|
||||
struct enable_formatting_ostream_generic_operator< basic_formatting_ostream< CharT, TraitsT, AllocatorT >, T, false, R > :
|
||||
public boost::disable_if_c< boost::is_scalar< typename boost::remove_cv< T >::type >::value, R >
|
||||
{
|
||||
};
|
||||
|
||||
template< typename CharT, typename TraitsT, typename AllocatorT, typename T, typename R >
|
||||
struct enable_formatting_ostream_generic_operator< basic_formatting_ostream< CharT, TraitsT, AllocatorT >, T, true, R > :
|
||||
public boost::enable_if_c< boost::is_enum< typename boost::remove_cv< T >::type >::value, R >
|
||||
{
|
||||
};
|
||||
|
||||
template< typename CharT, typename TraitsT, typename AllocatorT, typename T, typename R >
|
||||
struct enable_formatting_ostream_generic_operator< basic_formatting_ostream< CharT, TraitsT, AllocatorT >, T*, true, R > :
|
||||
public disable_if_streamable_char_type< typename boost::remove_cv< T >::type, R >
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace aux
|
||||
|
||||
/*!
|
||||
@@ -528,12 +549,6 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
basic_formatting_ostream& operator<< (const void* value)
|
||||
{
|
||||
m_stream << value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
basic_formatting_ostream& operator<< (std::basic_streambuf< char_type, traits_type >* buf)
|
||||
{
|
||||
m_stream << buf;
|
||||
@@ -547,6 +562,15 @@ public:
|
||||
return strm.formatted_write(str.data(), static_cast< std::streamsize >(str.size()));
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
|
||||
template< typename OtherCharT, typename OtherTraitsT >
|
||||
friend typename aux::enable_if_streamable_char_type< OtherCharT, basic_formatting_ostream& >::type
|
||||
operator<< (basic_formatting_ostream& strm, std::basic_string_view< OtherCharT, OtherTraitsT > const& str)
|
||||
{
|
||||
return strm.formatted_write(str.data(), static_cast< std::streamsize >(str.size()));
|
||||
}
|
||||
#endif
|
||||
|
||||
template< typename OtherCharT, typename OtherTraitsT >
|
||||
friend typename aux::enable_if_streamable_char_type< OtherCharT, basic_formatting_ostream& >::type
|
||||
operator<< (basic_formatting_ostream& strm, basic_string_literal< OtherCharT, OtherTraitsT > const& str)
|
||||
@@ -576,6 +600,15 @@ public:
|
||||
return strm.formatted_write(str.data(), static_cast< std::streamsize >(str.size()));
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
|
||||
template< typename OtherCharT, typename OtherTraitsT >
|
||||
friend typename aux::enable_if_streamable_char_type< OtherCharT, basic_formatting_ostream& >::type
|
||||
operator<< (basic_formatting_ostream& strm, std::basic_string_view< OtherCharT, OtherTraitsT >& str)
|
||||
{
|
||||
return strm.formatted_write(str.data(), static_cast< std::streamsize >(str.size()));
|
||||
}
|
||||
#endif
|
||||
|
||||
template< typename OtherCharT, typename OtherTraitsT >
|
||||
friend typename aux::enable_if_streamable_char_type< OtherCharT, basic_formatting_ostream& >::type
|
||||
operator<< (basic_formatting_ostream& strm, basic_string_literal< OtherCharT, OtherTraitsT >& str)
|
||||
@@ -606,6 +639,15 @@ public:
|
||||
return strm.formatted_write(str.data(), static_cast< std::streamsize >(str.size()));
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
|
||||
template< typename OtherCharT, typename OtherTraitsT >
|
||||
friend typename aux::enable_if_streamable_char_type< OtherCharT, basic_formatting_ostream& >::type
|
||||
operator<< (basic_formatting_ostream&& strm, std::basic_string_view< OtherCharT, OtherTraitsT > const& str)
|
||||
{
|
||||
return strm.formatted_write(str.data(), static_cast< std::streamsize >(str.size()));
|
||||
}
|
||||
#endif
|
||||
|
||||
template< typename OtherCharT, typename OtherTraitsT >
|
||||
friend typename aux::enable_if_streamable_char_type< OtherCharT, basic_formatting_ostream& >::type
|
||||
operator<< (basic_formatting_ostream&& strm, basic_string_literal< OtherCharT, OtherTraitsT > const& str)
|
||||
@@ -635,6 +677,15 @@ public:
|
||||
return strm.formatted_write(str.data(), static_cast< std::streamsize >(str.size()));
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
|
||||
template< typename OtherCharT, typename OtherTraitsT >
|
||||
friend typename aux::enable_if_streamable_char_type< OtherCharT, basic_formatting_ostream& >::type
|
||||
operator<< (basic_formatting_ostream&& strm, std::basic_string_view< OtherCharT, OtherTraitsT >& str)
|
||||
{
|
||||
return strm.formatted_write(str.data(), static_cast< std::streamsize >(str.size()));
|
||||
}
|
||||
#endif
|
||||
|
||||
template< typename OtherCharT, typename OtherTraitsT >
|
||||
friend typename aux::enable_if_streamable_char_type< OtherCharT, basic_formatting_ostream& >::type
|
||||
operator<< (basic_formatting_ostream&& strm, basic_string_literal< OtherCharT, OtherTraitsT >& str)
|
||||
@@ -656,7 +707,7 @@ public:
|
||||
{
|
||||
return strm.formatted_write(str.data(), static_cast< std::streamsize >(str.size()));
|
||||
}
|
||||
#endif
|
||||
#endif // !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
|
||||
protected:
|
||||
void init_stream()
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#define BOOST_LOG_UTILITY_FUNCTIONAL_IN_RANGE_HPP_INCLUDED_
|
||||
|
||||
#include <utility>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/log/detail/config.hpp>
|
||||
#include <boost/log/utility/functional/logical.hpp> // make_common_integral_type
|
||||
#include <boost/log/detail/header.hpp>
|
||||
@@ -36,17 +38,17 @@ struct in_range_fun
|
||||
template< typename T, typename U >
|
||||
bool operator() (T const& value, std::pair< U, U > const& rng) const
|
||||
{
|
||||
return op(value, rng, typename mpl::and_< is_integral< T >, is_integral< U > >::type());
|
||||
return op(value, rng, integral_constant< bool, is_integral< T >::value && is_integral< U >::value >());
|
||||
}
|
||||
|
||||
private:
|
||||
template< typename T, typename U >
|
||||
static bool op(T const& value, std::pair< U, U > const& rng, mpl::false_ const&)
|
||||
static bool op(T const& value, std::pair< U, U > const& rng, false_type)
|
||||
{
|
||||
return (value >= rng.first && value < rng.second);
|
||||
}
|
||||
template< typename T, typename U >
|
||||
static bool op(T const& value, std::pair< U, U > const& rng, mpl::true_ const&)
|
||||
static bool op(T const& value, std::pair< U, U > const& rng, true_type)
|
||||
{
|
||||
typedef typename aux::make_common_integral_type< T, U >::type common_integral_type;
|
||||
return (static_cast< common_integral_type >(value) >= static_cast< common_integral_type >(rng.first))
|
||||
|
||||
@@ -21,11 +21,10 @@
|
||||
#ifndef BOOST_LOG_UTILITY_FUNCTIONAL_LOGICAL_HPP_INCLUDED_
|
||||
#define BOOST_LOG_UTILITY_FUNCTIONAL_LOGICAL_HPP_INCLUDED_
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/and.hpp>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <boost/type_traits/is_unsigned.hpp>
|
||||
#include <boost/type_traits/conditional.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/log/detail/config.hpp>
|
||||
#include <boost/log/detail/header.hpp>
|
||||
|
||||
@@ -56,8 +55,8 @@ struct make_common_integral_type< T, U, TSizeV, USizeV, true >
|
||||
//! Specialization for the case when both types have the same size
|
||||
template< typename T, typename U, unsigned int SizeV >
|
||||
struct make_common_integral_type< T, U, SizeV, SizeV, false > :
|
||||
public mpl::if_<
|
||||
is_unsigned< T >,
|
||||
public boost::conditional<
|
||||
is_unsigned< T >::value,
|
||||
T,
|
||||
U
|
||||
>
|
||||
@@ -74,17 +73,17 @@ struct equal_to
|
||||
template< typename T, typename U >
|
||||
bool operator() (T const& left, U const& right) const
|
||||
{
|
||||
return op(left, right, typename mpl::and_< is_integral< T >, is_integral< U > >::type());
|
||||
return op(left, right, integral_constant< bool, is_integral< T >::value && is_integral< U >::value >());
|
||||
}
|
||||
|
||||
private:
|
||||
template< typename T, typename U >
|
||||
static bool op(T const& left, U const& right, mpl::false_ const&)
|
||||
static bool op(T const& left, U const& right, false_type)
|
||||
{
|
||||
return (left == right);
|
||||
}
|
||||
template< typename T, typename U >
|
||||
static bool op(T const& left, U const& right, mpl::true_ const&)
|
||||
static bool op(T const& left, U const& right, true_type)
|
||||
{
|
||||
typedef typename aux::make_common_integral_type< T, U >::type common_integral_type;
|
||||
return static_cast< common_integral_type >(left) == static_cast< common_integral_type >(right);
|
||||
@@ -99,17 +98,17 @@ struct not_equal_to
|
||||
template< typename T, typename U >
|
||||
bool operator() (T const& left, U const& right) const
|
||||
{
|
||||
return op(left, right, typename mpl::and_< is_integral< T >, is_integral< U > >::type());
|
||||
return op(left, right, integral_constant< bool, is_integral< T >::value && is_integral< U >::value >());
|
||||
}
|
||||
|
||||
private:
|
||||
template< typename T, typename U >
|
||||
static bool op(T const& left, U const& right, mpl::false_ const&)
|
||||
static bool op(T const& left, U const& right, false_type)
|
||||
{
|
||||
return (left != right);
|
||||
}
|
||||
template< typename T, typename U >
|
||||
static bool op(T const& left, U const& right, mpl::true_ const&)
|
||||
static bool op(T const& left, U const& right, true_type)
|
||||
{
|
||||
typedef typename aux::make_common_integral_type< T, U >::type common_integral_type;
|
||||
return static_cast< common_integral_type >(left) != static_cast< common_integral_type >(right);
|
||||
@@ -124,17 +123,17 @@ struct less
|
||||
template< typename T, typename U >
|
||||
bool operator() (T const& left, U const& right) const
|
||||
{
|
||||
return op(left, right, typename mpl::and_< is_integral< T >, is_integral< U > >::type());
|
||||
return op(left, right, integral_constant< bool, is_integral< T >::value && is_integral< U >::value >());
|
||||
}
|
||||
|
||||
private:
|
||||
template< typename T, typename U >
|
||||
static bool op(T const& left, U const& right, mpl::false_ const&)
|
||||
static bool op(T const& left, U const& right, false_type)
|
||||
{
|
||||
return (left < right);
|
||||
}
|
||||
template< typename T, typename U >
|
||||
static bool op(T const& left, U const& right, mpl::true_ const&)
|
||||
static bool op(T const& left, U const& right, true_type)
|
||||
{
|
||||
typedef typename aux::make_common_integral_type< T, U >::type common_integral_type;
|
||||
return static_cast< common_integral_type >(left) < static_cast< common_integral_type >(right);
|
||||
@@ -149,17 +148,17 @@ struct greater
|
||||
template< typename T, typename U >
|
||||
bool operator() (T const& left, U const& right) const
|
||||
{
|
||||
return op(left, right, typename mpl::and_< is_integral< T >, is_integral< U > >::type());
|
||||
return op(left, right, integral_constant< bool, is_integral< T >::value && is_integral< U >::value >());
|
||||
}
|
||||
|
||||
private:
|
||||
template< typename T, typename U >
|
||||
static bool op(T const& left, U const& right, mpl::false_ const&)
|
||||
static bool op(T const& left, U const& right, false_type)
|
||||
{
|
||||
return (left > right);
|
||||
}
|
||||
template< typename T, typename U >
|
||||
static bool op(T const& left, U const& right, mpl::true_ const&)
|
||||
static bool op(T const& left, U const& right, true_type)
|
||||
{
|
||||
typedef typename aux::make_common_integral_type< T, U >::type common_integral_type;
|
||||
return static_cast< common_integral_type >(left) > static_cast< common_integral_type >(right);
|
||||
@@ -174,17 +173,17 @@ struct less_equal
|
||||
template< typename T, typename U >
|
||||
bool operator() (T const& left, U const& right) const
|
||||
{
|
||||
return op(left, right, typename mpl::and_< is_integral< T >, is_integral< U > >::type());
|
||||
return op(left, right, integral_constant< bool, is_integral< T >::value && is_integral< U >::value >());
|
||||
}
|
||||
|
||||
private:
|
||||
template< typename T, typename U >
|
||||
static bool op(T const& left, U const& right, mpl::false_ const&)
|
||||
static bool op(T const& left, U const& right, false_type)
|
||||
{
|
||||
return (left <= right);
|
||||
}
|
||||
template< typename T, typename U >
|
||||
static bool op(T const& left, U const& right, mpl::true_ const&)
|
||||
static bool op(T const& left, U const& right, true_type)
|
||||
{
|
||||
typedef typename aux::make_common_integral_type< T, U >::type common_integral_type;
|
||||
return static_cast< common_integral_type >(left) <= static_cast< common_integral_type >(right);
|
||||
@@ -199,17 +198,17 @@ struct greater_equal
|
||||
template< typename T, typename U >
|
||||
bool operator() (T const& left, U const& right) const
|
||||
{
|
||||
return op(left, right, typename mpl::and_< is_integral< T >, is_integral< U > >::type());
|
||||
return op(left, right, integral_constant< bool, is_integral< T >::value && is_integral< U >::value >());
|
||||
}
|
||||
|
||||
private:
|
||||
template< typename T, typename U >
|
||||
static bool op(T const& left, U const& right, mpl::false_ const&)
|
||||
static bool op(T const& left, U const& right, false_type)
|
||||
{
|
||||
return (left >= right);
|
||||
}
|
||||
template< typename T, typename U >
|
||||
static bool op(T const& left, U const& right, mpl::true_ const&)
|
||||
static bool op(T const& left, U const& right, true_type)
|
||||
{
|
||||
typedef typename aux::make_common_integral_type< T, U >::type common_integral_type;
|
||||
return static_cast< common_integral_type >(left) >= static_cast< common_integral_type >(right);
|
||||
|
||||
@@ -53,6 +53,10 @@ template< typename R >
|
||||
struct enable_if_byte< signed char, R > { typedef R type; };
|
||||
template< typename R >
|
||||
struct enable_if_byte< unsigned char, R > { typedef R type; };
|
||||
#if defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603
|
||||
template< typename R >
|
||||
struct enable_if_byte< std::byte, R > { typedef R type; };
|
||||
#endif
|
||||
|
||||
} // namespace aux
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <boost/log/utility/manipulators/add_value.hpp>
|
||||
#include <boost/log/utility/manipulators/to_log.hpp>
|
||||
#include <boost/log/utility/manipulators/dump.hpp>
|
||||
#include <boost/log/utility/manipulators/auto_newline.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
#ifndef BOOST_LOG_UTILITY_MANIPULATORS_ADD_VALUE_HPP_INCLUDED_
|
||||
#define BOOST_LOG_UTILITY_MANIPULATORS_ADD_VALUE_HPP_INCLUDED_
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits/is_scalar.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/type_traits/conditional.hpp>
|
||||
#include <boost/log/detail/config.hpp>
|
||||
#include <boost/log/detail/embedded_string_type.hpp>
|
||||
#include <boost/log/attributes/attribute_name.hpp>
|
||||
@@ -61,14 +61,14 @@ private:
|
||||
// To work around this problem we save the value inside the manipulator in this case.
|
||||
typedef typename remove_reference< reference_type >::type& lvalue_reference_type;
|
||||
|
||||
typedef typename mpl::if_<
|
||||
is_scalar< value_type >,
|
||||
typedef typename conditional<
|
||||
is_scalar< value_type >::value,
|
||||
value_type,
|
||||
lvalue_reference_type
|
||||
>::type stored_type;
|
||||
|
||||
typedef typename mpl::if_<
|
||||
is_scalar< value_type >,
|
||||
typedef typename conditional<
|
||||
is_scalar< value_type >::value,
|
||||
value_type,
|
||||
reference_type
|
||||
>::type get_value_result_type;
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright Andrey Semashev 2019.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* https://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
/*!
|
||||
* \file utility/manipulators/auto_newline.hpp
|
||||
* \author Andrey Semashev
|
||||
* \date 23.06.2019
|
||||
*
|
||||
* The header contains implementation of a stream manipulator for inserting a newline, unless there is already one inserted.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_LOG_UTILITY_MANIPULATORS_AUTO_NEWLINE_HPP_INCLUDED_
|
||||
#define BOOST_LOG_UTILITY_MANIPULATORS_AUTO_NEWLINE_HPP_INCLUDED_
|
||||
|
||||
#include <boost/log/detail/config.hpp>
|
||||
#include <boost/log/utility/formatting_ostream_fwd.hpp>
|
||||
#include <boost/log/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
BOOST_LOG_OPEN_NAMESPACE
|
||||
|
||||
/*!
|
||||
* Stream manipulator for inserting a newline character, unless the last character
|
||||
* inserted into the stream is already a newline.
|
||||
*/
|
||||
struct auto_newline_manip {}
|
||||
BOOST_INLINE_VARIABLE const auto_newline = {};
|
||||
|
||||
/*!
|
||||
* Stream output operator for the \c auto_newline manipulator
|
||||
*/
|
||||
template< typename CharT, typename TraitsT, typename AllocatorT >
|
||||
inline basic_formatting_ostream< CharT, TraitsT, AllocatorT >& operator<< (basic_formatting_ostream< CharT, TraitsT, AllocatorT >& strm, auto_newline_manip)
|
||||
{
|
||||
typedef basic_formatting_ostream< CharT, TraitsT, AllocatorT > stream_type;
|
||||
typedef typename stream_type::char_type char_type;
|
||||
typedef typename stream_type::string_type string_type;
|
||||
if (BOOST_LIKELY(strm.good()))
|
||||
{
|
||||
string_type* str = strm.rdbuf()->storage();
|
||||
if (BOOST_LIKELY(!!str))
|
||||
{
|
||||
strm.rdbuf()->pubsync();
|
||||
if (str->empty() || *str->rbegin() != static_cast< char_type >('\n'))
|
||||
strm.rdbuf()->push_back(static_cast< char_type >('\n'));
|
||||
}
|
||||
}
|
||||
|
||||
return strm;
|
||||
}
|
||||
|
||||
BOOST_LOG_CLOSE_NAMESPACE // namespace log
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/log/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_LOG_UTILITY_MANIPULATORS_AUTO_NEWLINE_HPP_INCLUDED_
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
template< typename CharT, typename TraitsT >
|
||||
inline std::basic_ostream< CharT, TraitsT >& operator<< (std::basic_ostream< CharT, TraitsT >& strm, dump_manip const& manip)
|
||||
{
|
||||
if (strm.good())
|
||||
if (BOOST_LIKELY(strm.good()))
|
||||
aux::dump_data(manip.get_data(), manip.get_size(), strm);
|
||||
|
||||
return strm;
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
template< typename CharT, typename TraitsT >
|
||||
inline std::basic_ostream< CharT, TraitsT >& operator<< (std::basic_ostream< CharT, TraitsT >& strm, bounded_dump_manip const& manip)
|
||||
{
|
||||
if (strm.good())
|
||||
if (BOOST_LIKELY(strm.good()))
|
||||
{
|
||||
const std::size_t size = manip.get_size(), max_size = manip.get_max_size();
|
||||
if (max_size >= size)
|
||||
|
||||
160
linx64/include/boost/log/utility/manipulators/invoke.hpp
Normal file
160
linx64/include/boost/log/utility/manipulators/invoke.hpp
Normal file
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* Copyright Andrey Semashev 2022.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* https://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
/*!
|
||||
* \file utility/manipulators/invoke.hpp
|
||||
* \author Andrey Semashev
|
||||
* \date 27.02.2022
|
||||
*
|
||||
* The header contains implementation of a stream manipulator for invoking a user-defined function.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_LOG_UTILITY_MANIPULATORS_INVOKE_HPP_INCLUDED_
|
||||
#define BOOST_LOG_UTILITY_MANIPULATORS_INVOKE_HPP_INCLUDED_
|
||||
|
||||
#include <cstddef>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <boost/log/detail/config.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#endif
|
||||
#include <boost/log/detail/is_ostream.hpp>
|
||||
#include <boost/log/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
BOOST_LOG_OPEN_NAMESPACE
|
||||
|
||||
/*!
|
||||
* Stream manipulator for invoking a user-defined function as part of stream output.
|
||||
*/
|
||||
template< typename FunctionT >
|
||||
class invoke_manipulator
|
||||
{
|
||||
private:
|
||||
mutable FunctionT m_function;
|
||||
|
||||
public:
|
||||
//! Initializing constructor
|
||||
explicit invoke_manipulator(FunctionT const& func) :
|
||||
m_function(func)
|
||||
{
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
//! Initializing constructor
|
||||
explicit invoke_manipulator(FunctionT&& func) :
|
||||
m_function(static_cast< FunctionT&& >(func))
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
//! The method invokes the saved function with the output stream
|
||||
template< typename StreamT >
|
||||
void output(StreamT& stream) const
|
||||
{
|
||||
m_function(stream);
|
||||
}
|
||||
};
|
||||
|
||||
/*!
|
||||
* Stream output operator for \c invoke_manipulator. Invokes the function saved in the manipulator.
|
||||
*/
|
||||
template< typename StreamT, typename FunctionT >
|
||||
inline typename boost::enable_if_c< log::aux::is_ostream< StreamT >::value, StreamT& >::type operator<< (StreamT& stream, invoke_manipulator< FunctionT > const& manip)
|
||||
{
|
||||
manip.output(stream);
|
||||
return stream;
|
||||
}
|
||||
|
||||
#if !defined(BOOST_LOG_DOXYGEN_PASS)
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
|
||||
//! Invoke manipulator generator function
|
||||
template< typename FunctionT >
|
||||
inline invoke_manipulator<
|
||||
typename boost::remove_cv<
|
||||
typename boost::remove_reference< FunctionT >::type
|
||||
>::type
|
||||
>
|
||||
invoke_manip(FunctionT&& func)
|
||||
{
|
||||
return invoke_manipulator<
|
||||
typename boost::remove_cv<
|
||||
typename boost::remove_reference< FunctionT >::type
|
||||
>::type
|
||||
>(static_cast< FunctionT&& >(func));
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \
|
||||
!defined(BOOST_NO_CXX14_GENERIC_LAMBDAS) && \
|
||||
!defined(BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION)
|
||||
|
||||
//! Invoke manipulator generator function
|
||||
template< typename FunctionT, typename Arg0, typename... Args >
|
||||
inline auto invoke_manip(FunctionT&& func, Arg0&& arg0, Args&&... args)
|
||||
{
|
||||
return boost::log::invoke_manip
|
||||
(
|
||||
#if !defined(BOOST_LOG_NO_CXX20_PACK_EXPANSION_IN_LAMBDA_INIT_CAPTURE)
|
||||
[func = static_cast< FunctionT&& >(func), arg0 = static_cast< Arg0&& >(arg0), ...args = static_cast< Args&& >(args)](auto& stream) mutable
|
||||
#else
|
||||
[func, arg0, args...](auto& stream) mutable
|
||||
#endif
|
||||
{
|
||||
#if !defined(BOOST_MSVC) || BOOST_MSVC >= 1910
|
||||
static_cast< FunctionT&& >(func)(stream, static_cast< Arg0&& >(arg0), static_cast< Args&& >(args)...);
|
||||
#else
|
||||
// MSVC 19.0 (VS 14.0) ICEs if we use perfect forwarding here
|
||||
func(stream, arg0, args...);
|
||||
#endif
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#endif // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) ...
|
||||
|
||||
#else // !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
|
||||
//! Invoke manipulator generator function
|
||||
template< typename FunctionT >
|
||||
inline invoke_manipulator< typename boost::remove_cv< FunctionT >::type >
|
||||
invoke_manip(FunctionT const& func)
|
||||
{
|
||||
return invoke_manipulator< typename boost::remove_cv< FunctionT >::type >(func);
|
||||
}
|
||||
|
||||
#endif // !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
|
||||
#else // !defined(BOOST_LOG_DOXYGEN_PASS)
|
||||
|
||||
/*!
|
||||
* Invoke manipulator generator function.
|
||||
*
|
||||
* \param func User-defined function to invoke on output. The function must be callable with a reference to the output stream as the first argument, followed by \a args.
|
||||
* \param args Additional arguments to pass to \a func.
|
||||
* \returns Manipulator to be inserted into the stream.
|
||||
*
|
||||
* \note \a args are only supported since C++14.
|
||||
*/
|
||||
template< typename FunctionT, typename... Args >
|
||||
invoke_manipulator< unspecified > invoke_manip(FunctionT&& func, Args&&... args);
|
||||
|
||||
#endif // !defined(BOOST_LOG_DOXYGEN_PASS)
|
||||
|
||||
BOOST_LOG_CLOSE_NAMESPACE // namespace log
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/log/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_LOG_UTILITY_MANIPULATORS_INVOKE_HPP_INCLUDED_
|
||||
267
linx64/include/boost/log/utility/manipulators/optional.hpp
Normal file
267
linx64/include/boost/log/utility/manipulators/optional.hpp
Normal file
@@ -0,0 +1,267 @@
|
||||
/*
|
||||
* Copyright Andrey Semashev 2020.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* https://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
/*!
|
||||
* \file utility/manipulators/optional.hpp
|
||||
* \author Andrey Semashev
|
||||
* \date 12.05.2020
|
||||
*
|
||||
* The header contains implementation of a stream manipulator for inserting an optional value.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_LOG_UTILITY_MANIPULATORS_OPTIONAL_HPP_INCLUDED_
|
||||
#define BOOST_LOG_UTILITY_MANIPULATORS_OPTIONAL_HPP_INCLUDED_
|
||||
|
||||
#include <cstddef>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
#include <boost/type_traits/is_scalar.hpp>
|
||||
#include <boost/type_traits/conditional.hpp>
|
||||
#include <boost/log/detail/config.hpp>
|
||||
#include <boost/log/detail/is_ostream.hpp>
|
||||
#include <boost/log/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
BOOST_LOG_OPEN_NAMESPACE
|
||||
|
||||
/*!
|
||||
* Stream manipulator for inserting an optional value.
|
||||
*/
|
||||
template< typename OptionalT, typename NoneT >
|
||||
class optional_manipulator
|
||||
{
|
||||
private:
|
||||
typedef typename conditional<
|
||||
is_scalar< OptionalT >::value,
|
||||
OptionalT,
|
||||
OptionalT const&
|
||||
>::type stored_optional_type;
|
||||
|
||||
typedef typename conditional<
|
||||
is_scalar< NoneT >::value,
|
||||
NoneT,
|
||||
NoneT const&
|
||||
>::type stored_none_type;
|
||||
|
||||
private:
|
||||
stored_optional_type m_optional;
|
||||
stored_none_type m_none;
|
||||
|
||||
public:
|
||||
//! Initializing constructor
|
||||
optional_manipulator(stored_optional_type opt, stored_none_type none) BOOST_NOEXCEPT :
|
||||
m_optional(opt),
|
||||
m_none(none)
|
||||
{
|
||||
}
|
||||
|
||||
//! The method outputs the value, if it is present, otherwise outputs the "none" marker
|
||||
template< typename StreamT >
|
||||
void output(StreamT& stream) const
|
||||
{
|
||||
if (!!m_optional)
|
||||
stream << *m_optional;
|
||||
else
|
||||
stream << m_none;
|
||||
}
|
||||
};
|
||||
|
||||
/*!
|
||||
* Stream manipulator for inserting an optional value. Specialization for no "none" marker.
|
||||
*/
|
||||
template< typename OptionalT >
|
||||
class optional_manipulator< OptionalT, void >
|
||||
{
|
||||
private:
|
||||
typedef typename conditional<
|
||||
is_scalar< OptionalT >::value,
|
||||
OptionalT,
|
||||
OptionalT const&
|
||||
>::type stored_optional_type;
|
||||
|
||||
private:
|
||||
stored_optional_type m_optional;
|
||||
|
||||
public:
|
||||
//! Initializing constructor
|
||||
optional_manipulator(stored_optional_type opt) BOOST_NOEXCEPT :
|
||||
m_optional(opt)
|
||||
{
|
||||
}
|
||||
|
||||
//! The method outputs the value, if it is present
|
||||
template< typename StreamT >
|
||||
void output(StreamT& stream) const
|
||||
{
|
||||
if (!!m_optional)
|
||||
stream << *m_optional;
|
||||
}
|
||||
};
|
||||
|
||||
/*!
|
||||
* Stream output operator for \c optional_manipulator. Outputs the optional value or the "none" marker, if one was specified on manipulator construction.
|
||||
*/
|
||||
template< typename StreamT, typename OptionalT, typename NoneT >
|
||||
inline typename boost::enable_if_c< log::aux::is_ostream< StreamT >::value, StreamT& >::type operator<< (StreamT& strm, optional_manipulator< OptionalT, NoneT > const& manip)
|
||||
{
|
||||
manip.output(strm);
|
||||
return strm;
|
||||
}
|
||||
|
||||
/*!
|
||||
* Optional manipulator generator function.
|
||||
*
|
||||
* \param opt Optional value to output. The optional value must support contextual conversion to \c bool and dereferencing, and its dereferencing result must support stream output.
|
||||
* \param none Marker used to indicate when the value is not present. Optional. If not specified, nothing is output if the value is not present.
|
||||
* \returns Manipulator to be inserted into the stream.
|
||||
*
|
||||
* \note Both \a opt and \a none objects must outlive the created manipulator object.
|
||||
*/
|
||||
template< typename OptionalT, typename NoneT >
|
||||
inline typename boost::enable_if_c<
|
||||
is_scalar< OptionalT >::value && is_scalar< NoneT >::value,
|
||||
optional_manipulator< OptionalT, NoneT >
|
||||
>::type optional_manip(OptionalT opt, NoneT none) BOOST_NOEXCEPT
|
||||
{
|
||||
return optional_manipulator< OptionalT, NoneT >(opt, none);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Optional manipulator generator function.
|
||||
*
|
||||
* \param opt Optional value to output. The optional value must support contextual conversion to \c bool and dereferencing, and its dereferencing result must support stream output.
|
||||
* \param none Marker used to indicate when the value is not present. Optional. If not specified, nothing is output if the value is not present.
|
||||
* \returns Manipulator to be inserted into the stream.
|
||||
*
|
||||
* \note Both \a opt and \a none objects must outlive the created manipulator object.
|
||||
*/
|
||||
template< typename OptionalT, typename NoneT >
|
||||
inline typename boost::enable_if_c<
|
||||
is_scalar< OptionalT >::value && !is_scalar< NoneT >::value,
|
||||
optional_manipulator< OptionalT, NoneT >
|
||||
>::type optional_manip(OptionalT opt, NoneT const& none) BOOST_NOEXCEPT
|
||||
{
|
||||
return optional_manipulator< OptionalT, NoneT >(opt, none);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Optional manipulator generator function.
|
||||
*
|
||||
* \param opt Optional value to output. The optional value must support contextual conversion to \c bool and dereferencing, and its dereferencing result must support stream output.
|
||||
* \param none Marker used to indicate when the value is not present. Optional. If not specified, nothing is output if the value is not present.
|
||||
* \returns Manipulator to be inserted into the stream.
|
||||
*
|
||||
* \note Both \a opt and \a none objects must outlive the created manipulator object.
|
||||
*/
|
||||
template< typename OptionalT, typename NoneElementT, std::size_t N >
|
||||
inline typename boost::enable_if_c<
|
||||
is_scalar< OptionalT >::value,
|
||||
optional_manipulator< OptionalT, NoneElementT* >
|
||||
>::type optional_manip(OptionalT opt, NoneElementT (&none)[N]) BOOST_NOEXCEPT
|
||||
{
|
||||
return optional_manipulator< OptionalT, NoneElementT* >(opt, none);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Optional manipulator generator function.
|
||||
*
|
||||
* \param opt Optional value to output. The optional value must support contextual conversion to \c bool and dereferencing, and its dereferencing result must support stream output.
|
||||
* \param none Marker used to indicate when the value is not present. Optional. If not specified, nothing is output if the value is not present.
|
||||
* \returns Manipulator to be inserted into the stream.
|
||||
*
|
||||
* \note Both \a opt and \a none objects must outlive the created manipulator object.
|
||||
*/
|
||||
template< typename OptionalT, typename NoneT >
|
||||
inline typename boost::enable_if_c<
|
||||
!is_scalar< OptionalT >::value && !is_array< OptionalT >::value && is_scalar< NoneT >::value,
|
||||
optional_manipulator< OptionalT, NoneT >
|
||||
>::type optional_manip(OptionalT const& opt, NoneT none) BOOST_NOEXCEPT
|
||||
{
|
||||
return optional_manipulator< OptionalT, NoneT >(opt, none);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Optional manipulator generator function.
|
||||
*
|
||||
* \param opt Optional value to output. The optional value must support contextual conversion to \c bool and dereferencing, and its dereferencing result must support stream output.
|
||||
* \param none Marker used to indicate when the value is not present. Optional. If not specified, nothing is output if the value is not present.
|
||||
* \returns Manipulator to be inserted into the stream.
|
||||
*
|
||||
* \note Both \a opt and \a none objects must outlive the created manipulator object.
|
||||
*/
|
||||
template< typename OptionalT, typename NoneT >
|
||||
inline typename boost::enable_if_c<
|
||||
!is_scalar< OptionalT >::value && !is_array< OptionalT >::value && !is_scalar< NoneT >::value,
|
||||
optional_manipulator< OptionalT, NoneT >
|
||||
>::type optional_manip(OptionalT const& opt, NoneT const& none) BOOST_NOEXCEPT
|
||||
{
|
||||
return optional_manipulator< OptionalT, NoneT >(opt, none);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Optional manipulator generator function.
|
||||
*
|
||||
* \param opt Optional value to output. The optional value must support contextual conversion to \c bool and dereferencing, and its dereferencing result must support stream output.
|
||||
* \param none Marker used to indicate when the value is not present. Optional. If not specified, nothing is output if the value is not present.
|
||||
* \returns Manipulator to be inserted into the stream.
|
||||
*
|
||||
* \note Both \a opt and \a none objects must outlive the created manipulator object.
|
||||
*/
|
||||
template< typename OptionalT, typename NoneElementT, std::size_t N >
|
||||
inline typename boost::enable_if_c<
|
||||
!is_scalar< OptionalT >::value && !is_array< OptionalT >::value,
|
||||
optional_manipulator< OptionalT, NoneElementT* >
|
||||
>::type optional_manip(OptionalT const& opt, NoneElementT (&none)[N]) BOOST_NOEXCEPT
|
||||
{
|
||||
return optional_manipulator< OptionalT, NoneElementT* >(opt, none);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Optional manipulator generator function.
|
||||
*
|
||||
* \param opt Optional value to output. The optional value must support contextual conversion to \c bool and dereferencing, and its dereferencing result must support stream output.
|
||||
* \returns Manipulator to be inserted into the stream.
|
||||
*
|
||||
* \note \a opt object must outlive the created manipulator object.
|
||||
*/
|
||||
template< typename OptionalT >
|
||||
inline typename boost::enable_if_c<
|
||||
is_scalar< OptionalT >::value,
|
||||
optional_manipulator< OptionalT, void >
|
||||
>::type optional_manip(OptionalT opt) BOOST_NOEXCEPT
|
||||
{
|
||||
return optional_manipulator< OptionalT, void >(opt);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Optional manipulator generator function.
|
||||
*
|
||||
* \param opt Optional value to output. The optional value must support contextual conversion to \c bool and dereferencing, and its dereferencing result must support stream output.
|
||||
* \returns Manipulator to be inserted into the stream.
|
||||
*
|
||||
* \note \a opt object must outlive the created manipulator object.
|
||||
*/
|
||||
template< typename OptionalT >
|
||||
inline typename boost::enable_if_c<
|
||||
!is_scalar< OptionalT >::value && !is_array< OptionalT >::value,
|
||||
optional_manipulator< OptionalT, void >
|
||||
>::type optional_manip(OptionalT const& opt) BOOST_NOEXCEPT
|
||||
{
|
||||
return optional_manipulator< OptionalT, void >(opt);
|
||||
}
|
||||
|
||||
BOOST_LOG_CLOSE_NAMESPACE // namespace log
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/log/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_LOG_UTILITY_MANIPULATORS_OPTIONAL_HPP_INCLUDED_
|
||||
195
linx64/include/boost/log/utility/manipulators/range.hpp
Normal file
195
linx64/include/boost/log/utility/manipulators/range.hpp
Normal file
@@ -0,0 +1,195 @@
|
||||
/*
|
||||
* Copyright Andrey Semashev 2020.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* https://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
/*!
|
||||
* \file utility/manipulators/range.hpp
|
||||
* \author Andrey Semashev
|
||||
* \date 11.05.2020
|
||||
*
|
||||
* The header contains implementation of a stream manipulator for inserting a range of elements, optionally separated with a delimiter.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_LOG_UTILITY_MANIPULATORS_RANGE_HPP_INCLUDED_
|
||||
#define BOOST_LOG_UTILITY_MANIPULATORS_RANGE_HPP_INCLUDED_
|
||||
|
||||
#include <cstddef>
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/end.hpp>
|
||||
#include <boost/range/const_iterator.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <boost/type_traits/is_scalar.hpp>
|
||||
#include <boost/type_traits/conditional.hpp>
|
||||
#include <boost/log/detail/config.hpp>
|
||||
#include <boost/log/detail/is_ostream.hpp>
|
||||
#include <boost/log/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
BOOST_LOG_OPEN_NAMESPACE
|
||||
|
||||
/*!
|
||||
* Stream manipulator for inserting a range of elements, optionally separated with a delimiter.
|
||||
*/
|
||||
template< typename RangeT, typename DelimiterT >
|
||||
class range_manipulator
|
||||
{
|
||||
private:
|
||||
typedef typename conditional<
|
||||
is_scalar< DelimiterT >::value,
|
||||
DelimiterT,
|
||||
DelimiterT const&
|
||||
>::type stored_delimiter_type;
|
||||
|
||||
private:
|
||||
RangeT const& m_range;
|
||||
stored_delimiter_type m_delimiter;
|
||||
|
||||
public:
|
||||
//! Initializing constructor
|
||||
range_manipulator(RangeT const& range, stored_delimiter_type delimiter) BOOST_NOEXCEPT :
|
||||
m_range(range),
|
||||
m_delimiter(delimiter)
|
||||
{
|
||||
}
|
||||
|
||||
//! The method outputs elements of the range separated with delimiter
|
||||
template< typename StreamT >
|
||||
void output(StreamT& stream) const
|
||||
{
|
||||
typedef typename boost::range_const_iterator< RangeT >::type const_iterator;
|
||||
const_iterator it = boost::begin(m_range);
|
||||
const const_iterator end = boost::end(m_range);
|
||||
if (BOOST_LIKELY(it != end))
|
||||
{
|
||||
stream << *it;
|
||||
|
||||
for (++it; it != end; ++it)
|
||||
{
|
||||
stream << m_delimiter;
|
||||
stream << *it;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*!
|
||||
* Stream manipulator for inserting a range of elements. Specialization for when there is no delimiter.
|
||||
*/
|
||||
template< typename RangeT >
|
||||
class range_manipulator< RangeT, void >
|
||||
{
|
||||
private:
|
||||
RangeT const& m_range;
|
||||
|
||||
public:
|
||||
//! Initializing constructor
|
||||
explicit range_manipulator(RangeT const& range) BOOST_NOEXCEPT :
|
||||
m_range(range)
|
||||
{
|
||||
}
|
||||
|
||||
//! The method outputs elements of the range
|
||||
template< typename StreamT >
|
||||
void output(StreamT& stream) const
|
||||
{
|
||||
typedef typename boost::range_const_iterator< RangeT >::type const_iterator;
|
||||
const_iterator it = boost::begin(m_range);
|
||||
const const_iterator end = boost::end(m_range);
|
||||
for (; it != end; ++it)
|
||||
{
|
||||
stream << *it;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*!
|
||||
* Stream output operator for \c range_manipulator. Outputs every element of the range, separated with a delimiter, if one was specified on manipulator construction.
|
||||
*/
|
||||
template< typename StreamT, typename RangeT, typename DelimiterT >
|
||||
inline typename boost::enable_if_c< log::aux::is_ostream< StreamT >::value, StreamT& >::type operator<< (StreamT& strm, range_manipulator< RangeT, DelimiterT > const& manip)
|
||||
{
|
||||
if (BOOST_LIKELY(strm.good()))
|
||||
manip.output(strm);
|
||||
|
||||
return strm;
|
||||
}
|
||||
|
||||
/*!
|
||||
* Range manipulator generator function.
|
||||
*
|
||||
* \param range Range of elements to output. The range must support begin and end iterators, and its elements must support stream output.
|
||||
* \param delimiter Delimiter to separate elements in the output. Optional. If not specified, elements are output without separation.
|
||||
* \returns Manipulator to be inserted into the stream.
|
||||
*
|
||||
* \note Both \a range and \a delimiter objects must outlive the created manipulator object.
|
||||
*/
|
||||
template< typename RangeT, typename DelimiterT >
|
||||
inline typename boost::enable_if_c<
|
||||
is_scalar< DelimiterT >::value,
|
||||
range_manipulator< RangeT, DelimiterT >
|
||||
>::type range_manip(RangeT const& range, DelimiterT delimiter) BOOST_NOEXCEPT
|
||||
{
|
||||
return range_manipulator< RangeT, DelimiterT >(range, delimiter);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Range manipulator generator function.
|
||||
*
|
||||
* \param range Range of elements to output. The range must support begin and end iterators, and its elements must support stream output.
|
||||
* \param delimiter Delimiter to separate elements in the output. Optional. If not specified, elements are output without separation.
|
||||
* \returns Manipulator to be inserted into the stream.
|
||||
*
|
||||
* \note Both \a range and \a delimiter objects must outlive the created manipulator object.
|
||||
*/
|
||||
template< typename RangeT, typename DelimiterT >
|
||||
inline typename boost::disable_if_c<
|
||||
is_scalar< DelimiterT >::value,
|
||||
range_manipulator< RangeT, DelimiterT >
|
||||
>::type range_manip(RangeT const& range, DelimiterT const& delimiter) BOOST_NOEXCEPT
|
||||
{
|
||||
return range_manipulator< RangeT, DelimiterT >(range, delimiter);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Range manipulator generator function.
|
||||
*
|
||||
* \param range Range of elements to output. The range must support begin and end iterators, and its elements must support stream output.
|
||||
* \param delimiter Delimiter to separate elements in the output. Optional. If not specified, elements are output without separation.
|
||||
* \returns Manipulator to be inserted into the stream.
|
||||
*
|
||||
* \note Both \a range and \a delimiter objects must outlive the created manipulator object.
|
||||
*/
|
||||
template< typename RangeT, typename DelimiterElementT, std::size_t N >
|
||||
inline range_manipulator< RangeT, DelimiterElementT* > range_manip(RangeT const& range, DelimiterElementT (&delimiter)[N]) BOOST_NOEXCEPT
|
||||
{
|
||||
return range_manipulator< RangeT, DelimiterElementT* >(range, delimiter);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Range manipulator generator function.
|
||||
*
|
||||
* \param range Range of elements to output. The range must support begin and end iterators, and its elements must support stream output.
|
||||
* \returns Manipulator to be inserted into the stream.
|
||||
*
|
||||
* \note \a delimiter object must outlive the created manipulator object.
|
||||
*/
|
||||
template< typename RangeT >
|
||||
inline range_manipulator< RangeT, void > range_manip(RangeT const& range) BOOST_NOEXCEPT
|
||||
{
|
||||
return range_manipulator< RangeT, void >(range);
|
||||
}
|
||||
|
||||
BOOST_LOG_CLOSE_NAMESPACE // namespace log
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/log/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_LOG_UTILITY_MANIPULATORS_RANGE_HPP_INCLUDED_
|
||||
228
linx64/include/boost/log/utility/manipulators/tuple.hpp
Normal file
228
linx64/include/boost/log/utility/manipulators/tuple.hpp
Normal file
@@ -0,0 +1,228 @@
|
||||
/*
|
||||
* Copyright Andrey Semashev 2020.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* https://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
/*!
|
||||
* \file utility/manipulators/tuple.hpp
|
||||
* \author Andrey Semashev
|
||||
* \date 11.05.2020
|
||||
*
|
||||
* The header contains implementation of a stream manipulator for inserting a tuple or any heterogeneous sequence of elements, optionally separated with a delimiter.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_LOG_UTILITY_MANIPULATORS_TUPLE_HPP_INCLUDED_
|
||||
#define BOOST_LOG_UTILITY_MANIPULATORS_TUPLE_HPP_INCLUDED_
|
||||
|
||||
#include <cstddef>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <boost/type_traits/is_scalar.hpp>
|
||||
#include <boost/type_traits/conditional.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/fusion/include/fold.hpp>
|
||||
#include <boost/fusion/include/for_each.hpp>
|
||||
#include <boost/log/detail/config.hpp>
|
||||
#include <boost/log/detail/is_ostream.hpp>
|
||||
#include <boost/log/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
BOOST_LOG_OPEN_NAMESPACE
|
||||
|
||||
/*!
|
||||
* Stream manipulator for inserting a heterogeneous sequence of elements, optionally separated with a delimiter.
|
||||
*/
|
||||
template< typename TupleT, typename DelimiterT >
|
||||
class tuple_manipulator
|
||||
{
|
||||
private:
|
||||
typedef typename conditional<
|
||||
is_scalar< DelimiterT >::value,
|
||||
DelimiterT,
|
||||
DelimiterT const&
|
||||
>::type stored_delimiter_type;
|
||||
|
||||
template< typename StreamT >
|
||||
struct output_visitor
|
||||
{
|
||||
typedef boost::true_type result_type;
|
||||
|
||||
output_visitor(StreamT& stream, stored_delimiter_type delimiter) BOOST_NOEXCEPT :
|
||||
m_stream(stream),
|
||||
m_delimiter(delimiter)
|
||||
{
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
result_type operator() (boost::true_type, T const& elem) const
|
||||
{
|
||||
m_stream << m_delimiter;
|
||||
return operator()(boost::false_type(), elem);
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
result_type operator() (boost::false_type, T const& elem) const
|
||||
{
|
||||
m_stream << elem;
|
||||
return result_type();
|
||||
}
|
||||
|
||||
private:
|
||||
StreamT& m_stream;
|
||||
stored_delimiter_type m_delimiter;
|
||||
};
|
||||
|
||||
private:
|
||||
TupleT const& m_tuple;
|
||||
stored_delimiter_type m_delimiter;
|
||||
|
||||
public:
|
||||
//! Initializing constructor
|
||||
tuple_manipulator(TupleT const& tuple, stored_delimiter_type delimiter) BOOST_NOEXCEPT :
|
||||
m_tuple(tuple),
|
||||
m_delimiter(delimiter)
|
||||
{
|
||||
}
|
||||
|
||||
//! The method outputs elements of the sequence separated with delimiter
|
||||
template< typename StreamT >
|
||||
void output(StreamT& stream) const
|
||||
{
|
||||
boost::fusion::fold(m_tuple, boost::false_type(), output_visitor< StreamT >(stream, m_delimiter));
|
||||
}
|
||||
};
|
||||
|
||||
/*!
|
||||
* Stream manipulator for inserting a heterogeneous sequence of elements. Specialization for when there is no delimiter.
|
||||
*/
|
||||
template< typename TupleT >
|
||||
class tuple_manipulator< TupleT, void >
|
||||
{
|
||||
private:
|
||||
template< typename StreamT >
|
||||
struct output_visitor
|
||||
{
|
||||
typedef void result_type;
|
||||
|
||||
explicit output_visitor(StreamT& stream) BOOST_NOEXCEPT :
|
||||
m_stream(stream)
|
||||
{
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
result_type operator() (T const& elem) const
|
||||
{
|
||||
m_stream << elem;
|
||||
}
|
||||
|
||||
private:
|
||||
StreamT& m_stream;
|
||||
};
|
||||
|
||||
private:
|
||||
TupleT const& m_tuple;
|
||||
|
||||
public:
|
||||
//! Initializing constructor
|
||||
explicit tuple_manipulator(TupleT const& tuple) BOOST_NOEXCEPT :
|
||||
m_tuple(tuple)
|
||||
{
|
||||
}
|
||||
|
||||
//! The method outputs elements of the sequence
|
||||
template< typename StreamT >
|
||||
void output(StreamT& stream) const
|
||||
{
|
||||
boost::fusion::for_each(m_tuple, output_visitor< StreamT >(stream));
|
||||
}
|
||||
};
|
||||
|
||||
/*!
|
||||
* Stream output operator for \c tuple_manipulator. Outputs every element of the sequence, separated with a delimiter, if one was specified on manipulator construction.
|
||||
*/
|
||||
template< typename StreamT, typename TupleT, typename DelimiterT >
|
||||
inline typename boost::enable_if_c< log::aux::is_ostream< StreamT >::value, StreamT& >::type operator<< (StreamT& strm, tuple_manipulator< TupleT, DelimiterT > const& manip)
|
||||
{
|
||||
if (BOOST_LIKELY(strm.good()))
|
||||
manip.output(strm);
|
||||
|
||||
return strm;
|
||||
}
|
||||
|
||||
/*!
|
||||
* Tuple manipulator generator function.
|
||||
*
|
||||
* \param tuple Heterogeneous sequence of elements to output. The sequence must be supported by Boost.Fusion, and its elements must support stream output.
|
||||
* \param delimiter Delimiter to separate elements in the output. Optional. If not specified, elements are output without separation.
|
||||
* \returns Manipulator to be inserted into the stream.
|
||||
*
|
||||
* \note Both \a tuple and \a delimiter objects must outlive the created manipulator object.
|
||||
*/
|
||||
template< typename TupleT, typename DelimiterT >
|
||||
inline typename boost::enable_if_c<
|
||||
is_scalar< DelimiterT >::value,
|
||||
tuple_manipulator< TupleT, DelimiterT >
|
||||
>::type tuple_manip(TupleT const& tuple, DelimiterT delimiter) BOOST_NOEXCEPT
|
||||
{
|
||||
return tuple_manipulator< TupleT, DelimiterT >(tuple, delimiter);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Tuple manipulator generator function.
|
||||
*
|
||||
* \param tuple Heterogeneous sequence of elements to output. The sequence must be supported by Boost.Fusion, and its elements must support stream output.
|
||||
* \param delimiter Delimiter to separate elements in the output. Optional. If not specified, elements are output without separation.
|
||||
* \returns Manipulator to be inserted into the stream.
|
||||
*
|
||||
* \note Both \a tuple and \a delimiter objects must outlive the created manipulator object.
|
||||
*/
|
||||
template< typename TupleT, typename DelimiterT >
|
||||
inline typename boost::disable_if_c<
|
||||
is_scalar< DelimiterT >::value,
|
||||
tuple_manipulator< TupleT, DelimiterT >
|
||||
>::type tuple_manip(TupleT const& tuple, DelimiterT const& delimiter) BOOST_NOEXCEPT
|
||||
{
|
||||
return tuple_manipulator< TupleT, DelimiterT >(tuple, delimiter);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Tuple manipulator generator function.
|
||||
*
|
||||
* \param tuple Heterogeneous sequence of elements to output. The sequence must be supported by Boost.Fusion, and its elements must support stream output.
|
||||
* \param delimiter Delimiter to separate elements in the output. Optional. If not specified, elements are output without separation.
|
||||
* \returns Manipulator to be inserted into the stream.
|
||||
*
|
||||
* \note Both \a tuple and \a delimiter objects must outlive the created manipulator object.
|
||||
*/
|
||||
template< typename TupleT, typename DelimiterElementT, std::size_t N >
|
||||
inline tuple_manipulator< TupleT, DelimiterElementT* > tuple_manip(TupleT const& tuple, DelimiterElementT (&delimiter)[N]) BOOST_NOEXCEPT
|
||||
{
|
||||
return tuple_manipulator< TupleT, DelimiterElementT* >(tuple, delimiter);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Tuple manipulator generator function.
|
||||
*
|
||||
* \param tuple Heterogeneous sequence of elements to output. The sequence must be supported by Boost.Fusion, and its elements must support stream output.
|
||||
* \returns Manipulator to be inserted into the stream.
|
||||
*
|
||||
* \note \a tuple object must outlive the created manipulator object.
|
||||
*/
|
||||
template< typename TupleT >
|
||||
inline tuple_manipulator< TupleT, void > tuple_manip(TupleT const& tuple) BOOST_NOEXCEPT
|
||||
{
|
||||
return tuple_manipulator< TupleT, void >(tuple);
|
||||
}
|
||||
|
||||
BOOST_LOG_CLOSE_NAMESPACE // namespace log
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/log/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_LOG_UTILITY_MANIPULATORS_TUPLE_HPP_INCLUDED_
|
||||
@@ -33,9 +33,17 @@ struct _SECURITY_ATTRIBUTES;
|
||||
namespace boost {
|
||||
|
||||
#ifdef BOOST_WINDOWS
|
||||
#if defined(BOOST_GCC) && BOOST_GCC >= 40600
|
||||
#pragma GCC diagnostic push
|
||||
// type attributes ignored after type is already defined
|
||||
#pragma GCC diagnostic ignored "-Wattributes"
|
||||
#endif
|
||||
namespace winapi {
|
||||
struct BOOST_LOG_MAY_ALIAS _SECURITY_ATTRIBUTES;
|
||||
}
|
||||
#if defined(BOOST_GCC) && BOOST_GCC >= 40600
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace interprocess {
|
||||
|
||||
@@ -16,10 +16,12 @@
|
||||
#define BOOST_LOG_UTILITY_SETUP_CONSOLE_HPP_INCLUDED_
|
||||
|
||||
#include <iostream>
|
||||
#include <boost/type_traits/is_void.hpp>
|
||||
#include <boost/smart_ptr/shared_ptr.hpp>
|
||||
#include <boost/smart_ptr/make_shared_object.hpp>
|
||||
#include <boost/core/null_deleter.hpp>
|
||||
#include <boost/log/detail/config.hpp>
|
||||
#include <boost/log/detail/parameter_tools.hpp>
|
||||
#include <boost/log/detail/sink_init_helpers.hpp>
|
||||
#ifndef BOOST_LOG_NO_THREADS
|
||||
#include <boost/log/sinks/sync_frontend.hpp>
|
||||
@@ -29,7 +31,6 @@
|
||||
#include <boost/log/sinks/text_ostream_backend.hpp>
|
||||
#include <boost/log/keywords/format.hpp>
|
||||
#include <boost/log/keywords/filter.hpp>
|
||||
#include <boost/log/keywords/auto_flush.hpp>
|
||||
#include <boost/log/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
@@ -62,10 +63,9 @@ shared_ptr<
|
||||
shared_ptr< std::basic_ostream< CharT > > pStream(&strm, boost::null_deleter());
|
||||
|
||||
typedef sinks::basic_text_ostream_backend< CharT > backend_t;
|
||||
shared_ptr< backend_t > pBackend = boost::make_shared< backend_t >();
|
||||
shared_ptr< backend_t > pBackend = boost::make_shared< backend_t >(args);
|
||||
|
||||
pBackend->add_stream(pStream);
|
||||
pBackend->auto_flush(args[keywords::auto_flush | false]);
|
||||
|
||||
typedef BOOST_LOG_CONSOLE_SINK_FRONTEND_INTERNAL< backend_t > sink_t;
|
||||
shared_ptr< sink_t > pSink = boost::make_shared< sink_t >(pBackend);
|
||||
@@ -112,7 +112,7 @@ inline shared_ptr<
|
||||
> add_console_log()
|
||||
{
|
||||
return aux::add_console_log(
|
||||
aux::default_console_stream< CharT >::get(), keywords::auto_flush = false);
|
||||
aux::default_console_stream< CharT >::get(), log::aux::empty_arg_list());
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ inline shared_ptr<
|
||||
>
|
||||
> add_console_log(std::basic_ostream< CharT >& strm)
|
||||
{
|
||||
return aux::add_console_log(strm, keywords::auto_flush = false);
|
||||
return aux::add_console_log(strm, log::aux::empty_arg_list());
|
||||
}
|
||||
|
||||
template< typename CharT, typename ArgT1 >
|
||||
@@ -156,6 +156,16 @@ inline shared_ptr<
|
||||
return aux::add_console_log(strm, (arg1, arg2, arg3));
|
||||
}
|
||||
|
||||
template< typename CharT, typename ArgT1, typename ArgT2, typename ArgT3, typename ArgT4 >
|
||||
inline shared_ptr<
|
||||
BOOST_LOG_CONSOLE_SINK_FRONTEND_INTERNAL<
|
||||
sinks::basic_text_ostream_backend< CharT >
|
||||
>
|
||||
> add_console_log(std::basic_ostream< CharT >& strm, ArgT1 const& arg1, ArgT2 const& arg2, ArgT3 const& arg3, ArgT3 const& arg4)
|
||||
{
|
||||
return aux::add_console_log(strm, (arg1, arg2, arg3, arg4));
|
||||
}
|
||||
|
||||
#else // BOOST_LOG_DOXYGEN_PASS
|
||||
|
||||
/*!
|
||||
@@ -170,6 +180,8 @@ inline shared_ptr<
|
||||
* or a formatter lambda expression (either streaming or Boost.Format-like notation).
|
||||
* \li \c auto_flush A boolean flag that shows whether the sink should automatically flush the stream
|
||||
* after each written record.
|
||||
* \li \c auto_newline_mode - Specifies automatic trailing newline insertion mode. Must be a value of
|
||||
* the \c auto_newline_mode enum. By default, is <tt>auto_newline_mode::insert_if_missing</tt>.
|
||||
* \return Pointer to the constructed sink.
|
||||
*/
|
||||
template< typename CharT, typename... ArgsT >
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#define BOOST_LOG_UTILITY_SETUP_FILE_HPP_INCLUDED_
|
||||
|
||||
#include <boost/type_traits/is_void.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/smart_ptr/shared_ptr.hpp>
|
||||
#include <boost/smart_ptr/make_shared_object.hpp>
|
||||
#include <boost/parameter/parameters.hpp> // for is_named_argument
|
||||
@@ -36,6 +37,8 @@
|
||||
#include <boost/log/sinks/unlocked_frontend.hpp>
|
||||
#endif
|
||||
#include <boost/log/sinks/text_file_backend.hpp>
|
||||
#include <boost/log/keywords/format.hpp>
|
||||
#include <boost/log/keywords/filter.hpp>
|
||||
#include <boost/log/keywords/scan_method.hpp>
|
||||
#include <boost/log/detail/header.hpp>
|
||||
|
||||
@@ -59,12 +62,12 @@ namespace aux {
|
||||
|
||||
//! The function creates a file collector according to the specified arguments
|
||||
template< typename ArgsT >
|
||||
inline shared_ptr< sinks::file::collector > setup_file_collector(ArgsT const&, mpl::true_ const&)
|
||||
inline shared_ptr< sinks::file::collector > setup_file_collector(ArgsT const&, boost::true_type)
|
||||
{
|
||||
return shared_ptr< sinks::file::collector >();
|
||||
}
|
||||
template< typename ArgsT >
|
||||
inline shared_ptr< sinks::file::collector > setup_file_collector(ArgsT const& args, mpl::false_ const&)
|
||||
inline shared_ptr< sinks::file::collector > setup_file_collector(ArgsT const& args, boost::false_type)
|
||||
{
|
||||
return sinks::file::make_collector(args);
|
||||
}
|
||||
@@ -134,13 +137,13 @@ struct file_name_param_traits< T, false >
|
||||
#ifndef BOOST_LOG_DOXYGEN_PASS
|
||||
|
||||
#define BOOST_LOG_INIT_LOG_TO_FILE_INTERNAL(z, n, data)\
|
||||
template< BOOST_PP_ENUM_PARAMS(n, typename T) >\
|
||||
inline shared_ptr< BOOST_LOG_FILE_SINK_FRONTEND_INTERNAL< sinks::text_file_backend > > add_file_log(BOOST_PP_ENUM_BINARY_PARAMS(n, T, const& arg))\
|
||||
template< BOOST_PP_ENUM_PARAMS_Z(z, n, typename T) >\
|
||||
inline shared_ptr< BOOST_LOG_FILE_SINK_FRONTEND_INTERNAL< sinks::text_file_backend > > add_file_log(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, T, const& arg))\
|
||||
{\
|
||||
return aux::file_name_param_traits< T0 >::wrap_add_file_log(\
|
||||
arg0\
|
||||
BOOST_PP_COMMA_IF(BOOST_PP_GREATER(n, 1))\
|
||||
BOOST_PP_EXPR_IF(BOOST_PP_GREATER(n, 1), (BOOST_PP_ENUM_SHIFTED_PARAMS(n, arg)))\
|
||||
BOOST_PP_EXPR_IF(BOOST_PP_GREATER(n, 1), (BOOST_PP_ENUM_SHIFTED_PARAMS_Z(z, n, arg)))\
|
||||
);\
|
||||
}
|
||||
|
||||
@@ -164,7 +167,10 @@ BOOST_PP_REPEAT_FROM_TO(1, BOOST_LOG_MAX_PARAMETER_ARGS, BOOST_LOG_INIT_LOG_TO_F
|
||||
* \li \c time_based_rotation The predicate for time-based file rotations. See <tt>basic_text_file_backend</tt>.
|
||||
* \li \c auto_flush A boolean flag that shows whether the sink should automatically flush the file
|
||||
* after each written record.
|
||||
* \li \c target The target directory to store rotated files in. See <tt>sinks::file::make_collector</tt>.
|
||||
* \li \c auto_newline_mode - Specifies automatic trailing newline insertion mode. Must be a value of
|
||||
* the \c auto_newline_mode enum. By default, is <tt>auto_newline_mode::insert_if_missing</tt>.
|
||||
* \li \c target The target directory to store rotated files in. Enables file collector and, if specified, limits associated
|
||||
* with the target directory. See <tt>sinks::file::make_collector</tt>.
|
||||
* \li \c max_size The maximum total size of rotated files in the target directory. See <tt>sinks::file::make_collector</tt>.
|
||||
* \li \c min_free_space Minimum free space in the target directory. See <tt>sinks::file::make_collector</tt>.
|
||||
* \li \c max_files The maximum total number of rotated files in the target directory. See <tt>sinks::file::make_collector</tt>.
|
||||
@@ -173,7 +179,11 @@ BOOST_PP_REPEAT_FROM_TO(1, BOOST_LOG_MAX_PARAMETER_ARGS, BOOST_LOG_INIT_LOG_TO_F
|
||||
* or a filter lambda expression.
|
||||
* \li \c format Specifies a formatter to install into the sink. May be a string that represents a formatter,
|
||||
* or a formatter lambda expression (either streaming or Boost.Format-like notation).
|
||||
*
|
||||
* \return Pointer to the constructed sink.
|
||||
*
|
||||
* \note The \c target named argument is required to enable the file collector and the limits associated with the target directory.
|
||||
* If the parameter is not specified, the file collector will not be created and the limits will not be maintained.
|
||||
*/
|
||||
template< typename... ArgsT >
|
||||
shared_ptr< BOOST_LOG_FILE_SINK_FRONTEND_INTERNAL< sinks::text_file_backend > > add_file_log(ArgsT... const& args);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <iterator>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/move/core.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits/conditional.hpp>
|
||||
#include <boost/iterator/iterator_adaptor.hpp>
|
||||
#include <boost/optional/optional.hpp>
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
@@ -115,7 +115,7 @@ private:
|
||||
class ref
|
||||
{
|
||||
private:
|
||||
typedef typename mpl::if_c<
|
||||
typedef typename boost::conditional<
|
||||
IsConstV,
|
||||
basic_settings_section< char_type > const,
|
||||
basic_settings_section< char_type >
|
||||
@@ -354,14 +354,14 @@ public:
|
||||
/*!
|
||||
* Default constructor. Creates an empty settings container.
|
||||
*/
|
||||
basic_settings_section() : m_ptree(NULL)
|
||||
basic_settings_section() BOOST_NOEXCEPT : m_ptree(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
* Copy constructor.
|
||||
*/
|
||||
basic_settings_section(basic_settings_section const& that) : m_ptree(that.m_ptree)
|
||||
basic_settings_section(basic_settings_section const& that) BOOST_NOEXCEPT : m_ptree(that.m_ptree)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -517,7 +517,7 @@ public:
|
||||
/*!
|
||||
* Swaps two references to settings sections.
|
||||
*/
|
||||
void swap(basic_settings_section& that)
|
||||
void swap(basic_settings_section& that) BOOST_NOEXCEPT
|
||||
{
|
||||
property_tree_type* const p = m_ptree;
|
||||
m_ptree = that.m_ptree;
|
||||
@@ -525,13 +525,13 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
explicit basic_settings_section(property_tree_type* tree) : m_ptree(tree)
|
||||
explicit basic_settings_section(property_tree_type* tree) BOOST_NOEXCEPT : m_ptree(tree)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template< typename CharT >
|
||||
inline void swap(basic_settings_section< CharT >& left, basic_settings_section< CharT >& right)
|
||||
inline void swap(basic_settings_section< CharT >& left, basic_settings_section< CharT >& right) BOOST_NOEXCEPT
|
||||
{
|
||||
left.swap(right);
|
||||
}
|
||||
@@ -584,7 +584,7 @@ public:
|
||||
/*!
|
||||
* Move constructor.
|
||||
*/
|
||||
basic_settings(BOOST_RV_REF(this_type) that)
|
||||
basic_settings(BOOST_RV_REF(this_type) that) BOOST_NOEXCEPT
|
||||
{
|
||||
this->swap(that);
|
||||
}
|
||||
@@ -598,7 +598,7 @@ public:
|
||||
/*!
|
||||
* Destructor
|
||||
*/
|
||||
~basic_settings()
|
||||
~basic_settings() BOOST_NOEXCEPT
|
||||
{
|
||||
delete this->m_ptree;
|
||||
}
|
||||
@@ -618,7 +618,7 @@ public:
|
||||
/*!
|
||||
* Move assignment operator.
|
||||
*/
|
||||
basic_settings& operator= (BOOST_RV_REF(basic_settings) that)
|
||||
basic_settings& operator= (BOOST_RV_REF(basic_settings) that) BOOST_NOEXCEPT
|
||||
{
|
||||
this->swap(that);
|
||||
return *this;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#ifndef BOOST_LOG_UTILITY_STRICTEST_LOCK_HPP_INCLUDED_
|
||||
#define BOOST_LOG_UTILITY_STRICTEST_LOCK_HPP_INCLUDED_
|
||||
|
||||
#include <boost/mpl/integral_c.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/log/detail/config.hpp>
|
||||
#include <boost/log/detail/locks.hpp>
|
||||
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
@@ -67,44 +67,49 @@ template< typename LockT >
|
||||
struct thread_access_mode_of;
|
||||
|
||||
template< typename MutexT >
|
||||
struct thread_access_mode_of< no_lock< MutexT > > : mpl::integral_c< lock_access_mode, unlocked_access >
|
||||
struct thread_access_mode_of< no_lock< MutexT > > : boost::integral_constant< lock_access_mode, unlocked_access >
|
||||
{
|
||||
};
|
||||
|
||||
#if !defined(BOOST_LOG_NO_THREADS)
|
||||
|
||||
template< typename MutexT >
|
||||
struct thread_access_mode_of< lock_guard< MutexT > > : mpl::integral_c< lock_access_mode, exclusive_access >
|
||||
struct thread_access_mode_of< lock_guard< MutexT > > : boost::integral_constant< lock_access_mode, exclusive_access >
|
||||
{
|
||||
};
|
||||
|
||||
template< typename MutexT >
|
||||
struct thread_access_mode_of< shared_lock_guard< MutexT > > : mpl::integral_c< lock_access_mode, shared_access >
|
||||
struct thread_access_mode_of< shared_lock_guard< MutexT > > : boost::integral_constant< lock_access_mode, shared_access >
|
||||
{
|
||||
};
|
||||
|
||||
template< typename MutexT >
|
||||
struct thread_access_mode_of< unique_lock< MutexT > > : mpl::integral_c< lock_access_mode, exclusive_access >
|
||||
struct thread_access_mode_of< unique_lock< MutexT > > : boost::integral_constant< lock_access_mode, exclusive_access >
|
||||
{
|
||||
};
|
||||
|
||||
template< typename MutexT >
|
||||
struct thread_access_mode_of< shared_lock< MutexT > > : mpl::integral_c< lock_access_mode, shared_access >
|
||||
struct thread_access_mode_of< shared_lock< MutexT > > : boost::integral_constant< lock_access_mode, shared_access >
|
||||
{
|
||||
};
|
||||
|
||||
template< typename MutexT >
|
||||
struct thread_access_mode_of< upgrade_lock< MutexT > > : mpl::integral_c< lock_access_mode, shared_access >
|
||||
struct thread_access_mode_of< upgrade_lock< MutexT > > : boost::integral_constant< lock_access_mode, shared_access >
|
||||
{
|
||||
};
|
||||
|
||||
template< typename MutexT >
|
||||
struct thread_access_mode_of< boost::log::aux::exclusive_lock_guard< MutexT > > : mpl::integral_c< lock_access_mode, exclusive_access >
|
||||
struct thread_access_mode_of< boost::log::aux::exclusive_lock_guard< MutexT > > : boost::integral_constant< lock_access_mode, exclusive_access >
|
||||
{
|
||||
};
|
||||
|
||||
template< typename MutexT >
|
||||
struct thread_access_mode_of< boost::log::aux::shared_lock_guard< MutexT > > : mpl::integral_c< lock_access_mode, shared_access >
|
||||
struct thread_access_mode_of< boost::log::aux::shared_lock_guard< MutexT > > : boost::integral_constant< lock_access_mode, shared_access >
|
||||
{
|
||||
};
|
||||
|
||||
template< typename MutexT1, typename MutexT2 >
|
||||
struct thread_access_mode_of< boost::log::aux::multiple_unique_lock2< MutexT1, MutexT2 > > : boost::integral_constant< lock_access_mode, exclusive_access >
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
60
linx64/include/boost/log/utility/use_std_allocator.hpp
Normal file
60
linx64/include/boost/log/utility/use_std_allocator.hpp
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright Andrey Semashev 2021.
|
||||
* 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)
|
||||
*/
|
||||
/*!
|
||||
* \file use_std_allocator.hpp
|
||||
* \author Andrey Semashev
|
||||
* \date 04.03.2021
|
||||
*
|
||||
* The header defines \c use_std_allocator tag type.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_LOG_UTILITY_USE_STD_ALLOCATOR_HPP_INCLUDED_
|
||||
#define BOOST_LOG_UTILITY_USE_STD_ALLOCATOR_HPP_INCLUDED_
|
||||
|
||||
#include <boost/log/detail/config.hpp>
|
||||
#include <boost/log/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
BOOST_LOG_OPEN_NAMESPACE
|
||||
|
||||
#ifndef BOOST_LOG_DOXYGEN_PASS
|
||||
|
||||
namespace aux {
|
||||
|
||||
namespace usestdalloc_adl_block {
|
||||
|
||||
struct use_std_allocator {};
|
||||
|
||||
} // namespace usestdalloc_adl_block
|
||||
|
||||
} // namespace aux
|
||||
|
||||
using aux::usestdalloc_adl_block::use_std_allocator;
|
||||
|
||||
#else // BOOST_LOG_DOXYGEN_PASS
|
||||
|
||||
/*!
|
||||
* \brief Tag type that indicates that a specialization of \c std::allocator should be used for allocating memory
|
||||
*
|
||||
* This tag type can be used in template parameters in various components of Boost.Log. The type itself is not an allocator type.
|
||||
*/
|
||||
struct use_std_allocator {};
|
||||
|
||||
#endif // BOOST_LOG_DOXYGEN_PASS
|
||||
|
||||
BOOST_LOG_CLOSE_NAMESPACE // namespace log
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/log/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_LOG_UTILITY_USE_STD_ALLOCATOR_HPP_INCLUDED_
|
||||
@@ -112,7 +112,7 @@ protected:
|
||||
|
||||
protected:
|
||||
//! Default constructor
|
||||
singular_ref() BOOST_NOEXCEPT : m_ptr(NULL)
|
||||
BOOST_CONSTEXPR singular_ref() BOOST_NOEXCEPT : m_ptr(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ protected:
|
||||
|
||||
protected:
|
||||
//! Default constructor
|
||||
variant_ref() BOOST_NOEXCEPT : m_ptr(NULL), m_type_idx(0)
|
||||
BOOST_CONSTEXPR variant_ref() BOOST_NOEXCEPT : m_ptr(NULL), m_type_idx(0u)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -447,12 +447,7 @@ public:
|
||||
/*!
|
||||
* Default constructor. Creates a reference wrapper that does not refer to a value.
|
||||
*/
|
||||
BOOST_DEFAULTED_FUNCTION(value_ref(), BOOST_NOEXCEPT {})
|
||||
|
||||
/*!
|
||||
* Copy constructor.
|
||||
*/
|
||||
BOOST_DEFAULTED_FUNCTION(value_ref(value_ref const& that), BOOST_NOEXCEPT : base_type(static_cast< base_type const& >(that)) {})
|
||||
BOOST_DEFAULTED_FUNCTION(BOOST_CONSTEXPR value_ref(), BOOST_NOEXCEPT {})
|
||||
|
||||
/*!
|
||||
* Initializing constructor. Creates a reference wrapper that refers to the specified value.
|
||||
@@ -461,7 +456,7 @@ public:
|
||||
explicit value_ref(U const& val
|
||||
#ifndef BOOST_LOG_DOXYGEN_PASS
|
||||
// MSVC-8 can't handle SFINAE in this case properly and often wrongly disables this constructor
|
||||
#if !defined(_MSC_VER) || (_MSC_VER + 0) >= 1500
|
||||
#if !defined(BOOST_MSVC) || BOOST_MSVC >= 1500
|
||||
, typename boost::enable_if_c< compatibility_traits::BOOST_NESTED_TEMPLATE is_compatible< value_type, U >::value, boost::log::aux::sfinae_dummy >::type = boost::log::aux::sfinae_dummy()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user