Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 09:47:49

0001 // char_traits.hpp
0002 // Copyright (c) 2007-2009 Ben Hanson (http://www.benhanson.net/)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 #ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_CHAR_TRAITS_HPP
0007 #define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_CHAR_TRAITS_HPP
0008 
0009 // Make sure wchar_t is defined
0010 #include <string>
0011 
0012 namespace boost
0013 {
0014 namespace lexer
0015 {
0016 template<typename CharT>
0017 struct char_traits
0018 {
0019     typedef CharT char_type;
0020     typedef CharT index_type;
0021 
0022     static index_type call (CharT ch)
0023     {
0024        return ch;
0025     }
0026 };
0027 
0028 template<>
0029 struct char_traits<char>
0030 {
0031     typedef char char_type;
0032     typedef unsigned char index_type;
0033         
0034     static index_type call (char ch)
0035     {
0036         return static_cast<index_type>(ch);
0037     }
0038 };
0039 
0040 template<>
0041 struct char_traits<wchar_t>
0042 {
0043     typedef wchar_t char_type;
0044     typedef wchar_t index_type;
0045 
0046     static index_type call (wchar_t ch)
0047     {
0048         return ch;
0049     }
0050 };
0051 }
0052 }
0053 
0054 #endif