Listing 18 Out-of-line member functions for the Arglist class in Listing 17

#include <fstream.h>
#include "arglist3.h"

Arglist::Arglist(size_t arg_count, char **arg_vec)
      : args(arg_count,0,CHUNK)
{
   for (int i = 0; i < arg_count; ++i)
      if (arg_vec[i][0] == '@')
         expand(arg_vec[i]+1);
      else
         add(arg_vec[i]);
}

void Arglist::expand(char *fname)
{
   ifstream f(fname);
   const size_t BUFSIZ = 64;
   char token[BUFSIZ];

   while (f >> token)
      if (token[0] == '@')
         expand(token+1);
      else
         add(token);
}

/* End of File */