regex.hpp 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. /*
  2. *
  3. * Copyright (c) 1998-2002
  4. * John Maddock
  5. *
  6. * Use, modification and distribution are subject to the
  7. * Boost Software License, Version 1.0. (See accompanying file
  8. * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. *
  10. */
  11. /*
  12. * LOCATION: see http://www.boost.org for most recent version.
  13. * FILE regex.cpp
  14. * VERSION see <boost/version.hpp>
  15. * DESCRIPTION: Declares boost::basic_regex<> and associated
  16. * functions and classes. This header is the main
  17. * entry point for the template regex code.
  18. */
  19. #ifndef BOOST_RE_REGEX_HPP_INCLUDED
  20. #define BOOST_RE_REGEX_HPP_INCLUDED
  21. #ifdef __cplusplus
  22. // what follows is all C++ don't include in C builds!!
  23. #ifndef BOOST_REGEX_CONFIG_HPP
  24. #include <boost/regex/config.hpp>
  25. #endif
  26. #ifndef BOOST_REGEX_WORKAROUND_HPP
  27. #include <boost/regex/v4/regex_workaround.hpp>
  28. #endif
  29. #ifndef BOOST_REGEX_FWD_HPP
  30. #include <boost/regex_fwd.hpp>
  31. #endif
  32. #ifndef BOOST_REGEX_TRAITS_HPP
  33. #include <boost/regex/regex_traits.hpp>
  34. #endif
  35. #ifndef BOOST_REGEX_RAW_BUFFER_HPP
  36. #include <boost/regex/v4/error_type.hpp>
  37. #endif
  38. #ifndef BOOST_REGEX_V4_MATCH_FLAGS
  39. #include <boost/regex/v4/match_flags.hpp>
  40. #endif
  41. #ifndef BOOST_REGEX_RAW_BUFFER_HPP
  42. #include <boost/regex/v4/regex_raw_buffer.hpp>
  43. #endif
  44. #ifndef BOOST_RE_PAT_EXCEPT_HPP
  45. #include <boost/regex/pattern_except.hpp>
  46. #endif
  47. #ifndef BOOST_REGEX_V4_CHAR_REGEX_TRAITS_HPP
  48. #include <boost/regex/v4/char_regex_traits.hpp>
  49. #endif
  50. #ifndef BOOST_REGEX_V4_STATES_HPP
  51. #include <boost/regex/v4/states.hpp>
  52. #endif
  53. #ifndef BOOST_REGEX_V4_REGBASE_HPP
  54. #include <boost/regex/v4/regbase.hpp>
  55. #endif
  56. #ifndef BOOST_REGEX_V4_ITERATOR_TRAITS_HPP
  57. #include <boost/regex/v4/iterator_traits.hpp>
  58. #endif
  59. #ifndef BOOST_REGEX_V4_BASIC_REGEX_HPP
  60. #include <boost/regex/v4/basic_regex.hpp>
  61. #endif
  62. #ifndef BOOST_REGEX_V4_BASIC_REGEX_CREATOR_HPP
  63. #include <boost/regex/v4/basic_regex_creator.hpp>
  64. #endif
  65. #ifndef BOOST_REGEX_V4_BASIC_REGEX_PARSER_HPP
  66. #include <boost/regex/v4/basic_regex_parser.hpp>
  67. #endif
  68. #ifndef BOOST_REGEX_V4_SUB_MATCH_HPP
  69. #include <boost/regex/v4/sub_match.hpp>
  70. #endif
  71. #ifndef BOOST_REGEX_FORMAT_HPP
  72. #include <boost/regex/v4/regex_format.hpp>
  73. #endif
  74. #ifndef BOOST_REGEX_V4_MATCH_RESULTS_HPP
  75. #include <boost/regex/v4/match_results.hpp>
  76. #endif
  77. #ifndef BOOST_REGEX_V4_PROTECTED_CALL_HPP
  78. #include <boost/regex/v4/protected_call.hpp>
  79. #endif
  80. #ifndef BOOST_REGEX_MATCHER_HPP
  81. #include <boost/regex/v4/perl_matcher.hpp>
  82. #endif
  83. //
  84. // template instances:
  85. //
  86. #define BOOST_REGEX_CHAR_T char
  87. #ifdef BOOST_REGEX_NARROW_INSTANTIATE
  88. # define BOOST_REGEX_INSTANTIATE
  89. #endif
  90. #include <boost/regex/v4/instances.hpp>
  91. #undef BOOST_REGEX_CHAR_T
  92. #ifdef BOOST_REGEX_INSTANTIATE
  93. # undef BOOST_REGEX_INSTANTIATE
  94. #endif
  95. #ifndef BOOST_NO_WREGEX
  96. #define BOOST_REGEX_CHAR_T wchar_t
  97. #ifdef BOOST_REGEX_WIDE_INSTANTIATE
  98. # define BOOST_REGEX_INSTANTIATE
  99. #endif
  100. #include <boost/regex/v4/instances.hpp>
  101. #undef BOOST_REGEX_CHAR_T
  102. #ifdef BOOST_REGEX_INSTANTIATE
  103. # undef BOOST_REGEX_INSTANTIATE
  104. #endif
  105. #endif
  106. #if !defined(BOOST_NO_WREGEX) && defined(BOOST_REGEX_HAS_OTHER_WCHAR_T)
  107. #define BOOST_REGEX_CHAR_T unsigned short
  108. #ifdef BOOST_REGEX_US_INSTANTIATE
  109. # define BOOST_REGEX_INSTANTIATE
  110. #endif
  111. #include <boost/regex/v4/instances.hpp>
  112. #undef BOOST_REGEX_CHAR_T
  113. #ifdef BOOST_REGEX_INSTANTIATE
  114. # undef BOOST_REGEX_INSTANTIATE
  115. #endif
  116. #endif
  117. namespace boost{
  118. #ifdef BOOST_REGEX_NO_FWD
  119. typedef basic_regex<char, regex_traits<char> > regex;
  120. #ifndef BOOST_NO_WREGEX
  121. typedef basic_regex<wchar_t, regex_traits<wchar_t> > wregex;
  122. #endif
  123. #endif
  124. typedef match_results<const char*> cmatch;
  125. typedef match_results<std::string::const_iterator> smatch;
  126. #ifndef BOOST_NO_WREGEX
  127. typedef match_results<const wchar_t*> wcmatch;
  128. typedef match_results<std::wstring::const_iterator> wsmatch;
  129. #endif
  130. } // namespace boost
  131. #ifndef BOOST_REGEX_MATCH_HPP
  132. #include <boost/regex/v4/regex_match.hpp>
  133. #endif
  134. #ifndef BOOST_REGEX_V4_REGEX_SEARCH_HPP
  135. #include <boost/regex/v4/regex_search.hpp>
  136. #endif
  137. #ifndef BOOST_REGEX_ITERATOR_HPP
  138. #include <boost/regex/v4/regex_iterator.hpp>
  139. #endif
  140. #ifndef BOOST_REGEX_TOKEN_ITERATOR_HPP
  141. #include <boost/regex/v4/regex_token_iterator.hpp>
  142. #endif
  143. #ifndef BOOST_REGEX_V4_REGEX_GREP_HPP
  144. #include <boost/regex/v4/regex_grep.hpp>
  145. #endif
  146. #ifndef BOOST_REGEX_V4_REGEX_REPLACE_HPP
  147. #include <boost/regex/v4/regex_replace.hpp>
  148. #endif
  149. #ifndef BOOST_REGEX_V4_REGEX_MERGE_HPP
  150. #include <boost/regex/v4/regex_merge.hpp>
  151. #endif
  152. #ifndef BOOST_REGEX_SPLIT_HPP
  153. #include <boost/regex/v4/regex_split.hpp>
  154. #endif
  155. #endif // __cplusplus
  156. #endif // include