TimeString.hpp

Go to the documentation of this file.
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 //  This file is part of GPSTk, the GPS Toolkit.
00011 //
00012 //  The GPSTk is free software; you can redistribute it and/or modify
00013 //  it under the terms of the GNU Lesser General Public License as published
00014 //  by the Free Software Foundation; either version 2.1 of the License, or
00015 //  any later version.
00016 //
00017 //  The GPSTk is distributed in the hope that it will be useful,
00018 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 //  GNU Lesser General Public License for more details.
00021 //
00022 //  You should have received a copy of the GNU Lesser General Public
00023 //  License along with GPSTk; if not, write to the Free Software Foundation,
00024 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 //  
00026 //  Copyright 2004, The University of Texas at Austin
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 } // namespace
00091 
00092 #endif // GPSTK_TIMESTRING_HPP

Generated on Tue May 22 03:31:02 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1