Changes in src/Parser/XyzParser.cpp [df481f:112b09]
- File:
-
- 1 edited
-
src/Parser/XyzParser.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/XyzParser.cpp
rdf481f r112b09 27 27 */ 28 28 XyzParser::~XyzParser() { 29 delete(&comment); 29 30 } 30 31 … … 57 58 */ 58 59 void XyzParser::save(ostream* file) { 59 if (comment == "") {60 time_t now = time((time_t *)NULL); // Get the system time and put it into 'now' as 'calender time'61 comment = "\tCreated by molecuilder on ";62 // ctime ends in \n\0, we have to cut away the newline63 std::string time(ctime(&now));64 size_t pos = time.find('\n');65 if (pos != 0)66 comment += time.substr(0,pos);67 else68 comment += time;69 }70 60 *file << World::getInstance().numAtoms() << endl << comment << endl; 71 61 72 62 vector<atom*> atoms = World::getInstance().getAllAtoms(); 73 63 for(vector<atom*>::iterator it = atoms.begin(); it != atoms.end(); it++) { 74 *file << noshowpoint<< (*it)->getType()->symbol << "\t" << (*it)->x[0] << "\t" << (*it)->x[1] << "\t" << (*it)->x[2] << endl;64 *file << fixed << (*it)->getType()->symbol << "\t" << (*it)->x[0] << "\t" << (*it)->x[1] << "\t" << (*it)->x[2] << endl; 75 65 } 76 66 }
Note:
See TracChangeset
for help on using the changeset viewer.
