00001 #pragma ident "$Id: TimeString.hpp 3140 2012-06-18 15:03:02Z susancummins $"
00002
00003
00004
00005 #ifndef GPSTK_TIMESTRING_HPP
00006 #define GPSTK_TIMESTRING_HPP
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "TimeTag.hpp"
00031 #include "CommonTime.hpp"
00032
00033 namespace gpstk
00034 {
00092 std::string printTime( const CommonTime& t,
00093 const std::string& fmt )
00094 throw( gpstk::StringUtils::StringException );
00095
00100 template <class TimeTagType>
00101 std::string printAs( const CommonTime& t,
00102 const std::string& fmt )
00103 throw( gpstk::StringUtils::StringException )
00104 {
00105 TimeTagType ttt;
00106 try
00107 {
00108 ttt.convertFromCommonTime(t);
00109 return ttt.printf(fmt);
00110 }
00111 catch (InvalidRequest& ir)
00112 {
00113 return ttt.printError(fmt);
00114 }
00115 }
00116
00119 void scanTime( TimeTag& btime,
00120 const std::string& str,
00121 const std::string& fmt )
00122 throw( gpstk::InvalidRequest,
00123 gpstk::StringUtils::StringException );
00124
00125 void scanTime( CommonTime& t,
00126 const std::string& str,
00127 const std::string& fmt )
00128 throw( gpstk::InvalidRequest,
00129 gpstk::StringUtils::StringException );
00130
00142 void mixedScanTime( CommonTime& t,
00143 const std::string& str,
00144 const std::string& fmt )
00145 throw( gpstk::InvalidRequest,
00146 gpstk::StringUtils::StringException );
00147 }
00148
00149 #endif // GPSTK_TIMESTRING_HPP