RDCode: RDKit::SDWriter Class Reference

# RDKit::SDWriter Class Reference

`#include <MolWriters.h>`

Inheritance diagram for RDKit::SDWriter:

List of all members.

## Public Member Functions
| SDWriter (std::string fileName)
| SDWriter (std::ostream *outStream, bool takeOwnership=false)
| ~SDWriter ()
void | setProps (const STR_VECT &propNames)
| set a vector of property names that are need to be written out for each molecule
void | write (ROMol &mol, int confId=defaultConfId)
| write a new molecule to the file
void | flush ()
| flush the ostream
unsigned int | numMols () const
| get the number of molecules written so far

## Detailed Description

The SDWriter is for writing molecules and properties to SD files

Definition at line 108 of file MolWriters.h.

## Constructor & Destructor Documentation

RDKit::SDWriter::SDWriter | ( | std::string | fileName | ) |

RDKit::SDWriter::SDWriter | ( | std::ostream * | outStream,
|  | bool | takeOwnership = `false` |
| ) |  |  |

RDKit::SDWriter::~SDWriter | ( |  | ) |

## Member Function Documentation

void RDKit::SDWriter::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::SDWriter::write | ( | ROMol & | mol,
|  | int | confId = `defaultConfId` |
| ) |  |  | `[virtual]`

write a new molecule to the file

Implements RDKit::MolWriter.

void RDKit::SDWriter::flush | ( |  | ) | `[inline, virtual]`

flush the ostream

Implements RDKit::MolWriter.

Definition at line 129 of file MolWriters.h.

References PRECONDITION.

unsigned int RDKit::SDWriter::numMols | ( |  | ) | const`[inline, virtual]`

get the number of molecules written so far

Implements RDKit::MolWriter.

Definition at line 135 of file MolWriters.h.

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

- MolWriters.h