00001 #pragma ident "$Id: TimeString.hpp 1162 2008-03-27 21:18:13Z snelsen $"
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 {
00035 std::string printTime( const CommonTime& t,
00036 const std::string& fmt )
00037 throw( gpstk::StringUtils::StringException );
00038
00043 template <class TimeTagType>
00044 std::string printAs( const CommonTime& t,
00045 const std::string& fmt )
00046 throw( gpstk::StringUtils::StringException )
00047 {
00048 TimeTagType ttt;
00049 try
00050 {
00051 ttt.convertFromCommonTime(t);
00052 return ttt.printf(fmt);
00053 }
00054 catch (InvalidRequest& ir)
00055 {
00056 return ttt.printError(fmt);
00057 }
00058 }
00059
00062 void scanTime( TimeTag& btime,
00063 const std::string& str,
00064 const std::string& fmt )
00065 throw( gpstk::InvalidRequest,
00066 gpstk::StringUtils::StringException );
00067
00068 void scanTime( CommonTime& t,
00069 const std::string& str,
00070 const std::string& fmt )
00071 throw( gpstk::InvalidRequest,
00072 gpstk::StringUtils::StringException );
00073
00085 void mixedScanTime( CommonTime& t,
00086 const std::string& str,
00087 const std::string& fmt )
00088 throw( gpstk::InvalidRequest,
00089 gpstk::StringUtils::StringException );
00090 }
00091
00092 #endif // GPSTK_TIMESTRING_HPP