IFileObject interface | QSYS API Reference Guide
Estimated reading time: 8 minutes
Defines the contract for managing a file in the ASNA DataGate client.
Namespace: ASNA.DataGate.Client
Assembly: ASNA.QSys.DataGate.Client.dll
Extends: IAdgObject, IComparable, IConnectionHandler, IDisposable
In DG implementations of IFileObject , instance members are not guaranteed to be thread safe.
This interface provides properties and methods to manage a file in the ASNA DataGate client.
It includes properties to get the number of members in the file, the members of the file,
the XML documents that define the file and its creation attributes,
and various other properties related to the file. It also provides methods to copy the file,
copy data from the file to a new file or from an import file to the file,
read and write the definition and creation attributes of the file,
get the AdgDataSet of the file, inspect the file, and repair the file.
Properties
| Type |
Name |
Description |
| XmlDocument |
CreationAttributes |
Gets or sets the XML document that defines the creation attributes of the file. |
| XmlDocument |
Definition |
Gets or sets the XML document that defines the file. |
| Int32 |
FileWaitTime |
Gets the file wait time in milliseconds. |
| IReadOnlyDictionary<String, String> |
FormatIdentifiers |
Provides access to the file’s format names and format identifiers. |
| Hashtable |
FormatIDs |
Gets the format IDs of the file. This property is obsolete, use ‘FormatIdentifiers’ instead. |
| Boolean |
HasKeys |
Gets a value indicating whether the file has keys. |
| Int32 |
MemberCount |
Gets the number of members in the file. |
| IEnumerable<IMember> |
MemberObjects |
Gets the members of the file. |
| XmlDocument |
PrintCreationAttributes |
Gets or sets the XML document that defines the print creation attributes of the file. |
| Int32 |
RecordLength |
Gets the length of a record in the file. |
| Int32 |
RecordWaitTime |
Gets the record wait time in milliseconds. |
| IEnumerable<String> |
ReferencedFields |
Gets the fields referenced by the file. |
| String |
ReferenceFieldsFilePath |
Gets the file path of the referenced fields. |
| Boolean |
ReuseDeleted |
Gets a value indicating whether deleted records should be reused. |
| ShareTypes |
ShareType |
Gets the share type of the file. |
Methods
| Signature |
Description |
| AsyncCopyFromImportFile(String, CopyFromImportFileOptions) |
Asynchronously copies data from an import file to the file. |
| Copy(String, String) |
Copies the file to a new location with a new name. |
| CopyData(String, String, String, String, CopyDataOptions, Int32, Int32, Int32) |
Copies data from the file to a new file. If this object does not represent a physical file, returns null. |
| CopyFromImportFile(String, CopyFromImportFileOptions) |
Copies data from an import file to the file. |
| GetAdgDataSet(DataSetOptions) |
Gets the AdgDataSet of the file. |
| InspectFile(InspectFileParts, InspectFileOutput, Int32&, AdgObserver) |
Inspects the file. |
| ReadCreationAttributes(XmlReader) |
Reads the creation attributes of the file from an XML reader. |
| ReadDefinition(XmlReader) |
Reads the definition of the file from an XML reader. |
| RepairFile(RepairOptions, AdgObserver) |
Repairs the file. |
| WriteCreationAttributes(XmlWriter) |
Writes the creation attributes of the file to an XML writer. |
| WriteDefinition(XmlWriter) |
Writes the definition of the file to an XML writer. |
Asynchronously copies data from an import file to the file.
IFileObject AsyncCopyFromImportFile(string filePath, CopyFromImportFileOptions options)
Parameters
Returns
| Type |
Description |
| IFileObject |
The file with the copied data. |
Copies the file to a new location with a new name.
IFileObject Copy(string targetDir, string newName)
Parameters
| Type |
Parameter name |
Description |
| String |
targetDir |
The target directory to copy the file to. |
| String |
newName |
The new name of the file. |
Returns
Copies data from the file to a new file. If this object does not represent a physical file, returns null.
IFileObject CopyData(string targetDir, string newName, string srcMember, string newMember, CopyDataOptions options, int fromRRN, int toRRN, int cRecords)
Parameters
| Type |
Parameter name |
Description |
| String |
targetDir |
The target directory to copy the data to. |
| String |
newName |
The name of the new file. |
| String |
srcMember |
The source member to copy from. |
| String |
newMember |
The new member to copy to. |
| CopyDataOptions |
options |
The options to use when copying the data. |
| Int32 |
fromRRN |
The relative record number to start copying from. |
| Int32 |
toRRN |
The relative record number to stop copying at. |
| Int32 |
cRecords |
The number of records to copy. |
Returns
| Type |
Description |
| IFileObject |
The new file with the copied data, or null if this object does not represent a physical file. |
Copies data from an import file to the file.
IFileObject CopyFromImportFile(string filePath, CopyFromImportFileOptions options)
Parameters
Returns
| Type |
Description |
| IFileObject |
The file with the copied data. |
Gets the AdgDataSet of the file.
AdgDataSet GetAdgDataSet(DataSetOptions opts)
Parameters
| Type |
Parameter name |
Description |
| DataSetOptions |
opts |
The options to use when getting the AdgDataSet. |
Returns
| Type |
Description |
| AdgDataSet |
The AdgDataSet of the file. |
Inspects the file.
void InspectFile(InspectFileParts parts, InspectFileOutput output, Int32& ErrorCount, AdgObserver observer)
Parameters
| Type |
Parameter name |
Description |
| InspectFileParts |
parts |
The parts of the file to inspect. |
| InspectFileOutput |
output |
The output of the inspection. |
| Int32& |
ErrorCount |
The number of errors found during the inspection. |
| AdgObserver |
observer |
The observer to use during the inspection. |
Reads the creation attributes of the file from an XML reader.
void ReadCreationAttributes(XmlReader reader)
Parameters
| Type |
Parameter name |
Description |
| XmlReader |
reader |
The XML reader to read from. |
Reads the definition of the file from an XML reader.
void ReadDefinition(XmlReader reader)
Parameters
| Type |
Parameter name |
Description |
| XmlReader |
reader |
The XML reader to read from. |
Repairs the file.
void RepairFile(RepairOptions repairOptions, AdgObserver observer)
Parameters
| Type |
Parameter name |
Description |
| RepairOptions |
repairOptions |
The options to use when repairing the file. |
| AdgObserver |
observer |
The observer to use during the repair. |
Writes the creation attributes of the file to an XML writer.
void WriteCreationAttributes(XmlWriter writer)
Parameters
| Type |
Parameter name |
Description |
| XmlWriter |
writer |
The XML writer to write to. |
Writes the definition of the file to an XML writer.
void WriteDefinition(XmlWriter writer)
Parameters
| Type |
Parameter name |
Description |
| XmlWriter |
writer |
The XML writer to write to. |