]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/UIUCModel/uiuc_2DdataFileReader.cpp
Make yasim accept the launchbar and hook properties. They are not tied to anything...
[flightgear.git] / src / FDM / UIUCModel / uiuc_2DdataFileReader.cpp
index 9c45fe7cedace6331849ac82d0a19398f91ae504..6b1dcb25ebb9e2237b88e0300c80de4495ae6ff7 100644 (file)
 ----------------------------------------------------------------------
 
  HISTORY:      02/29/2000   initial release
+               10/25/2001   (RD) Modified so that it recognizes a
+                           blank line
+               06/30/2003   (RD) replaced istrstream with istringstream
+                            to get rid of the annoying warning about
+                            using the strstream header
 
 ----------------------------------------------------------------------
 
  AUTHOR(S):    Jeff Scott         <jscott@mail.com>
+               Robert Deters      <rdeters@uiuc.edu>
 
 ----------------------------------------------------------------------
 
@@ -98,17 +104,20 @@ void uiuc_2DdataFileReader( string file_name,
       linetoken1 = matrix -> getToken(*command_line, 1); // gettoken(string,tokenNo);
       linetoken2 = matrix -> getToken(*command_line, 2); // 2 represents token No 2
 
-      istrstream token1(linetoken1.c_str());
-      istrstream token2(linetoken2.c_str());
+      istringstream token1(linetoken1.c_str());
+      istringstream token2(linetoken2.c_str());
 
-      //reset token_value2 for first if statement
+      //reset token_value1 and token_value2 for first if statement
+      token_value1 = -999;
       token_value2 = -999;
 
       token1 >> token_value1;
       token2 >> token_value2;
 
+      //chenk to see if it is a blank line
+      if (token_value1==-999 && token_value2==-999);
       //check to see if only one value on line (token2 blank)
-      if (token_value2 == -999)
+      else if (token_value2 == -999)
         {
           y[counter_y] = token_value1 * convert_y;