SDFile Class |
Namespace: Scilligence.MolEngine.IO
public class SDFile : MDLDBBase
The SDFile type exposes the following members.
| Name | Description | |
|---|---|---|
| SDFile(TextReader) |
Construct a SDFile reading object
| |
| SDFile(TextWriter) |
Construct a SDFile writing object
| |
| SDFile(Stream, MDLDBBaseOpenMode) |
Construct a SDFile object from a stream
| |
| SDFile(String, MDLDBBaseOpenMode) |
Construct a SDFile object from a file
| |
| SDFile(String, MDLDBBaseOpenMode, Encoding) |
Construct a SDFile object from a file
| |
| SDFile(Stream, MDLDBBaseOpenMode, Encoding, Boolean) |
Construct a SDFile object from a stream
|
| Name | Description | |
|---|---|---|
| CompressedData |
The compressed record data
(Inherited from MDLDBBase.) | |
| Data | (Overrides MDLDBBaseData.) | |
| Eof |
Test if it already reached the end of the file
(Inherited from MDLDBBase.) | |
| IsRead |
Reading file mode
(Inherited from MDLDBBase.) | |
| LastError |
Get last error
(Inherited from MDLDBBase.) | |
| Mode |
The current file open mode
(Inherited from MDLDBBase.) | |
| Progress |
Calculate the reading progress: 0 - 1.0
(Inherited from MDLDBBase.) | |
| Writer | (Inherited from MDLDBBase.) |
| Name | Description | |
|---|---|---|
| Dispose |
Dispose the object and release memory
(Inherited from MDLDBBase.) | |
| Equals | (Inherited from Object.) | |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
| ReadAll | ||
| ReadAll(Int32) | ||
| ReadLine | (Inherited from MDLDBBase.) | |
| ReadNext |
Read next record
| |
| ReadNext(DictionaryString, Object, Int32) |
Read next record
(Overrides MDLDBBaseReadNext(DictionaryString, Object, Int32).) | |
| ReadNext(DictionaryString, Object, Molecule, Int32) | ||
| ReadNext(DictionaryString, Object, String, Int32) |
Read the next record
| |
| ToString | Returns a string that represents the current object. (Inherited from Object.) | |
| WriteOne(SDFileRecord, Int32) |
Write one record to the SDF file
| |
| WriteOne(MolBase, DictionaryString, Object, Int32) |
Write one record to the SDF file
(Overrides MDLDBBaseWriteOne(MolBase, DictionaryString, Object, Int32).) |
| Name | Description | |
|---|---|---|
| mLastError | (Inherited from MDLDBBase.) | |
| recordsAlreadyRead | (Inherited from MDLDBBase.) |
SDFile sdf = new SDFile(@"c:\temp\example.sdf", OpenMode.Read); MolBase m; while ((m = sdf.ReadNext()) != null) { Molecule mol = m as Molecule; // ... }
SDFile sdf = new SDFile(@"c:\temp\output.sdf", OpenMode.Write); Molecule m = Molecule.ReadSMILES("c1ccccc1"); Dictionary<string, object> props = new Dictionary<string, object>(); props.Add("Name", "benzene"); props.Add("Owner", "MolEngine"); props.Add("Use", "Example"); sdf.WriteOne(m, props, 1);