Chemical Data Processing Library Python API - Version 1.1.1
|
Provides meta-information about a particular data storage format. More...
Classes | |
class | FileExtensionSequence |
Public Member Functions | |
None | __init__ () |
Default constructor. More... | |
None | __init__ (DataFormat fmt) |
Initializes a copy of the DataFormat instance fmt. More... | |
None | __init__ (str name, str descr, str mime_type, bool multi_rec) |
Initializes the DataFormat instance. More... | |
None | __init__ (str name, str descr, str mime_type, object file_exts, bool multi_rec) |
Initializes the DataFormat instance. More... | |
int | getNumFileExtensions () |
Returns the number of registered file extensions. More... | |
str | getFileExtension (int idx) |
Returns the file extension list entry at index idx. More... | |
DataFormat | addFileExtension (str file_ext) |
Adds file_ext to the current list of file extensions. More... | |
None | setFileExtension (int idx, str file_ext) |
Sets the file extension list entry at index idx to file_ext. More... | |
None | clearFileExtensions () |
Clears the file extension list. | |
None | removeFileExtension (int idx) |
Removes the file extension list entry at index idx. More... | |
bool | matchesName (str name) |
Tells whether the name of this data format matches the name specified by name. More... | |
bool | matchesMimeType (str mime_type) |
Tells whether the mime-type of this data format matches the mime-type specified by mime_type. More... | |
bool | matchesFileExtension (str file_ext) |
Tells whether file_ext is contained in the list of file extensions. More... | |
str | getDescription () |
Returns the description of the data format. More... | |
None | setDescription (str descr) |
Sets the description of the data format. More... | |
str | getName () |
Returns the short-name of the data format. More... | |
None | setName (str name) |
Sets the short-name of the data format. More... | |
str | getMimeType () |
Returns the mime-type of the data format. More... | |
None | setMimeType (str mime_type) |
Sets the mime-type of the data format. More... | |
bool | isMultiRecordFormat () |
Tells whether or not the data format supports the storage of multiple data records. More... | |
None | setMultiRecordFormat (bool multi_rec) |
Specifies whether or not the data format supports the storage of multiple data records. More... | |
FileExtensionSequence | getFileExtensions () |
DataFormat | assign (DataFormat fmt) |
Replaces the current state of self with a copy of the state of the DataFormat instance fmt. More... | |
int | getObjectID () |
Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
str | __str__ () |
Returns a string representation of the DataFormat instance. More... | |
bool | __ne__ (DataFormat fmt) |
Inequality comparison operator. More... | |
bool | __eq__ (DataFormat fmt) |
Equality comparison operator. More... | |
Properties | |
objectID = property(getObjectID) | |
numFileExtensions = property(getNumFileExtensions) | |
description = property(getDescription, setDescription) | |
name = property(getName, setName) | |
mimeType = property(getMimeType, setMimeType) | |
multiRecordFormat = property(isMultiRecordFormat, setMultiRecordFormat) | |
fileExtensions = property(getFileExtensions) | |
Provides meta-information about a particular data storage format.
None CDPL.Base.DataFormat.__init__ | ( | ) |
Default constructor.
All string attributes are initialized to an empty string, and the multi record format flag is set to False
.
None CDPL.Base.DataFormat.__init__ | ( | DataFormat | fmt | ) |
Initializes a copy of the DataFormat instance fmt.
fmt | The DataFormat instance to copy. |
None CDPL.Base.DataFormat.__init__ | ( | str | name, |
str | descr, | ||
str | mime_type, | ||
bool | multi_rec | ||
) |
Initializes the DataFormat instance.
name | |
descr | |
mime_type | |
multi_rec |
None CDPL.Base.DataFormat.__init__ | ( | str | name, |
str | descr, | ||
str | mime_type, | ||
object | file_exts, | ||
bool | multi_rec | ||
) |
Initializes the DataFormat instance.
name | |
descr | |
mime_type | |
file_exts | |
multi_rec |
int CDPL.Base.DataFormat.getNumFileExtensions | ( | ) |
Returns the number of registered file extensions.
str CDPL.Base.DataFormat.getFileExtension | ( | int | idx | ) |
Returns the file extension list entry at index idx.
idx | The zero-based index of the requested file extension list entry. |
Base.IndexError | if idx is out of bounds. |
DataFormat CDPL.Base.DataFormat.addFileExtension | ( | str | file_ext | ) |
Adds file_ext to the current list of file extensions.
file_ext | The file extension to add. |
None CDPL.Base.DataFormat.setFileExtension | ( | int | idx, |
str | file_ext | ||
) |
Sets the file extension list entry at index idx to file_ext.
idx | The zero-based index of the file extension list entry to set. |
file_ext | The new file extension list entry. |
Base.IndexError | if idx is out of bounds. |
None CDPL.Base.DataFormat.removeFileExtension | ( | int | idx | ) |
Removes the file extension list entry at index idx.
idx | The zero-based index of the file extension list entry to remove. |
Base.IndexError | if idx is out of bounds. |
bool CDPL.Base.DataFormat.matchesName | ( | str | name | ) |
Tells whether the name of this data format matches the name specified by name.
name | The name to match. |
True
if the name of the data format matches the argument, and False
otherwise.bool CDPL.Base.DataFormat.matchesMimeType | ( | str | mime_type | ) |
Tells whether the mime-type of this data format matches the mime-type specified by mime_type.
mime_type | The mime-type to match. |
True
if the mime-type of the data format matches the argument, and False
otherwise.bool CDPL.Base.DataFormat.matchesFileExtension | ( | str | file_ext | ) |
Tells whether file_ext is contained in the list of file extensions.
file_ext | The file extension to search for. |
True
if file_ext is contained in the list of file extensions, and False
otherwise.str CDPL.Base.DataFormat.getDescription | ( | ) |
Returns the description of the data format.
None CDPL.Base.DataFormat.setDescription | ( | str | descr | ) |
Sets the description of the data format.
descr | The data format description. |
str CDPL.Base.DataFormat.getName | ( | ) |
Returns the short-name of the data format.
None CDPL.Base.DataFormat.setName | ( | str | name | ) |
Sets the short-name of the data format.
name | The short-name of the data format. |
str CDPL.Base.DataFormat.getMimeType | ( | ) |
Returns the mime-type of the data format.
None CDPL.Base.DataFormat.setMimeType | ( | str | mime_type | ) |
Sets the mime-type of the data format.
mime_type | The mime-type of the data format. |
bool CDPL.Base.DataFormat.isMultiRecordFormat | ( | ) |
Tells whether or not the data format supports the storage of multiple data records.
True
if the data format supports the storage of multiple data records, and False
otherwise. None CDPL.Base.DataFormat.setMultiRecordFormat | ( | bool | multi_rec | ) |
Specifies whether or not the data format supports the storage of multiple data records.
multi_rec | True if the data format supports the storage of multiple data records, and False otherwise. |
FileExtensionSequence CDPL.Base.DataFormat.getFileExtensions | ( | ) |
DataFormat CDPL.Base.DataFormat.assign | ( | DataFormat | fmt | ) |
Replaces the current state of self with a copy of the state of the DataFormat instance fmt.
fmt | The DataFormat instance to copy. |
int CDPL.Base.DataFormat.getObjectID | ( | ) |
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python DataFormat instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b
thus cannot tell reliably whether the two DataFormat instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID()
.
str CDPL.Base.DataFormat.__str__ | ( | ) |
Returns a string representation of the DataFormat instance.
bool CDPL.Base.DataFormat.__ne__ | ( | DataFormat | fmt | ) |
Inequality comparison operator.
The result is equivalent to !(self == fmt)
.
fmt | The other DataFormat object to be compared with. |
True
if the names and/or mime-types compare non-equal (case-insensitive!), and False
otherwise.bool CDPL.Base.DataFormat.__eq__ | ( | DataFormat | fmt | ) |
Equality comparison operator.
fmt | The other DataFormat object to be compared with. |
True
if the names and mime-types compare equal (case-insensitive!), and False
otherwise.