Changeset 31ccb6


Ignore:
Timestamp:
Mar 18, 2010, 11:37:26 AM (15 years ago)
Author:
Frederik Heber <heber@…>
Children:
800dc3
Parents:
6d0fcaa
git-author:
Frederik Heber <heber@…> (03/18/10 11:34:39)
git-committer:
Frederik Heber <heber@…> (03/18/10 11:37:26)
Message:

molecule::StoreAdjacencyToFile() and molecule::StoreBondsToFile() now take additional filename.

  • since ParseCommandLineOptions() has cases j and J which use the above functions, we have to generalize these functions to work also without a given path and with arbritrary filename.

Signed-off-by: Frederik Heber <heber@…>

Location:
molecuilder/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/molecule.hpp

    r6d0fcaa r31ccb6  
    269269  int FragmentMolecule(int Order, config *configuration);
    270270  bool CheckOrderAtSite(bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize, char *path = NULL);
    271   bool StoreBondsToFile(char *path);
    272   bool StoreAdjacencyToFile(char *path);
     271  bool StoreBondsToFile(char *path, char *filename);
     272  bool StoreAdjacencyToFile(char *path, char *filename);
    273273  bool CheckAdjacencyFileAgainstMolecule(char *path, atom **ListOfAtoms);
    274274  bool ParseOrderAtSiteFromFile(char *path);
  • molecuilder/src/molecule_fragmentation.cpp

    r6d0fcaa r31ccb6  
    703703
    704704    // store Adjacency file
    705     StoreAdjacencyToFile(configuration->configpath);
     705    char *filename = Malloc<char> (MAXSTRINGSIZE, "molecule::FragmentMolecule - *filename");
     706    strcpy(filename, FRAGMENTPREFIX);
     707    strcat(filename, ADJACENCYFILE);
     708    StoreAdjacencyToFile(configuration->configpath, filename);
     709    Free(&filename);
    706710
    707711    // store Hydrogen saturation correction file
  • molecuilder/src/molecule_graph.cpp

    r6d0fcaa r31ccb6  
    978978/** Storing the bond structure of a molecule to file.
    979979 * Simply stores Atom::nr and then the Atom::nr of all bond partners per line.
    980  * \param *out output stream for debugging
    981980 * \param *path path to file
     981 * \param *filename name of file
    982982 * \return true - file written successfully, false - writing failed
    983983 */
    984 bool molecule::StoreAdjacencyToFile(char *path)
     984bool molecule::StoreAdjacencyToFile(char *path, char *filename)
    985985{
    986986  ofstream AdjacencyFile;
     
    988988  bool status = true;
    989989
    990   line << path << "/" << FRAGMENTPREFIX << ADJACENCYFILE;
     990  if (path != NULL)
     991    line << path << "/" << filename;
     992  else
     993    line << filename;
    991994  AdjacencyFile.open(line.str().c_str(), ios::out);
    992995  Log() << Verbose(1) << "Saving adjacency list ... ";
     
    10071010/** Storing the bond structure of a molecule to file.
    10081011 * Simply stores Atom::nr and then the Atom::nr of all bond partners, one per line.
    1009  * \param *out output stream for debugging
    10101012 * \param *path path to file
     1013 * \param *filename name of file
    10111014 * \return true - file written successfully, false - writing failed
    10121015 */
    1013 bool molecule::StoreBondsToFile(char *path)
     1016bool molecule::StoreBondsToFile(char *path, char *filename)
    10141017{
    10151018  ofstream BondFile;
     
    10171020  bool status = true;
    10181021
    1019   line << path << "/" << FRAGMENTPREFIX << ADJACENCYFILE;
     1022  if (path != NULL)
     1023    line << path << "/" << filename;
     1024  else
     1025    line << filename;
    10201026  BondFile.open(line.str().c_str(), ios::out);
    10211027  Log() << Verbose(1) << "Saving adjacency list ... ";
Note: See TracChangeset for help on using the changeset viewer.