00001 #pragma ident "$Id: AshtechStream.hpp 872 2007-11-02 14:42:54Z ocibu $" 00002 00003 //============================================================================ 00004 // 00005 // This file is part of GPSTk, the GPS Toolkit. 00006 // 00007 // The GPSTk is free software; you can redistribute it and/or modify 00008 // it under the terms of the GNU Lesser General Public License as published 00009 // by the Free Software Foundation; either version 2.1 of the License, or 00010 // any later version. 00011 // 00012 // The GPSTk is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU Lesser General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU Lesser General Public 00018 // License along with GPSTk; if not, write to the Free Software Foundation, 00019 // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 // 00021 // Copyright 2004, The University of Texas at Austin 00022 // 00023 //============================================================================ 00024 00025 //============================================================================ 00026 // 00027 //This software developed by Applied Research Laboratories at the University of 00028 //Texas at Austin, under contract to an agency or agencies within the U.S. 00029 //Department of Defense. The U.S. Government retains all rights to use, 00030 //duplicate, distribute, disclose, or release this software. 00031 // 00032 //Pursuant to DoD Directive 523024 00033 // 00034 // DISTRIBUTION STATEMENT A: This software has been approved for public 00035 // release, distribution is unlimited. 00036 // 00037 //============================================================================= 00038 00039 #ifndef ASHTECHSTREAM_HPP 00040 #define ASHTECHSTREAM_HPP 00041 00047 #include "FFBinaryStream.hpp" 00048 00049 namespace gpstk 00050 { 00054 class AshtechStream : public FFBinaryStream 00055 { 00056 public: 00057 AshtechStream():header(false) {} 00058 00063 AshtechStream(const char* fn, std::ios::openmode mode = std::ios::in) 00064 : FFBinaryStream(fn, mode) 00065 {} 00066 00068 virtual ~AshtechStream() 00069 {} 00070 00072 virtual void open(const char* fn, std::ios::openmode mode = std::ios::in) 00073 { 00074 FFBinaryStream::open(fn, mode); 00075 } 00076 00078 std::string rawData; 00079 00080 // set true when a header was the last piece read, set false when the 00081 // a body is read. 00082 bool header; 00083 00084 // Offset of the first character in rawData in the file 00085 std::streampos getRawPos() 00086 { 00087 std::streampos t = tellg(); 00088 if (static_cast<long>(t)==-1) 00089 return -1; 00090 else 00091 return t - static_cast<std::streampos>(rawData.length()); 00092 } 00093 00094 }; // class AshtechStream 00095 } // namespace gpstk 00096 00097 #endif
1.3.9.1