|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r83229 - in sandbox/SOC/2011/checks: boost/checks libs/checks/doc
From: pierre.talbot.6114_at_[hidden]
Date: 2013-03-01 10:56:22
Author: trademark
Date: 2013-03-01 10:56:21 EST (Fri, 01 Mar 2013)
New Revision: 83229
URL: http://svn.boost.org/trac/boost/changeset/83229
Log:
Add filter reference.
Text files modified:
sandbox/SOC/2011/checks/boost/checks/filter.hpp | 8 ++--
sandbox/SOC/2011/checks/libs/checks/doc/checks.qbk | 3 +
sandbox/SOC/2011/checks/libs/checks/doc/reference.qbk | 75 +++++++++++++++++++++++++++++++++++++++
3 files changed, 81 insertions(+), 5 deletions(-)
Modified: sandbox/SOC/2011/checks/boost/checks/filter.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/filter.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/filter.hpp 2013-03-01 10:56:21 EST (Fri, 01 Mar 2013)
@@ -28,9 +28,9 @@
typedef bool result_type;
template <typename value_type>
- bool operator()(const value_type &value) const
+ bool operator()(value_type value) const
{
- return value >= '0' && value <= '9';
+ return std::isdigit(value);
}
};
@@ -39,9 +39,9 @@
typedef bool result_type;
template <typename value_type>
- bool operator()(const value_type &value) const
+ bool operator()(value_type value) const
{
- return (value >= '0' && value <= '9') || std::tolower(value) == 'x';
+ return digit_filter()(value) || std::tolower(value) == 'x';
}
};
Modified: sandbox/SOC/2011/checks/libs/checks/doc/checks.qbk
==============================================================================
--- sandbox/SOC/2011/checks/libs/checks/doc/checks.qbk (original)
+++ sandbox/SOC/2011/checks/libs/checks/doc/checks.qbk 2013-03-01 10:56:21 EST (Fri, 01 Mar 2013)
@@ -80,6 +80,9 @@
[def __FORWARD_TRAVERSAL__ [link checks.checks.reference.traversal_type.forward_traversal forward_traversal]]
[def __REVERSE_TRAVERSAL__ [link checks.checks.reference.traversal_type.reverse_traversal reverse_traversal]]
+[def __DIGIT_FILTER__ [link checks.checks.reference.filter.digit_filter digit_filter]]
+[def __DIGITX_FILTER__ [link checks.checks.reference.filter.digitx_filter digitx_filter]]
+
[def __overview [link checks.checks.preface Preface]]
[def __spaces '''  '''] [/ two spaces - useful for an indent.]
Modified: sandbox/SOC/2011/checks/libs/checks/doc/reference.qbk
==============================================================================
--- sandbox/SOC/2011/checks/libs/checks/doc/reference.qbk (original)
+++ sandbox/SOC/2011/checks/libs/checks/doc/reference.qbk 2013-03-01 10:56:21 EST (Fri, 01 Mar 2013)
@@ -547,9 +547,82 @@
[h3 See also]
__FORWARD_TRAVERSAL__, __CHECKSUM_REF__.
[endsect][/section:reverse_traversal reverse_traversal]
-
[endsect][/section:traversal_type Traversal type]
+[section:filter Filter]
+[section:digit_filter digit_filter]
+[h3 Synopsis]
+``
+struct digit_filter
+{
+ typedef bool result_type;
+
+ template <typename value_type>
+ bool operator()(value_type value) const;
+};
+``
+[h3 Description]
+
+Predicate returning true if value is a digit between 0 and 9.
+
+[h3 Header]
+``
+#include <boost/checks/filter.hpp>
+``
+
+[h3 Template parameter]
+
+[*value_type] is the type of the value we want to test.
+
+[h3 Parameter]
+
+[*value] is the value we want to test.
+
+[h3 Return]
+
+True if [*value] is between 0 and 9, otherwise false.
+
+[h3 See also]
+__DIGITX_FILTER__, __CHECKSUM_REF__.
+[endsect][/section:digit_filter digit_filter]
+
+[section:digitx_filter digitx_filter]
+[h3 Synopsis]
+``
+struct digitx_filter
+{
+ typedef bool result_type;
+
+ template <typename value_type>
+ bool operator()(value_type value) const;
+};
+``
+[h3 Description]
+
+Predicate returning true if value is a digit between 0 and 9 or equal to 'x' or 'X'.
+
+[h3 Header]
+``
+#include <boost/checks/filter.hpp>
+``
+
+[h3 Template parameter]
+
+[*value_type] is the type of the value we want to test.
+
+[h3 Parameter]
+
+[*value] is the value we want to test.
+
+[h3 Return]
+
+True if [*value] is between 0 and 9 or equal to 'x' or 'X', otherwise false.
+
+[h3 See also]
+__DIGIT_FILTER__, __CHECKSUM_REF__.
+[endsect][/section:digitx_filter digitx_filter]
+[endsect][/section:filter Filter]
+
[section:type_adaptor Type adaptor]
[endsect][/section:type_adaptor Type adaptor]
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk