void IOList::readIOList(istream & is)
{
   clearIOList();

   char deadStr[256];
   char typeStr[256];
   char nameStr[256];
   is >> deadStr;
   
   int sz;
   is >> sz;
   
   for(int i=0; i<sz; i++)
   {
      is >> typeStr;
      is >> nameStr;
      string theType = string(typeStr);
      string theName = string(nameStr);
      

      if( theType.compare("float") == 0 )
         read_float_(nameStr, is);
      else if( theType.compare("double") == 0 )
         read_double_(nameStr, is);
      else if( theType.compare("int") == 0 )
         read_int_(nameStr, is);
      else if( theType.compare("short") == 0 )
         read_short_(nameStr, is);
      else if( theType.compare("bool") == 0 )
         read_bool_(nameStr, is);
      else if( theType.compare("string") == 0 )
         read_string_(nameStr, is);
      else if( theType.compare("vector_float") == 0 )
         read_vector_float_(nameStr, is);
      else if( theType.compare("vector_double") == 0 )
         read_vector_double_(nameStr, is);
      else if( theType.compare("vector_int") == 0 )
         read_vector_int_(nameStr, is);
      else if( theType.compare("vector_short") == 0 )
         read_vector_short_(nameStr, is);
      else if( theType.compare("vector_bool") == 0 )
         read_vector_bool_(nameStr, is);
      else 
         cout << "***ERROR:  Unknown type-string! " << theType << endl;
   }
}
示例#2
0
文件: coreio.cpp 项目: dcthe1/mars
CoreIO::~CoreIO()
{
  clearIOList();
}