src/GamIO/Gascii.cc
// ____________________________________________________________________________
// A                    ASCII File Reading & Parsing Of Strings
// ____________________________________________________________________________
A                    ASCII File Reading & Parsing Of Strings
A ASCII File Reading & Parsing Of Strings
string* Getstrings(const string& filename, int& N)
  {
  string input;                         
  string datas;                         
  ifstream inp;                         
  int lines = LineCount(filename);      
  string* Svect;                        
  Svect = new string[lines];            
  lines = 0;                            
  inp.open(filename.c_str());           
  while(Greadline(inp, input))          
    Svect[lines++] = input;             
  N = lines;
  return Svect;
  }
string * Getstrings ( const string & filename , int & N ) { string input ; string datas ; ifstream inp ; int lines = LineCount ( filename ) ; string * Svect ; Svect = new string [ lines ] ; lines = 0 ; inp . open ( filename . c_str ( ) ) ; while ( Greadline ( inp , input ) ) Svect [ lines ++ ] = input ; N = lines ; return Svect ; }
____________________________________________________________________________
A                    ASCII File Reading & Parsing Of Strings
____________________________________________________________________________
____________________________________________________________________________ A ASCII File Reading & Parsing Of Strings ____________________________________________________________________________
// Input        filename: ASCII input file name // Return       Svect   : A string vector is filled with names //                        found in the file "filename" // Note                 : Assumes file contains 1 name per line // Note	           : Value of N set to # of strings read // Note                 : String array must be externally destruced // String for a whole line // String for read data // Input stream // Line count // String vector, 1 string per line // Allocate string vector space // Reset line count // Reopen the file // Loop file, read lines // Store the value in vector