assert_line_base.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // assert_line_base.hpp
  3. //
  4. // Copyright 2008 Eric Niebler. Distributed under the Boost
  5. // Software License, Version 1.0. (See accompanying file
  6. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. #ifndef BOOST_XPRESSIVE_DETAIL_CORE_MATCHER_DETAIL_ASSERT_LINE_BASE_HPP_EAN_10_04_2005
  8. #define BOOST_XPRESSIVE_DETAIL_CORE_MATCHER_DETAIL_ASSERT_LINE_BASE_HPP_EAN_10_04_2005
  9. // MS compatible compilers support #pragma once
  10. #if defined(_MSC_VER)
  11. # pragma once
  12. #endif
  13. #include <boost/xpressive/detail/detail_fwd.hpp>
  14. #include <boost/xpressive/detail/core/quant_style.hpp>
  15. #include <boost/xpressive/detail/core/state.hpp>
  16. namespace boost { namespace xpressive { namespace detail
  17. {
  18. ///////////////////////////////////////////////////////////////////////////////
  19. // assert_line_base
  20. //
  21. template<typename Traits>
  22. struct assert_line_base
  23. : quant_style_assertion
  24. {
  25. typedef typename Traits::char_type char_type;
  26. typedef typename Traits::char_class_type char_class_type;
  27. protected:
  28. assert_line_base(Traits const &tr)
  29. : newline_(lookup_classname(tr, "newline"))
  30. , nl_(tr.widen('\n'))
  31. , cr_(tr.widen('\r'))
  32. {
  33. }
  34. char_class_type newline_;
  35. char_type nl_, cr_;
  36. };
  37. }}}
  38. #endif