Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83675 - in sandbox/SOC/2011/checks: boost/checks libs/checks/doc libs/checks/example
From: pierre.talbot.6114_at_[hidden]
Date: 2013-04-01 09:08:22


Author: trademark
Date: 2013-04-01 09:08:21 EDT (Mon, 01 Apr 2013)
New Revision: 83675
URL: http://svn.boost.org/trac/boost/changeset/83675

Log:
Add transliteration doc for

ascii_to_digit
ascii_to_digitx
transliteration_exception

Add the code of the transliteration_exception

Added:
   sandbox/SOC/2011/checks/boost/checks/transliteration.hpp
      - copied, changed from r83668, /sandbox/SOC/2011/checks/boost/checks/conversion.hpp
Removed:
   sandbox/SOC/2011/checks/boost/checks/conversion.hpp
Text files modified:
   sandbox/SOC/2011/checks/boost/checks/transliteration.hpp | 21 +++++++
   sandbox/SOC/2011/checks/libs/checks/doc/AutoDoxywarnings.log | 50 +++++++++---------
   sandbox/SOC/2011/checks/libs/checks/doc/checks.qbk | 7 +-
   sandbox/SOC/2011/checks/libs/checks/doc/quickstart.qbk | 2
   sandbox/SOC/2011/checks/libs/checks/doc/reference.qbk | 105 ++++++++++++++++++++++++++++++++++++++++
   sandbox/SOC/2011/checks/libs/checks/example/vin.hpp | 1
   6 files changed, 154 insertions(+), 32 deletions(-)

Deleted: sandbox/SOC/2011/checks/boost/checks/conversion.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/conversion.hpp 2013-04-01 09:08:21 EDT (Mon, 01 Apr 2013)
+++ (empty file)
@@ -1,51 +0,0 @@
-// Boost checks/conversion.hpp header file
-// (C) Copyright Pierre Talbot 2012
-// 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
-// See http://www.boost.org for updates, documentation, and revision history.
-
-/*! \file
- \brief
-*/
-
-#ifndef BOOST_CHECK_CONVERSION_HPP
-#define BOOST_CHECK_CONVERSION_HPP
-
-#ifdef _MSC_VER
- #pragma once
-#endif
-
-#include <cstddef> // size_t
-#include <functional>
-
-
-namespace boost{
- namespace checks{
-
-struct chartodigit
-{
- typedef size_t result_type;
-
- template <typename value_type>
- size_t operator()(const value_type &value) const
- {
- return value - '0';
- }
-};
-
-
-struct chartodigitx
-{
- typedef size_t result_type;
-
- template <typename value_type>
- size_t operator()(const value_type &value) const
- {
- return value <= '9' ? (value - '0') : 10;
- }
-};
-
-}} // namespace boost namespace checks
-
-#endif //BOOST_CHECK_CONVERSION_HPP

Copied: sandbox/SOC/2011/checks/boost/checks/transliteration.hpp (from r83668, /sandbox/SOC/2011/checks/boost/checks/conversion.hpp)
==============================================================================
--- /sandbox/SOC/2011/checks/boost/checks/conversion.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/transliteration.hpp 2013-04-01 09:08:21 EDT (Mon, 01 Apr 2013)
@@ -18,12 +18,29 @@
 
 #include <cstddef> // size_t
 #include <functional>
+#include <exception>
 
 
 namespace boost{
   namespace checks{
 
-struct chartodigit
+class transliteration_exception : public std::exception
+{
+ std::string message;
+public:
+ transliteration_exception(const std::string& message)
+ : message(message)
+ {}
+
+ transliteration_exception(){}
+
+ virtual const char* what() const
+ {
+ return message.c_str();
+ }
+};
+
+struct ascii_to_digit
 {
   typedef size_t result_type;
 
@@ -35,7 +52,7 @@
 };
 
 
-struct chartodigitx
+struct ascii_to_digitx
 {
   typedef size_t result_type;
 

Modified: sandbox/SOC/2011/checks/libs/checks/doc/AutoDoxywarnings.log
==============================================================================
--- sandbox/SOC/2011/checks/libs/checks/doc/AutoDoxywarnings.log (original)
+++ sandbox/SOC/2011/checks/libs/checks/doc/AutoDoxywarnings.log 2013-04-01 09:08:21 EDT (Mon, 01 Apr 2013)
@@ -1,39 +1,39 @@
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/ean.hpp:69: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::check_ean13(const check_range &x)
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/ean.hpp:69: warning: The following parameters of boost::checks::check_ean13(const check_range &x) are not documented:
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/ean.hpp:70: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::check_ean13(const check_range &x)
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/ean.hpp:70: warning: The following parameters of boost::checks::check_ean13(const check_range &x) are not documented:
   parameter 'x'
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/ean.hpp:116: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::check_ean8(const check_range &x)
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/ean.hpp:116: warning: The following parameters of boost::checks::check_ean8(const check_range &x) are not documented:
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/ean.hpp:117: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::check_ean8(const check_range &x)
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/ean.hpp:117: warning: The following parameters of boost::checks::check_ean8(const check_range &x) are not documented:
   parameter 'x'
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/isbn.hpp:93: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::check_isbn10(const range &x)
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/isbn.hpp:93: warning: The following parameters of boost::checks::check_isbn10(const range &x) are not documented:
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/isbn.hpp:94: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::check_isbn10(const range &x)
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/isbn.hpp:94: warning: The following parameters of boost::checks::check_isbn10(const range &x) are not documented:
   parameter 'x'
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/isbn.hpp:40: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::check_isbn13(const range &x)
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/isbn.hpp:40: warning: The following parameters of boost::checks::check_isbn13(const range &x) are not documented:
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/isbn.hpp:41: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::check_isbn13(const range &x)
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/isbn.hpp:41: warning: The following parameters of boost::checks::check_isbn13(const range &x) are not documented:
   parameter 'x'
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp:61: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::check_sequence(const range &x)
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp:61: warning: The following parameters of boost::checks::check_sequence(const range &x) are not documented:
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp:62: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::check_sequence(const range &x)
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp:62: warning: The following parameters of boost::checks::check_sequence(const range &x) are not documented:
   parameter 'x'
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp:90: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::compute_checkdigit(const range &x)
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp:90: warning: The following parameters of boost::checks::compute_checkdigit(const range &x) are not documented:
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp:91: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::compute_checkdigit(const range &x)
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp:91: warning: The following parameters of boost::checks::compute_checkdigit(const range &x) are not documented:
   parameter 'x'
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp:29: warning: argument 'seq_begin' of command @param is not found in the argument list of boost::checks::compute_checksum(iterator begin, iterator end, counter_iter &counter)
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp:29: warning: argument 'seq_end' of command @param is not found in the argument list of boost::checks::compute_checksum(iterator begin, iterator end, counter_iter &counter)
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp:29: warning: The following parameters of boost::checks::compute_checksum(iterator begin, iterator end, counter_iter &counter) are not documented:
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp:30: warning: argument 'seq_begin' of command @param is not found in the argument list of boost::checks::compute_checksum(iterator begin, iterator end, counter_iter &counter)
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp:30: warning: argument 'seq_end' of command @param is not found in the argument list of boost::checks::compute_checksum(iterator begin, iterator end, counter_iter &counter)
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp:30: warning: The following parameters of boost::checks::compute_checksum(iterator begin, iterator end, counter_iter &counter) are not documented:
   parameter 'begin'
   parameter 'end'
   parameter 'counter'
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/ean.hpp:92: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::compute_ean13(const check_range &x)
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/ean.hpp:92: warning: The following parameters of boost::checks::compute_ean13(const check_range &x) are not documented:
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/ean.hpp:93: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::compute_ean13(const check_range &x)
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/ean.hpp:93: warning: The following parameters of boost::checks::compute_ean13(const check_range &x) are not documented:
   parameter 'x'
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/ean.hpp:139: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::compute_ean8(const check_range &x)
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/ean.hpp:139: warning: The following parameters of boost::checks::compute_ean8(const check_range &x) are not documented:
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/ean.hpp:140: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::compute_ean8(const check_range &x)
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/ean.hpp:140: warning: The following parameters of boost::checks::compute_ean8(const check_range &x) are not documented:
   parameter 'x'
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/isbn.hpp:117: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::compute_isbn10(const range &x)
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/isbn.hpp:117: warning: The following parameters of boost::checks::compute_isbn10(const range &x) are not documented:
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/isbn.hpp:118: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::compute_isbn10(const range &x)
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/isbn.hpp:118: warning: The following parameters of boost::checks::compute_isbn10(const range &x) are not documented:
   parameter 'x'
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/isbn.hpp:63: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::compute_isbn13(const range &x)
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/isbn.hpp:63: warning: The following parameters of boost::checks::compute_isbn13(const range &x) are not documented:
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/isbn.hpp:64: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::compute_isbn13(const range &x)
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/isbn.hpp:64: warning: The following parameters of boost::checks::compute_isbn13(const range &x) are not documented:
   parameter 'x'
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/mastercard.hpp:65: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::compute_mastercard(const check_range &x)
-/home/trademark/Boost/boost-sandbox/SOC/2011/checks/boost/checks/mastercard.hpp:65: warning: The following parameters of boost::checks::compute_mastercard(const check_range &x) are not documented:
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/mastercard.hpp:66: warning: argument 'check_seq' of command @param is not found in the argument list of boost::checks::compute_mastercard(const check_range &x)
+/home/trademark/Documents/boost/boost-sandbox/SOC/2011/checks/boost/checks/mastercard.hpp:66: warning: The following parameters of boost::checks::compute_mastercard(const check_range &x) are not documented:
   parameter '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-04-01 09:08:21 EDT (Mon, 01 Apr 2013)
@@ -8,9 +8,7 @@
     ]
     [authors [Talbot, Pierre]]
 ]
-
-
-[include ../../../../../../../boost-trunk/tools/auto_index/include/auto_index_helpers.qbk]
+[include ../../../../../../../boost-sandbox/tools/auto_index/include/auto_index_helpers.qbk]
 
 [/ Some links to external sources.]
 [def __boost [@http://www.boost.org/ Boost]]
@@ -83,6 +81,9 @@
 [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 __ASCII_TO_DIGIT__ [link checks.checks.reference.transliteration.ascii_to_digit ascii_to_digit]]
+[def __ASCII_TO_DIGITX__ [link checks.checks.reference.transliteration.ascii_to_digitx ascii_to_digitx]]
+
 [def __overview [link checks.checks.preface Preface]]
 
 [def __spaces '''&#x2000;&#x2000;'''] [/ two spaces - useful for an indent.]

Modified: sandbox/SOC/2011/checks/libs/checks/doc/quickstart.qbk
==============================================================================
--- sandbox/SOC/2011/checks/libs/checks/doc/quickstart.qbk (original)
+++ sandbox/SOC/2011/checks/libs/checks/doc/quickstart.qbk 2013-04-01 09:08:21 EDT (Mon, 01 Apr 2013)
@@ -14,7 +14,7 @@
 ``
 template <typename check_algo,
           typename range>
-bool check_sequence(const range &x);
+bool validate(const range &x);
 ``
 
 If `x` doesn't match the set of rules specified by `check_algo` it returns false. Generally,

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-04-01 09:08:21 EDT (Mon, 01 Apr 2013)
@@ -623,6 +623,111 @@
 [endsect][/section:digitx_filter digitx_filter]
 [endsect][/section:filter Filter]
 
+[section:transliteration Transliteration]
+[section:ascii_to_digit ascii_to_digit]
+[h3 Synopsis]
+``
+struct ascii_to_digit
+{
+ typedef size_t result_type;
+
+ template <typename value_type>
+ size_t operator()(const value_type &value) const;
+};
+``
+[h3 Description]
+
+Transliterate the value of an ASCII character between '0' and '9' into a integer between 0 and 9.
+
+[h3 Header]
+``
+#include <boost/checks/transliteration.hpp>
+``
+
+[h3 Post condition]
+
+The value is supposed to be correctly bounded. No check are performed since we assume that a filter has been called first.
+
+[h3 Template parameter]
+
+[*value_type] is the type of the value we want to transliterate.
+
+[h3 Parameter]
+
+[*value] is the value we want to transliterate.
+
+[h3 Return]
+
+The transliteration value of the ASCII character.
+
+[h3 See also]
+__ASCII_TO_DIGITX__, __CHECKSUM_REF__.
+[endsect][/section:ascii_to_digit]
+
+[section:ascii_to_digitx ascii_to_digitx]
+[h3 Synopsis]
+``
+struct ascii_to_digitx
+{
+ typedef size_t result_type;
+
+ template <typename value_type>
+ size_t operator()(const value_type &value) const;
+};
+``
+[h3 Description]
+
+Transliterate the value of an ASCII character between '0' and '9' or 'x'/'X' into a integer between 0 and 10.
+
+[h3 Header]
+``
+#include <boost/checks/transliteration.hpp>
+``
+[h3 Post condition]
+
+The value is supposed to be correctly bounded. No check are performed since we assume that a filter has been called first.
+
+[h3 Template parameter]
+
+[*value_type] is the type of the value we want to transliterate.
+
+[h3 Parameter]
+
+[*value] is the value we want to transliterate.
+
+[h3 Return]
+
+The transliteration value of the ASCII character, if it's a character representing a digit. If it's 'x' or 'X', than the result is 10.
+
+[h3 See also]
+__ASCII_TO_DIGIT__, __CHECKSUM_REF__.
+[endsect][/section:ascii_to_digitx]
+
+[section:transliteration_exception transliteration_exception]
+[h3 Synopsis]
+``
+class transliteration_exception : public std::exception
+{
+public:
+ transliteration_exception(const std::string& message);
+ transliteration_exception();
+ virtual const char* what() const;
+};
+``
+[h3 Description]
+
+Exception used to indicate runtime transliteration failure.
+
+[h3 Header]
+``
+#include <boost/checks/transliteration.hpp>
+``
+
+[h3 See also]
+__ASCII_TO_DIGIT__, __ASCII_TO_DIGITX__.
+[endsect][/section:transliteration_exception]
+[endsect][/section:transliteration]
+
 [section:type_adaptor Type adaptor]
 [endsect][/section:type_adaptor Type adaptor]
 

Modified: sandbox/SOC/2011/checks/libs/checks/example/vin.hpp
==============================================================================
--- sandbox/SOC/2011/checks/libs/checks/example/vin.hpp (original)
+++ sandbox/SOC/2011/checks/libs/checks/example/vin.hpp 2013-04-01 09:08:21 EDT (Mon, 01 Apr 2013)
@@ -7,7 +7,6 @@
 #ifndef BOOST_CHECKS_VIN_HPP
 #define BOOST_CHECKS_VIN_HPP
 
-//[vin_preprocessor_tools
 #include <stdexcept>
 #include <boost/checks/precheck.hpp>
 #include <boost/checks/checksum.hpp>


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