Changeset 1197 in Sophya for trunk/SophyaLib/SUtils


Ignore:
Timestamp:
Sep 22, 2000, 12:37:44 PM (25 years ago)
Author:
ansari
Message:

correction petit bug ds datacard.cc (ajout fclose(fip)) et numero de version - Reza 22/9/2000

Location:
trunk/SophyaLib/SUtils
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SUtils/datacards.cc

    r913 r1197  
    1 // $Id: datacards.cc,v 1.3 2000-04-13 15:58:38 ansari Exp $
     1/// $Id: datacards.cc,v 1.4 2000-09-22 10:37:44 ansari Exp $
    22//
    33// Datacards, acquisition EROS II
     
    263263DataCards::DoReadFile(string const& fn)
    264264{
    265 char line_buff[512];
    266 FILE *fip;
    267 
    268 if ( (fip = fopen(fn.c_str(),"r")) == NULL ) 
    269   throw IOExc("DataCards::DoReadFile() fopen Error ") ;
    270 while (fgets(line_buff,511,fip) != NULL)
    271   {
    272   line_buff[strlen(line_buff)-1] = '\0';   /*  LF/CR de la fin */
    273   string line(line_buff);
    274   AppendCard(line);
    275   }
     265  char line_buff[512];
     266  FILE *fip;
     267
     268  if ( (fip = fopen(fn.c_str(),"r")) == NULL ) 
     269    throw IOExc("DataCards::DoReadFile() fopen Error ") ;
     270  while (fgets(line_buff,511,fip) != NULL) {
     271    line_buff[strlen(line_buff)-1] = '\0';   /*  LF/CR de la fin */
     272    string line(line_buff);
     273    AppendCard(line);
     274  }
     275  fclose(fip);
     276  return;
    276277}
    277278
  • trunk/SophyaLib/SUtils/datacards.h

    r895 r1197  
    11// This may look like C code, but it is really -*- C++ -*-
    22//
    3 // $Id: datacards.h,v 1.2 2000-04-12 17:49:43 ansari Exp $
     3// $Id: datacards.h,v 1.3 2000-09-22 10:37:44 ansari Exp $
    44//
    55// Datacards, acquisition EROS II
     
    9090
    9191//! operator << overloading - calls Print()
    92 inline ostream& operator << (ostream& s, DataCards c)
     92inline ostream& operator << (ostream& s, DataCards const & c)
    9393{ c.Print(s); return s; }
    9494
Note: See TracChangeset for help on using the changeset viewer.