ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/openbabel/xyzformat.cpp
(Generate patch)

Comparing trunk/OOPSE-2.0/src/openbabel/xyzformat.cpp (file contents):
Revision 2517 by tim, Fri Dec 2 15:38:03 2005 UTC vs.
Revision 2518 by tim, Fri Dec 16 21:52:50 2005 UTC

# Line 42 | Line 42 | bool XYZFormat::ReadMolecule(OBBase* pOb, OBConversion
42  
43      if (!ifs.getline(buffer,BUFF_SIZE))
44        {
45 <        obErrorLog.ThrowError(__FUNCTION__,
45 >        obErrorLog.ThrowError(__func__,
46                                "Problems reading an XYZ file: Cannot read the first line.", obWarning);
47          return(false);
48        }
49  
50      if (sscanf(buffer, "%d", &natoms) == 0 || !natoms)
51      {
52 <      obErrorLog.ThrowError(__FUNCTION__,
52 >      obErrorLog.ThrowError(__func__,
53                              "Problems reading an XYZ file: The first line must contain the number of atoms.", obWarning);
54        return(false);
55      }
# Line 61 | Line 61 | bool XYZFormat::ReadMolecule(OBBase* pOb, OBConversion
61      // empty. Otherwise, use the title given by the calling function.
62      if (!ifs.getline(buffer,BUFF_SIZE))
63      {
64 <      obErrorLog.ThrowError(__FUNCTION__,
64 >      obErrorLog.ThrowError(__func__,
65                              "Problems reading an XYZ file: Could not read the second line (title/comments).", obWarning);
66          return(false);
67      }
# Line 84 | Line 84 | bool XYZFormat::ReadMolecule(OBBase* pOb, OBConversion
84                     << " According to line one, there should be " << natoms
85                     << " atoms, and therefore " << natoms+2 << " lines in the file.";
86  
87 <          obErrorLog.ThrowError(__FUNCTION__, errorMsg.str() , obWarning);
87 >          obErrorLog.ThrowError(__func__, errorMsg.str() , obWarning);
88            return(false);
89          }
90          tokenize(vs,buffer);
# Line 96 | Line 96 | bool XYZFormat::ReadMolecule(OBBase* pOb, OBConversion
96                     << "According to the specifications, this line should contain exactly 4 entries, separated by white space." << endl
97                     << "However, OpenBabel found " << vs.size() << " items.";
98  
99 <          obErrorLog.ThrowError(__FUNCTION__, errorMsg.str() , obWarning);
99 >          obErrorLog.ThrowError(__func__, errorMsg.str() , obWarning);
100            return(false);
101          }
102  
# Line 124 | Line 124 | bool XYZFormat::ReadMolecule(OBBase* pOb, OBConversion
124                     << "According to the specifications, this line should contain exactly 4 entries, separated by white space." << endl
125                     << "OpenBabel could not interpret item #1 as a number.";
126  
127 <          obErrorLog.ThrowError(__FUNCTION__, errorMsg.str() , obWarning);
127 >          obErrorLog.ThrowError(__func__, errorMsg.str() , obWarning);
128            return(false);
129          }
130          double y = strtod((char*)vs[2].c_str(),&endptr);
# Line 136 | Line 136 | bool XYZFormat::ReadMolecule(OBBase* pOb, OBConversion
136                     << "According to the specifications, this line should contain exactly 4 entries, separated by white space." << endl
137                     << "OpenBabel could not interpret item #2 as a number.";
138  
139 <          obErrorLog.ThrowError(__FUNCTION__, errorMsg.str() , obWarning);
139 >          obErrorLog.ThrowError(__func__, errorMsg.str() , obWarning);
140            return(false);
141          }
142          double z = strtod((char*)vs[3].c_str(),&endptr);
# Line 148 | Line 148 | bool XYZFormat::ReadMolecule(OBBase* pOb, OBConversion
148                     << "According to the specifications, this line should contain exactly 4 entries, separated by white space." << endl
149                     << "OpenBabel could not interpret item #3 as a number.";
150  
151 <          obErrorLog.ThrowError(__FUNCTION__, errorMsg.str() , obWarning);
151 >          obErrorLog.ThrowError(__func__, errorMsg.str() , obWarning);
152            return(false);
153          }
154          atom->SetVector(x,y,z); //set coordinates

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines