OEGetSmiStringOrder(const OEMolBase &mol,
                           unsigned int flavor = OESMILESFlag::DEFAULT);

Returns an iterator over the heavy atoms of a molecule, in the order in which they appear in the canonical SMILES string. Several variants of SMILES format are supported by using different flavors from the OESMILESFlag namespace.

#include <openeye.h>
#include <oesystem.h>
#include <oechem.h>

using namespace std;
using namespace OESystem;
using namespace OEChem;

int main()
  OEGraphMol mol;
  OESmilesToMol(mol, "N1CCCC1");
  for (OEIter<OEAtomBase> ai = OEGetSmiStringOrder(mol); ai; ++ai)
    cout << ai->GetIdx() << ' ' << OEGetAtomicSymbol(ai->GetAtomicNum()) << endl;
  return 0;

See also