TimeString.hpp

Go to the documentation of this file.
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 //  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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, 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 {
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 } // namespace
00148 
00149 #endif // GPSTK_TIMESTRING_HPP

Generated on Sun May 19 03:31:14 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1