RDKit::SmilesWriter Class Reference

`#include <MolWriters.h>`

Inheritance diagram for RDKit::SmilesWriter:

## Public Member Functions

| SmilesWriter (std::string fileName, std::string delimiter=" ", std::string nameHeader="Name", bool includeHeader=true, bool isomericSmiles=false, bool kekuleSmiles=false)
| SmilesWriter (std::ostream *outStream, std::string delimiter=" ", std::string nameHeader="Name", bool includeHeader=true, bool takeOwnership=false, bool isomericSmiles=false, bool kekuleSmiles=false)
| ~SmilesWriter ()
void | setProps (const STR_VECT &propNames)
| set a vector of property names that are need to be written out for each molecule More...
void | write (const ROMol &mol, int confId=defaultConfId)
| write a new molecule to the file More...
void | flush ()
| flush the ostream More...
void | close ()
| close our stream (the writer cannot be used again) More...
unsigned int | numMols () const
| get the number of molecules written so far More...
Public Member Functions inherited from RDKit::MolWriter
virtual | ~MolWriter ()

## Detailed Description

The SmilesWriter is for writing molecules and properties to delimited text files.

Definition at line 35 of file MolWriters.h.

## Constructor & Destructor Documentation

RDKit::SmilesWriter::SmilesWriter | ( | std::string | fileName,
|  | std::string | delimiter = `" "`,
|  | std::string | nameHeader = `"Name"`,
|  | bool | includeHeader = `true`,
|  | bool | isomericSmiles = `false`,
|  | bool | kekuleSmiles = `false`
| ) |  |

Parameters

  fileName | : filename to write to ("-" to write to stdout)
  delimiter | : delimiter to use in the text file
  nameHeader | : used to label the name column in the output. If this is provided as the empty string, no names will be written.
  includeHeader | : toggles inclusion of a header line in the output
  isomericSmiles | : toggles generation of isomeric SMILES
  kekuleSmiles | : toggles the generation of kekule SMILES

RDKit::SmilesWriter::SmilesWriter | ( | std::ostream * | outStream,
|  | std::string | delimiter = `" "`,
|  | std::string | nameHeader = `"Name"`,
|  | bool | includeHeader = `true`,
|  | bool | takeOwnership = `false`,
|  | bool | isomericSmiles = `false`,
|  | bool | kekuleSmiles = `false`
| ) |  |

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

RDKit::SmilesWriter::~SmilesWriter | ( |  | ) |

## Member Function Documentation

void RDKit::SmilesWriter::close | ( |  | ) |

inline virtual

close our stream (the writer cannot be used again)

Implements RDKit::MolWriter.

Definition at line 85 of file MolWriters.h.

References PRECONDITION.

void RDKit::SmilesWriter::flush | ( |  | ) |

inline virtual

flush the ostream

Implements RDKit::MolWriter.

Definition at line 79 of file MolWriters.h.

References PRECONDITION.

unsigned int RDKit::SmilesWriter::numMols | ( |  | ) | const

inline virtual

get the number of molecules written so far

Implements RDKit::MolWriter.

Definition at line 96 of file MolWriters.h.

void RDKit::SmilesWriter::setProps | ( | const STR_VECT & | propNames | ) |

virtual

set a vector of property names that are need to be written out for each molecule

Implements RDKit::MolWriter.

void RDKit::SmilesWriter::write | ( | const ROMol & | mol,
|  | int | confId = `defaultConfId`
| ) |  |

virtual

write a new molecule to the file

Implements RDKit::MolWriter.

The documentation for this class was generated from the following file:

- MolWriters.h