12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #ifndef GREGORIAN_PARSERS_HPP___
- #define GREGORIAN_PARSERS_HPP___
- #include "boost/date_time/gregorian/gregorian_types.hpp"
- #include "boost/date_time/date_parsing.hpp"
- #include "boost/date_time/compiler_config.hpp"
- #include "boost/date_time/parse_format_base.hpp"
- #include <string>
- #include <sstream>
- namespace boost {
- namespace gregorian {
-
-
- BOOST_DATE_TIME_DECL special_values special_value_from_string(const std::string& s);
-
- inline date from_string(std::string s) {
- return date_time::parse_date<date>(s);
- }
-
- inline date from_simple_string(std::string s) {
- return date_time::parse_date<date>(s, date_time::ymd_order_iso);
- }
-
-
- inline date from_us_string(std::string s) {
- return date_time::parse_date<date>(s, date_time::ymd_order_us);
- }
-
-
- inline date from_uk_string(std::string s) {
- return date_time::parse_date<date>(s, date_time::ymd_order_dmy);
- }
-
-
- inline date from_undelimited_string(std::string s) {
- return date_time::parse_undelimited_date<date>(s);
- }
-
- inline date date_from_iso_string(const std::string& s) {
- return date_time::parse_undelimited_date<date>(s);
- }
- #if !(defined(BOOST_NO_STD_ITERATOR_TRAITS))
-
-
- template<class iterator_type>
- inline date from_stream(iterator_type beg, iterator_type end) {
- if(beg == end)
- {
- return date(not_a_date_time);
- }
- typedef typename std::iterator_traits<iterator_type>::value_type value_type;
- return date_time::from_stream_type<date>(beg, end, value_type());
- }
- #endif
-
- #if (defined(_MSC_VER) && (_MSC_VER < 1300))
-
- #else
-
- inline date_period date_period_from_string(const std::string& s){
- return date_time::from_simple_string_type<date,char>(s);
- }
- # if !defined(BOOST_NO_STD_WSTRING)
-
- inline date_period date_period_from_wstring(const std::wstring& s){
- return date_time::from_simple_string_type<date,wchar_t>(s);
- }
- # endif
- #endif
- } }
- #endif
|