IDfs2File Methods |
The IDfs2File type exposes the following members.
Name | Description | |
---|---|---|
![]() | Close |
Close the file and release all ressources associated with it. The header information
is still valid (for reading) even though the file has been closed.
(Inherited from IDfsFileIO.) |
![]() | Dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable.) |
![]() | FindItem |
Positions the file pointer at the location in the file where the
specified dynamic item at the specified time step starts.
(Inherited from IDfsFileIO.) |
![]() | FindTimeStep |
Positions the file pointer at the location in the file where the
specified time step starts.
(Inherited from IDfsFileIO.) |
![]() | Flush |
Flush cached data to the file. This will especially update the header information,
such that if another process is reading the file while it is being read, the new
header information can be retrieved.
(Inherited from IDfsFileIO.) |
![]() | FlushTimeStep |
Flush cached data to the file. This will update the time part of the header information,
but not other parts of the header.
(Inherited from IDfsFileIO.)Compared to the Flush method; the Flush will update statistics of all items (if enabled) and all modifications to the header data. This method will only update the time part. The Flush method can be an expensive operations especially for files with many dynamic items. This method is independent of the file at hand. |
![]() | ReadItemTimeStep(Int32, Int32) |
For details, see ReadItemTimeStep(Int32, Int32).
This version returns a IDfsItemData2D.
|
![]() | ReadItemTimeStep(IDfsItemData, Int32) |
Read the specified item and time step. With this you can reuse
the data buffer in IDfsItemData, Data.
The data is updated in place.
(Inherited from IDfsFileIO.)If the data from one timestep is to be saved for later, the user is responsible to copy the data before using this method again. |
![]() | ReadItemTimeStep(IDfsItemData2D, Int32) |
For details, see ReadItemTimeStep(IDfsItemData, Int32).
This version works on a IDfsItemData2D.
|
![]() | ReadItemTimeStepNext |
For details, see ReadItemTimeStepNext.
This version returns a IDfsItemData2D.
|
![]() | ReadStaticItem |
Read the number staticItemNo static item from the file.
(Inherited from IDfsFileStaticIO.) |
![]() | ReadStaticItemNext |
Reads the next static item. First time called it returns the first
static item.
If ReadStaticItem(Int32) is called for example with argument
staticItemNo 3, the next call to this method will return static item number 4.
If one of the methods reading/writing dynamic item data is called, see
IDfsFileIO, the static item number is reset, and
the next call to this method again returns the first item number.
(Inherited from IDfsFileStaticIO.) |
![]() | Reset |
Resets the file pointer to point on the first dynamic item time step in the file.
(Inherited from IDfsFileIO.)Can also be used if it is required to restart reading the static items. |
![]() | WriteItemTimeStep |
Writes data to the specified item and timestep in the file.
(Inherited from IDfsFileIO.)If the item-timestep exists already, data is updated. If it does not exist, the item number and timestep index must match exactly the next item-timestep after the last one in the file. The size of the data must match the data size of the item that is to be written. The time value is only relevant for files with non-equidistant time axis. For files with an equidistant time axis, the time value is ignored, and a zero can be used. |
![]() | WriteItemTimeStepNext | Writes the next dynamic item-timestep. If the file pointer points to the end of the file, this will append a new item-timestep to the file. If the file pointer points to an existing item-timestep, the data of that item-timestep is updated. Remember that the file pointer position depends on the mode that the file was opened: In edit mode the file pointer points at the first item-timestep. In append mode the file pointer points initially at the end of file. It iterates over the item-timesteps as the ReadItemTimeStepNext, see there for more details. This is the most efficient way to iterate through and update/append the items and timesteps in a file, since it iterates exactly as the data is stored on the disk. The size of the data must match the data size of the item that is to be written. The time value is only relevant for files with non-equidistant time axis. For files with an equidistant time axis, the time value is ignored, and a zero can be used. |
![]() | WriteStaticItemData |
Write the static item back to the file. the staticItem must
originate from this file. This will update and overwrite the static item information and
the data of the static item.
(Inherited from IDfsFileStaticIO.) |
Name | Description | |
---|---|---|
![]() | CreateEmptyItemData(Int32) | Overloaded.
Create an IDfsItemData2DT of the correct type for the
item with the given itemNumber.
(Defined by Dfs2Util.) |
![]() | CreateEmptyItemDataT(Int32) | Overloaded.
Create an IDfsItemData2DT of the correct type for the
item with the given itemNumber.
(Defined by Dfs2Util.) |
![]() | LandValue |
Extract land-value from a HPQ dfs2 file.
(Defined by Dfs2Util.)Value is extracted from the 3rd position of the "M21_Misc" custom block. If the "M21_Misc" custom block is not found, an exception is thrown. |