Question

Hi,All

After having updated my gpstk source to the latest stable 1.6, I got an error when I try to call "AntexReader" in visual studio 2008, I steped into the code and found the problem:

the member function "string AntexReader::parseHeaderLine( const std::string& line )" doesn't always return a value, add "return label;" to the last of the function can fix the problem with my compiler(vc2008).

string AntexReader::parseHeaderLine( const std::string& line )
      throw(InvalidAntex)
   {

         // Get label. Remove trailing and leading blanks
      string label( strip( line.substr(60,20) ) );


         // Process version line
      if( label == versionString )
      {
         version = asDouble( line.substr(0,8) );
         char sys( line[20] );

         switch (sys)
         {
            case ' ':
            case 'G':
               system = SatID::systemGPS;
               break;
            case 'R':
               system = SatID::systemGlonass;
               break;
            case 'E':
               system = SatID::systemGalileo;
               break;
            case 'M':
               system = SatID::systemMixed;
               break;
            default:
               InvalidAntex e("Invalid GNSS system in Antex header.");
               GPSTK_THROW(e);
         }

         return label;

      }  // End of 'if( label == versionString )...'


         // Process PCV type line
      if( label == pcvTypeString )
      {
         char pcvt( line[0] );

         switch (pcvt)
         {
            case 'A':
               type = absolute;
               break;
            case 'R':
               type = relative;
               refAntena = strip( line.substr(20,20) );
               if( refAntena == "" )
               {
                  refAntena = "AOAD/M_T";
               }
               refAntenaSerial = strip( line.substr(40,20) );
               break;
            default:
               InvalidAntex e("Invalid PCV type in Antex header.");
               GPSTK_THROW(e);
         }

         return label;

      }  // End of 'if( label == pcvTypeString )...'


         // Process comments lines
      if( label == commentString )
      {

            // Get comment and put into 'commentList'
         commentList.push_back( strip( line.substr(0,60) ) );

         return label;

      }  // End of 'if( label == commentString )...'


   }  // End of method 'AntexReader::parseHeaderLine()'

Wish someone can check it. Thank you!

-- YanWei - 22 Aug 2009

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

Hi Wei!

You are right. I checked it up and applied the exact remedy you suggested. I just uploaded the correction to the repository.

Thank you very much!!!,

Dago

-- DagobertoSalazar - 26 Aug 2009

Hi,Again,

Thanks a lot for checking up.

YAN Wei

-- YanWei - 28 Aug 2009

Topic revision: r4 - 08 Sep 2009, YanWei
 

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback