BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
BALL::PubChemDownloader Class Reference

Downloads PubChem entries. More...

#include <BALL/FORMAT/pubchemDownloader.h>

Public Member Functions

 PubChemDownloader ()
 
bool downloadSDFByName (const String &query, const String &filename)
 
bool downloadSDFByCID (int cid, const String &filename)
 

Private Member Functions

bool downloadSDF_ (const String &query, const String &type, const String &filename)
 

Private Attributes

const String pubchem_rest_url_
 Holds the base URL for the pubchem rest interface. More...
 

Detailed Description

Downloads PubChem entries.

This class provides a simplistic, blocking interface to the PubChem REST query interface. It downloads the obtained records in SDF format and

Definition at line 20 of file pubchemDownloader.h.

Constructor & Destructor Documentation

BALL::PubChemDownloader::PubChemDownloader ( )

Default constructor

Member Function Documentation

bool BALL::PubChemDownloader::downloadSDF_ ( const String query,
const String type,
const String filename 
)
private

Helper that does the actual download work.

Parameters
queryThe query defining the record
typeThe type of the query
filenameThe path to the resulting SD File
Returns
false if an error was encountered during download
bool BALL::PubChemDownloader::downloadSDFByCID ( int  cid,
const String filename 
)

Download an SD file corresponding to the Pubchem record identified by Pubchem CID

Parameters
cidThe CID of the substance that should be received.
filenameThe path to the file into which the results should be saved.
Returns
false if an error was encountered during download.
bool BALL::PubChemDownloader::downloadSDFByName ( const String query,
const String filename 
)

Download an SD file corresponding to the Pubchem record identified by name.

Parameters
queryThe name of the substance that should be received.
filenameThe path to the file into which the results should be saved.
Returns
false if an error was encountered during download.

Member Data Documentation

const String BALL::PubChemDownloader::pubchem_rest_url_
private

Holds the base URL for the pubchem rest interface.

Definition at line 52 of file pubchemDownloader.h.