view release on metacpan or search on metacpan
Directed/ppport.h view on Meta::CPAN
# define aTHX
# define aTHX_
#endif
/* IV could also be a quad (say, a long long), but Perls
* capable of those should have IVSIZE already. */
#if !defined(IVSIZE) && defined(LONGSIZE)
# define IVSIZE LONGSIZE
#endif
#ifndef IVSIZE
# define IVSIZE 4 /* A bold guess, but the best we can make. */
#endif
#ifndef UVSIZE
# define UVSIZE IVSIZE
#endif
#ifndef NVTYPE
# if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
# define NVTYPE long double
# else
Undirected/ppport.h view on Meta::CPAN
# define aTHX
# define aTHX_
#endif
/* IV could also be a quad (say, a long long), but Perls
* capable of those should have IVSIZE already. */
#if !defined(IVSIZE) && defined(LONGSIZE)
# define IVSIZE LONGSIZE
#endif
#ifndef IVSIZE
# define IVSIZE 4 /* A bold guess, but the best we can make. */
#endif
#ifndef UVSIZE
# define UVSIZE IVSIZE
#endif
#ifndef NVTYPE
# if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
# define NVTYPE long double
# else
include/boost/cstdint.hpp view on Meta::CPAN
} // namespace boost
#else // BOOST_HAS_STDINT_H
# include <boost/limits.hpp> // implementation artifact; not part of interface
namespace boost
{
// These are fairly safe guesses for some 16-bit, and most 32-bit and 64-bit
// platforms. For other systems, they will have to be hand tailored.
//
// Because the fast types are assumed to be the same as the undecorated types,
// it may be possible to hand tailor a more efficient implementation. Such
// an optimization may be illusionary; on the Intel x86-family 386 on, for
// example, byte arithmetic and load/stores are as fast as "int" sized ones.
// 8-bit types ------------------------------------------------------------//
# if UCHAR_MAX == 0xff
include/boost/date_time/date_generators.hpp view on Meta::CPAN
};
//! Useful generator functor for finding holidays
/*! Based on the idea in Cal. Calc. for finding holidays that are
* the 'first Monday of September'. When instantiated with
* 'fifth' kday of month, the result will be the last kday of month
* which can be the fourth or fifth depending on the structure of
* the month.
*
* The algorithm here basically guesses for the first
* day of the month. Then finds the first day of the correct
* type. That is, if the first of the month is a Tuesday
* and it needs Wenesday then we simply increment by a day
* and then we can add the length of a week until we get
* to the 'nth kday'. There are probably more efficient
* algorithms based on using a mod 7, but this one works
* reasonably well for basic applications.
* \ingroup date_alg
*/
template<class date_type>
include/boost/date_time/local_time_adjustor.hpp view on Meta::CPAN
* is added to the utc time and the recheck proves non-ambiguous
* then we are past the boundary. If it is still ambiguous then
* we are ahead of the boundary and dst is still in effect.
*
* TODO -- check if all dst offsets are positive. If not then
* the algorithm needs to check for this and reverse the
* illegal/ambiguous logic.
*/
static time_duration_type utc_to_local_offset(const time_type& t)
{
//get initial local time guess by applying utc offset
time_type initial = t + utc_offset_rules::utc_to_local_base_offset();
time_is_dst_result dst_flag =
dst_rules::local_is_dst(initial.date(), initial.time_of_day());
switch(dst_flag) {
case is_in_dst: return utc_offset_rules::utc_to_local_base_offset() + dst_rules::dst_offset();
case is_not_in_dst: return utc_offset_rules::utc_to_local_base_offset();
case invalid_time_label:return utc_offset_rules::utc_to_local_base_offset() + dst_rules::dst_offset();
case ambiguous: {
time_type retry = initial + dst_rules::dst_offset();
dst_flag = dst_rules::local_is_dst(retry.date(), retry.time_of_day());
include/boost/functional/detail/float_functions.hpp view on Meta::CPAN
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
// The C++ standard requires that the C float functions are overloarded
// for float, double and long double in the std namespace, but some of the older
// library implementations don't support this. On some that don't, the C99
// float functions (frexpf, frexpl, etc.) are available.
//
// Some of this is based on guess work. If I don't know any better I assume that
// the standard C++ overloaded functions are available. If they're not then this
// means that the argument is cast to a double and back, which is inefficient
// and will give pretty bad results for long doubles - so if you know better
// let me know.
// STLport:
#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
# if defined(__GNUC__) && __GNUC__ < 3 && (defined(linux) || defined(__linux) || defined(__linux__))
# define BOOST_HASH_USE_C99_FLOAT_FUNCS
# elif defined(BOOST_MSVC) && BOOST_MSVC <= 1200
include/boost/lambda/detail/lambda_traits.hpp view on Meta::CPAN
typedef Else RET;
};
// An if construct that doesn't instantiate the non-matching template:
// Called as:
// IF_type<condition, A, B>::type
// The matching template must define the typeded 'type'
// I.e. A::type if condition is true, B::type if condition is false
// Idea from Vesa Karvonen (from C&E as well I guess)
template<class T>
struct IF_type_
{
typedef typename T::type type;
};
template<bool C, class T, class E>
struct IF_type
{
include/boost/program_options/cmdline.hpp view on Meta::CPAN
which start with either "-" or "/". Both kinds can be allowed or
disallowed, see allow_long and allow_short. The allowed character
for short option is also configurable.
Option's value can be specified in the same token as value
("--foo=bar"), or in the next token.
It's possible to introduce long option by the same character as
long option, see allow_long_disguise.
Finally, guessing (specifying only prefix of option) and case
insensitive processing are supported.
*/
enum style_t {
/// Allow "--long_name" style
allow_long = 1,
/// Alow "-<single character" style
allow_short = allow_long << 1,
/// Allow "-" in short options
allow_dash_for_short = allow_short << 1,
/// Allow "/" in short options
include/boost/program_options/cmdline.hpp view on Meta::CPAN
so that "-s -k" become "-sk". All of the options
but last should accept no parameter. For example, if
"-s" accept a parameter, then "k" will be taken as
parameter, not another short option.
Dos-style short options cannot be sticky.
*/
allow_sticky = short_allow_next << 1,
/** Allow abbreviated spellings for long options,
if they unambiguously identify long option.
No long option name should be prefix of other
long option name is guessing is in effect.
*/
allow_guessing = allow_sticky << 1,
/** Ignore the difference in case for options.
@todo Should this apply to long options only?
*/
case_insensitive = allow_guessing << 1,
/** Allow long options with single option starting character,
e.g <tt>-foo=10</tt>
*/
allow_long_disguise = case_insensitive << 1,
/** The more-or-less traditional unix style. */
unix_style = (allow_short | short_allow_adjacent | short_allow_next
| allow_long | long_allow_adjacent | long_allow_next
| allow_sticky | allow_guessing
| allow_dash_for_short),
/** The default style. */
default_style = unix_style
};
}}}
#endif
include/boost/program_options/detail/cmdline.hpp view on Meta::CPAN
Sometimes the registered option name is not equal to the encountered
one, for example, because name abbreviation is supported. Therefore
two option names can be obtained:
- the registered one
- the one found at the command line
There are lot of style options, which can be used to tune the command
line parsing. In addition, it's possible to install additional parser
which will process custom option styles.
@todo mininal match length for guessing?
*/
class BOOST_PROGRAM_OPTIONS_DECL cmdline {
public:
typedef ::boost::program_options::command_line_style::style_t style_t;
typedef function1<std::pair<std::string, std::string>,
const std::string&>
additional_parser;
include/boost/program_options/positional_options.hpp view on Meta::CPAN
#include <boost/program_options/config.hpp>
#include <vector>
#include <string>
namespace boost { namespace program_options {
/** Describes positional options.
The class allows to guess option names for positional options, which
are specified on the command line and are identified by the position.
The class uses the information provided by the user to associate a name
with every positional option, or tell that no name is known.
The primary assumption is that only the relative order of the
positional options themselves matters, and that any interleaving
ordinary options don't affect interpretation of positional options.
The user initializes the class by specifying that first N positional
options should be given the name X1, following M options should be given
include/boost/test/utils/runtime/cla/modifier.hpp view on Meta::CPAN
// ************************************************************************** //
namespace {
nfp::typed_keyword<bool,struct optional_t> optional_m;
nfp::named_parameter<bool const,optional_t> optional( true );
nfp::typed_keyword<bool,struct required_t> required_m;
nfp::named_parameter<bool const,required_t> required( true );
nfp::typed_keyword<bool,struct multiplicable_t> multiplicable_m;
nfp::named_parameter<bool const,multiplicable_t> multiplicable( true );
nfp::typed_keyword<bool,struct guess_name_t> guess_name_m;
nfp::named_parameter<bool const,guess_name_t> guess_name( true );
nfp::typed_keyword<bool,struct ignore_mismatch_t> ignore_mismatch_m;
nfp::named_parameter<bool const,ignore_mismatch_t> ignore_mismatch( true );
nfp::typed_keyword<bool,struct optional_value_t> optional_value_m;
nfp::named_parameter<bool const,optional_value_t> optional_value( true );
nfp::typed_keyword<char_type,struct input_separator_t> input_separator;
nfp::typed_keyword<cstring,struct prefix_t> prefix;
nfp::typed_keyword<cstring,struct name_t> name;
nfp::typed_keyword<cstring,struct separator_t> separator;
nfp::typed_keyword<cstring,struct description_t> description;
include/boost/test/utils/runtime/cla/named_parameter.hpp view on Meta::CPAN
// policy interface
virtual bool responds_to( cstring name ) const;
virtual bool conflict_with( identification_policy const& ) const;
// Accept modifier
template<typename Modifier>
void accept_modifier( Modifier const& m )
{
basic_naming_policy::accept_modifier( m );
if( m.has( guess_name_m ) )
m_guess_name = true;
}
private:
// Naming policy interface
virtual bool match_name( argv_traverser& tr ) const;
// Data members
bool m_guess_name;
};
// ************************************************************************** //
// ************** runtime::cla::named_parameter ************** //
// ************************************************************************** //
template<typename T>
class named_parameter_t : public basic_parameter<T,string_name_policy> {
typedef basic_parameter<T,string_name_policy> base;
public:
include/boost/test/utils/runtime/cla/named_parameter.ipp view on Meta::CPAN
namespace cla {
// ************************************************************************** //
// ************** string_name_policy ************** //
// ************************************************************************** //
BOOST_RT_PARAM_INLINE
string_name_policy::string_name_policy()
: basic_naming_policy( rtti::type_id<string_name_policy>() )
, m_guess_name( false )
{
assign_op( m_prefix, BOOST_RT_PARAM_CSTRING_LITERAL( "-" ), 0 );
}
//____________________________________________________________________________//
BOOST_RT_PARAM_INLINE bool
string_name_policy::responds_to( cstring name ) const
{
std::pair<cstring::iterator,dstring::const_iterator> mm_pos;
mm_pos = unit_test::mismatch( name.begin(), name.end(), m_name.begin(), m_name.end() );
return mm_pos.first == name.end() && (m_guess_name || (mm_pos.second == m_name.end()) );
}
//____________________________________________________________________________//
BOOST_RT_PARAM_INLINE bool
string_name_policy::conflict_with( identification_policy const& id ) const
{
if( id.p_type_id == p_type_id ) {
string_name_policy const& snp = static_cast<string_name_policy const&>( id );
if( m_name.empty() || snp.m_name.empty() )
return false;
std::pair<dstring::const_iterator,dstring::const_iterator> mm_pos =
unit_test::mismatch( m_name.begin(), m_name.end(), snp.m_name.begin(), snp.m_name.end() );
return mm_pos.first != m_name.begin() && // there is common substring
(m_guess_name || (mm_pos.first == m_name.end()) ) && // that match me
(snp.m_guess_name || (mm_pos.second == snp.m_name.end()) ); // and snp
}
if( id.p_type_id == rtti::type_id<char_name_policy>() ) {
char_name_policy const& cnp = static_cast<char_name_policy const&>( id );
return m_guess_name && unit_test::first_char( cstring( m_name ) ) == unit_test::first_char( cnp.id_2_report() );
}
return false;
}
//____________________________________________________________________________//
BOOST_RT_PARAM_INLINE bool
string_name_policy::match_name( argv_traverser& tr ) const
{
if( !m_guess_name )
return basic_naming_policy::match_name( tr );
else {
cstring in = tr.input();
std::pair<cstring::iterator,dstring::const_iterator> mm_pos;
mm_pos = unit_test::mismatch( in.begin(), in.end(), m_name.begin(), m_name.end() );
if( mm_pos.first == in.begin() )
return false;
# define aTHX
# define aTHX_
#endif
/* IV could also be a quad (say, a long long), but Perls
* capable of those should have IVSIZE already. */
#if !defined(IVSIZE) && defined(LONGSIZE)
# define IVSIZE LONGSIZE
#endif
#ifndef IVSIZE
# define IVSIZE 4 /* A bold guess, but the best we can make. */
#endif
#ifndef UVSIZE
# define UVSIZE IVSIZE
#endif
#ifndef NVTYPE
# if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
# define NVTYPE long double
# else