MDF Lib 2.2
Interface against MDF 3/4 files
|
Implements an user interface against a MDF file. More...
#include <mdf/mdffile.h>
Public Member Functions | |
virtual | ~MdfFile ()=default |
Default destructor. | |
virtual void | Attachments (AttachmentList &dest) const =0 |
Fetch a list of attachments. | |
virtual void | DataGroups (DataGroupList &dest) const =0 |
Fetch a list of all measurements. | |
virtual std::string | Version () const =0 |
Returns the file version. | |
int | MainVersion () const |
Returns the main version of the file. | |
virtual void | MinorVersion (int minor)=0 |
Sets the minor version of the file. | |
int | MinorVersion () const |
Returns the minor version number of the MDF file. | |
virtual void | ProgramId (const std::string &program_id)=0 |
Sets the program identifier int the ID block. | |
virtual std::string | ProgramId () const =0 |
Returns the program identifier. | |
virtual IHeader * | Header () const =0 |
Returns the header object. | |
virtual IAttachment * | CreateAttachment () |
Creates a new attachment (AT block). | |
virtual IDataGroup * | CreateDataGroup ()=0 |
Creates a new measurement (DG block). | |
virtual bool | IsMdf4 () const =0 |
Returns true if this is a MDF4 file. | |
virtual void | ReadHeader (std::FILE *file)=0 |
Reads the information about the file. | |
virtual void | ReadMeasurementInfo (std::FILE *file)=0 |
Reads the measurement information about the file. | |
virtual void | ReadEverythingButData (std::FILE *file)=0 |
Reads in all expect raw data from the file. | |
virtual bool | Write (std::FILE *file)=0 |
Saves all blocks onto the file. | |
const std::string & | Name () const |
Display name of the file. | |
void | Name (const std::string &name) |
Set the display name of the file. | |
const std::string & | FileName () const |
Returns the full name of the file. | |
void | FileName (const std::string &filename) |
Sets the file name. | |
virtual void | IsFinalized (bool finalized, std::FILE *file, uint16_t standard_flags, uint16_t custom_flags)=0 |
Sets the finalize state for the file. | |
virtual bool | IsFinalized (uint16_t &standard_flags, uint16_t &custom_flags) const =0 |
Returns true if the file is finalized. | |
virtual bool | IsFinalizedDone () const |
virtual IDataGroup * | FindParentDataGroup (const IChannel &channel) const =0 |
Returns a parent data group (DG) depending a channel. | |
Protected Member Functions | |
MdfFile ()=default | |
Default constructor. | |
Implements an interface against a MDF file object. Note that the object holds the file contents.
|
pure virtual |
Fetches a list of file attachments. An attachment is a reference to an external or an embedded file. Note that MDF3 doesn't support attachments.
dest | Destination list of attachments. |
|
nodiscardvirtual |
Creates a new attachment to the file also known as a AT block. An attachemnt is either a reference to an external file or an embedded file block).
Note that MDF3 doesn't support attachments.
|
nodiscardpure virtual |
Creates a new measurement block in the file also known as a DG block. A DG block defines one measurement with one or more sub-measurements (CG block). The new DG block is always put last in the file.
|
pure virtual |
Fetches a list aof all measurements (DG blocks) in the file.
dest | Destination list of all measurements. |
|
inlinenodiscard |
Returns the file name with path and extension.
void mdf::MdfFile::FileName | ( | const std::string & | filename | ) |
Sets the file name and the short name of the object.
filename | File name with path and extension. |
|
nodiscardpure virtual |
Returns the header object. This object hold general information about the file and its contents. The header is the root of most information in the file.
|
nodiscardvirtual |
Returns true if the finalize was done.
The function may be used to check on not finalized file to verify that the file have been finalized.
|
nodiscardpure virtual |
Returns true if this is an MDF4 version fo the file.
|
nodiscard |
Returns the main version (4.10 -> 4) of the file.
|
nodiscard |
Returns the minor version of the MDF file. Note that it will return 1 for version 4.1 and 11 for version 4.11.
|
pure virtual |
Sets the minor version of the file. This function is typical used when saving a MDF file.
minor | Minor version of the file. |
|
inlinenodiscard |
Default set to the stem of the file. Not stored in the file itself. Only used for display purpose.
|
inline |
Sets the display name of the file. By default this is set to the file name without path and extension (stem).
name | Short name of the file. |
|
nodiscardpure virtual |
Returns the program identifier i.e. software who created the file.
|
pure virtual |
Sets the program identifier in the MDF file (ID block). Note that only 8 characters are stored.
program_id | Program identifier. |
|
pure virtual |
Reads all information about the file but not raw data as sample data or embedded attachment data.
There is no need to call the ReadHeader or ReadMeasurement functions before this function.
file | Pointer to an opened file. |
|
pure virtual |
Reads information about the file i.e. the ID and HD block. It doesn't read in any other information as measurement information.
file | Pointer to an opened file. |
|
pure virtual |
Reads information about the measurements (DG) and sub-measurements (CG) in the file. It doesn't read any information about the channels.
There is no need to call the ReadHeader function before this function.
file | Pointer to an opened file. |
|
nodiscardpure virtual |
Returns the MDF file version.
|
pure virtual |
Saves all blocks onto the file. You may call this function many times as it keep track of which blocks has been saved or not. You may close and open the file in between calls but this object keeps track of which block has been written or not, so don't delete this object.
file | Pointer to an open file. |