Click or drag to resize
PFSDllWrapper Class
Wrapper class for pfs2004.dll.

When possible, use instead the PFSFile, since it adds error checking and exceptions to the file handling.

Inheritance Hierarchy
SystemObject
  DHI.PFSPFSDllWrapper

Namespace: DHI.PFS
Assembly: DHI.PFS (in DHI.PFS.dll) Version: 16.0.0.0 (11.1.1.1111)
Syntax
public static class PFSDllWrapper

The PFSDllWrapper type exposes the following members.

Methods
  NameDescription
Public methodStatic memberpfsAddBool
Write a Boolean value The Boolean value is written true or false. Restrictions: The function is only valid within the scope of a keyword.
Public methodStatic memberpfsAddBoolDef
Request the presence of a Boolean value. Restrictions: The function is only valid within the scope of a keyword
Public methodStatic memberpfsAddBoolDefS
Public methodStatic memberpfsAddBoolRef
Save the address of a Boolean variable to be written. Restrictions: The function is only valid within the scope of a keyword. The value written is the contents of the associated variable when pfsWrite is called.
Public methodStatic memberpfsAddBoolRefS
Public methodStatic memberpfsAddBoolS
Write a Boolean value to keyword

Silent version that throws exception on failure

Restrictions: The function is only valid within the scope of a keyword.

Public methodStatic memberpfsAddClob
Add a CLOB param to current keyword.

Restrictions: The function is only valid within the scope of a keyword.

Public methodStatic memberpfsAddClobBool
Write a Boolean to current CLOB.

Restrictions: The function is only valid within the scope of a Clob.

Public methodStatic memberpfsAddClobBoolS
Write a Boolean to current CLOB.

Silent version that throws exception on failure

Restrictions: The function is only valid within the scope of a Clob.

Public methodStatic memberpfsAddClobDouble
Write a Double to current CLOB

Restrictions: The function is only valid within the scope of a Clob.

Public methodStatic memberpfsAddClobDoubleS
Write a Double to current CLOB

Silent version that throws exception on failure

Restrictions: The function is only valid within the scope of a Clob.

Public methodStatic memberpfsAddClobFilename
Write a Filename to current CLOB

Restrictions: The function is only valid within the scope of a Clob.

Public methodStatic memberpfsAddClobFilenameS
Write a Filename to current CLOB

Silent version that throws exception on failure

Restrictions: The function is only valid within the scope of a Clob.

Public methodStatic memberpfsAddClobFloat
Write a Float to current CLOB

Restrictions: The function is only valid within the scope of a Clob.

Public methodStatic memberpfsAddClobFloatS
Write a Float to current CLOB

Silent version that throws exception on failure

Restrictions: The function is only valid within the scope of a Clob.

Public methodStatic memberpfsAddClobInt
Write a Integer to current CLOB

Restrictions: The function is only valid within the scope of a Clob.

Public methodStatic memberpfsAddClobIntS
Write a Integer to current CLOB

Silent version that throws exception on failure

Restrictions: The function is only valid within the scope of a Clob.

Public methodStatic memberpfsAddClobS
Add a CLOB param to current keyword.

Silent version that throws exception on failure

Restrictions: The function is only valid within the scope of a keyword.

Public methodStatic memberpfsAddClobString
Write a String to current CLOB

Restrictions: The function is only valid within the scope of a Clob.

Public methodStatic memberpfsAddClobStringS
Write a String to current CLOB

Silent version that throws exception on failure

Restrictions: The function is only valid within the scope of a Clob.

Public methodStatic memberpfsAddDateDef
Add date definition
Public methodStatic memberpfsAddDateDefS
Public methodStatic memberpfsAddDouble
Purpose Write a double precision floating-point (real) value. The output format is some 'default' format. Check if it may cause loss of precision. Restrictions: The function is only valid within the scope of a keyword.
Public methodStatic memberpfsAddDoubleDef
Request the presence of a double precision floating-point (real) value Restrictions: The function is only valid within the scope of a keyword
Public methodStatic memberpfsAddDoubleDefS
Public methodStatic memberpfsAddDoubleRef
Save the address of a double precision floating-point (real) variable to be written. Restrictions: The function is only valid within the scope of a keyword. The value written is the contents of the associated variable when pfsWrite is called.
Public methodStatic memberpfsAddDoubleRefS
Public methodStatic memberpfsAddDoubleS
Purpose Write a double precision floating-point (real) value.

The output format is some 'default' format. Check if it may cause loss of precision.

Silent version that throws exception on failure

Restrictions: The function is only valid within the scope of a keyword.

Public methodStatic memberpfsAddFilename
Write a null-termindated character string to keyword

Restrictions: The function is only valid within the scope of a keyword. In a Pascal program, the use of null-terminated strings must be enforced using a compiler option.

Public methodStatic memberpfsAddFilenameDef
Request the presence of a character string value. Restrictions: The function is only valid within the scope of a keyword.
Public methodStatic memberpfsAddFilenameDefS
Public methodStatic memberpfsAddFilenameS
Write a null-termindated character string to keyword

Silent version that throws exception on failure

Restrictions: The function is only valid within the scope of a keyword. In a Pascal program, the use of null-terminated strings must be enforced using a compiler option.

Public methodStatic memberpfsAddFloat
Write a single precision floating-point (real) value. The output format is some 'default' format. Check if it may cause loss of precision. Restrictions: The function is only valid within the scope of a keyword.
Public methodStatic memberpfsAddFloatDef
Request the presence of a single precision floating-point (real) value. Restrictions: The function is only valid within the scope of a keyword.
Public methodStatic memberpfsAddFloatDefS
Public methodStatic memberpfsAddFloatRef
Save the address of a single precision floating-point (real) variable to be written. Restrictions: The function is only valid within the scope of a keyword. The value written is the contents of the associated variable when pfsWrite is called.
Public methodStatic memberpfsAddFloatRefS
Public methodStatic memberpfsAddFloatS
Write a single precision floating-point (real) value. The output format is some 'default' format. Check if it may cause loss of precision.

Silent version that throws exception on failure

Restrictions: The function is only valid within the scope of a keyword.

Public methodStatic memberpfsAddInt
Write a four-byte signed integer. Restrictions: The function is only valid within the scope of a keyword
Public methodStatic memberpfsAddIntDef
Request the presence of a four-byte signed integer value. Restrictions The function is only valid within the scope of a keyword.
Public methodStatic memberpfsAddIntDefS
Public methodStatic memberpfsAddIntRef
Save the address of a four-byte signed integer variable to be written. Restrictions: The function is only valid within the scope of a keyword. The value written is the contents of the associated variable when pfsWrite is called.
Public methodStatic memberpfsAddIntRefS
Public methodStatic memberpfsAddIntS
Write a four-byte signed integer.

Silent version that throws exception on failure

Restrictions: The function is only valid within the scope of a keyword.

Public methodStatic memberpfsAddKeyword(IntPtr, String)
Define a keyword, ie the start of a parameter list, within the scope of a target.
Public methodStatic memberpfsAddKeyword(IntPtr, String, Object)
Define a keyword, ie the start of a parameter list, within the scope of a target, and add a set of parameters to the keyword.

This is similar to calling first pfsAddKeyword(IntPtr, String) followed by pfsAddParams(IntPtr, Object)

Public methodStatic memberpfsAddKeywordDef
Define the start of a new keyword, ie the start of a parameter list, and its attributes within the scope of a target. This function is used to define the start of a list of parameters. It has no counterpart, ie the usage is different from that of pfsAddSectionDef, which requires a terminating pfsEndSection. Restrictions: This function must be called within the scope of a target.
Public methodStatic memberpfsAddKeywordDefS
Public methodStatic memberpfsAddKeywordFilename
Define a keyword, ie the start of a parameter list, within the scope of a target, and add a filename parameter.

This is similar to calling first pfsAddKeyword(IntPtr, String) followed by pfsAddFilename(IntPtr, String)

Public methodStatic memberpfsAddKeywordS
Define a keyword, ie the start of a parameter list, within the scope of a target.

Silent version that throws exception on failure

Public methodStatic memberpfsAddParams
Purpose a number of parameters to keyword.

Restrictions: The function is only valid within the scope of a keyword.

Public methodStatic memberpfsAddSection
Start a new section within the scope of a target.
Public methodStatic memberpfsAddSectionDef
Define the start of a new section and its attributes within the scope of a target. The section definition must be terminated by a pfsEndSection. Restrictions: The pfsAddSectionDef must be called within the scope of a target.
Public methodStatic memberpfsAddSectionDefS
Public methodStatic memberpfsAddSectionS
Start a new section within the scope of a target.

Silent version that throws exception on failure

Public methodStatic memberpfsAddString
Write a null-terminated character string. Restrictions: The function is only valid within the scope of a keyword. In a Pascal program, the use of null-terminated strings must be enforced using a compiler option.
Public methodStatic memberpfsAddStringDef
Request the presence of a character string value. Restrictions: The function is only valid within the scope of a keyword.
Public methodStatic memberpfsAddStringDefS
Public methodStatic memberpfsAddStringRef
Save the address of a null-terminated character string variable to be written. Restrictions: The function is only valid within the scope of a keyword. The value written is the contents of the associated variable when pfsWrite is called.
Public methodStatic memberpfsAddStringRefS
Public methodStatic memberpfsAddStringS
Write a null-terminated character string.

Silent version that throws exception on failure

Restrictions: The function is only valid within the scope of a keyword. In a Pascal program, the use of null-terminated strings must be enforced using a compiler option.

Public methodStatic memberpfsAddTarget
Add a new target (top-level section) to a parameter file object.
Public methodStatic memberpfsAddTargetS
Add a new target (top-level section) to a parameter file object.

Silent version that throws exception on failure

Public methodStatic memberpfsAddTimeDef
Add time definition
Public methodStatic memberpfsAddTimeDefS
Public methodStatic memberpfsAddUndefinedPar
Add a undefined param to current keyword.
Public methodStatic memberpfsAddUndefinedParS
Add a undefined param to current keyword.
Public methodStatic memberpfsAppend
Append the contents of a parameter file object to an existing parameter file using the parameter file syntax.
Public methodStatic memberpfsClobReset
Reset reading of parameters from Clob
Public methodStatic memberpfsClobResetS
Reset reading of parameters from Clob
Public methodStatic memberpfsClose
Terminate the access to a parameter file data structure and free the associated internal storage.
Public methodStatic memberpfsCopy
Copy a sub-tree of a parameter object to a node of a parameter object.
Public methodStatic memberpfsCreate
Create an empty parameter structure to be used for writing a parameter file, or for creating a parameter definition.
Public methodStatic memberpfsDump
Dump the contents of a parameter file object with detailed internal information into a text file.
Public methodStatic memberpfseInsertNewKeyword
Insert new keyword into PFS section, return handle to new section
Public methodStatic memberpfseInsertNewParameterBool
Insert new parameter into PFS keyword, return handle to new parameter
Public methodStatic memberpfseInsertNewParameterClob
Insert new parameter into PFS keyword, return handle to new parameter
Public methodStatic memberpfseInsertNewParameterDouble
Insert new parameter into PFS keyword, return handle to new parameter
Public methodStatic memberpfseInsertNewParameterFileName
Insert new parameter into PFS keyword, return handle to new parameter
Public methodStatic memberpfseInsertNewParameterInt
Insert new parameter into PFS keyword, return handle to new parameter
Public methodStatic memberpfseInsertNewParameterString
Insert new parameter into PFS keyword, return handle to new parameter
Public methodStatic memberpfseInsertNewParameterUndefined
Insert new parameter into PFS keyword, return handle to new parameter
Public methodStatic memberpfseInsertNewSection
Insert new section into PFS section, return handle to new section
Public methodStatic memberpfsEndSection
Terminate a target or a section.
Public methodStatic memberpfsEndSectionS
Terminate a target or a section.

Silent version that throws exception on failure

Public methodStatic memberpfsEquivalent
To indicate if the contents of two parameter objects are equivalent.
Public methodStatic memberpfsEquivalentExt
To indicate if the contents of two parameter objects are equivalent.
Public methodStatic memberpfsErrorCodeToErrorMessage
Return a textual error message for a given PFSErrorCode reference to an alternative and newer method "pfsGetErrorMessageFromErrorCode"
Public methodStatic memberpfsExplore
To provide an alternative to the lookup read interface. pfsExplore guides the application programmer through a PFS data structure and calls a user-defined function for each pfsNode encountered. The pfsNode is passed to the user-defined function for processing in the application context. With this approach, the application programmer needs not care about how to traverse the PFS data structure - this is done by pfsExplore - but instead pay attention to the position of the actual pfsNode in the structure.
Public methodStatic memberpfsFindDefault
Return a reference to a non-default parameter node with a default value for the default parameter node which is passed as argument.
Public methodStatic memberpfsFindSectionByHandle
Returns the section specified in the sectionPath parameter
Public methodStatic memberpfsGetAnchorFilename
Get the anchor filename from node
Public methodStatic memberpfsGetBool
Return the Boolean value from the pfsNode (parameter) passed as argument.
Public methodStatic memberpfsGetClobBool
Extract a Boolean from current CLOB
Public methodStatic memberpfsGetClobBoolS
Extract a Boolean from current CLOB
Public methodStatic memberpfsGetClobDouble
Extract a Double from current CLOB
Public methodStatic memberpfsGetClobDoubleS
Extract a Double from current CLOB
Public methodStatic memberpfsGetClobFilename
Extract a Filename from current CLOB
Public methodStatic memberpfsGetClobFilenameS
Extract a Filename from current CLOB
Public methodStatic memberpfsGetClobFloat
Extract a Float from current CLOB
Public methodStatic memberpfsGetClobFloatS
Extract a Float from current CLOB
Public methodStatic memberpfsGetClobInt
Extract a Integer from current CLOB
Public methodStatic memberpfsGetClobIntS
Extract an integer from current CLOB
Public methodStatic memberpfsGetClobItem
Get the next Clob parameter as a PFSParameter handle, where you can query it for the type of parameter data.
Public methodStatic memberpfsGetClobItemS
Get the next Clob parameter as a PFSParameter handle, where you can query it for the type of parameter data.
Public methodStatic memberpfsGetClobString
Extract a String from current CLOB
Public methodStatic memberpfsGetClobStringS
Extract a String from current CLOB
Public methodStatic memberpfsGetCustomResultFolder
Returns the custom result folder.
Public methodStatic memberpfsGetDLLid
Return a text string containing the path of the DLL containing the current software version.
Public methodStatic memberpfsGetDouble
Return the double (8-byte double precision floating point) value from the pfsNode (parameter) passed as argument.
Public methodStatic memberpfsGetErrorFromPfsClob
Extract error string
Public methodStatic memberpfsGetErrorFromPfsData
Extract error string
Public methodStatic memberpfsGetErrorGlb
Extract and reset the global error code
Public methodStatic memberpfsGetErrorMessageFromErrorCode
this method is similar with method pfsErrorCodeToErrorMessage but this method is call the interpreter from pfs2004 dll and this method support more error code
Public methodStatic memberpfsGetFilename
Get the filename from the node
Public methodStatic memberpfsGetFilenameString
Get the filename from the node
Public methodStatic memberpfsGetFloat
Return the float (4-byte single precision floating point) value from the pfsNode (parameter) passed as argument.
Public methodStatic memberpfsGetInstanceNo
Return the instance number of the node (target/section or keyword) passed as argument.
Public methodStatic memberpfsGetInt
Return the integer value from the pfsNode (parameter) passed as argument.
Public methodStatic memberpfsGetKeywordFilename
Return the value as a filename of the n'th parameter of the m'th instance of a specific keyword name of the pfsNode (target/section), or defVal if keyword or parameter was not found.
Public methodStatic memberpfsGetKeywordParamT
Return the value of the n'th parameter of the m'th instance of a specific keyword name of the pfsNode (target/section), or defVal if keyword or parameter was not found.
Public methodStatic memberpfsGetLevel
Return the level in the parameter structure of the pfsNode passed as argument.
Public methodStatic memberpfsGetName
Return the name of the pfsNode (target/section or keyword) passed as argument.
Public methodStatic memberpfsGetNameGlb
Return the global name of the pfsNode (target/section or keyword) passed as argument.
Public methodStatic memberpfsGetNoInstances
Return the number of instances of the pfsNode (target/section or keyword) passed as argument.
Public methodStatic memberpfsGetNoKeywords
Return the number of keywords connected to the pfsNode passed as argument
Public methodStatic memberpfsGetNoNodes
Get number of nodes
Public methodStatic memberpfsGetNoParams
Return the number of parameters connected to the pfsNode passed as argument.
Public methodStatic memberCode examplepfsGetNoSections
Return the number of sections connected to the pfsNode passed as argument.
Public methodStatic memberpfsGetNoTargets
Return the number of targets present in a parameter file.
Public methodStatic memberpfsGetParamT
Return the value from the pfsNode (parameter) passed as argument, as the type entered by defVal . If the pfsNode (parameter) is undefined (Zero then the default value defVal is returned.

This is a generically typed version of the

pfsGet...()
calls.

Return the value of the current parameter, or defVal if pfsParam is a null-pointer.
Public methodStatic memberpfsGetProjectResultRoot
Get the project result root folder
Public methodStatic memberpfsGetResultFilename
Get the filename from the node
Public methodStatic memberpfsGetResultFilenamePath
Return the result folder path for the pfs file. The node can be any PFS node in the pfs tree.
Public methodStatic memberpfsGetResultFolderPath
Return the result folder path for the pfs file. The node can be any PFS node in the pfs tree.
Public methodStatic memberpfsGetRoot
Get root of PFS tree
Public methodStatic memberpfsGetString
Return a string value of the pfsNode (parameter) passed as argument.
Public methodStatic memberpfsGetSyntaxClass
Return the syntax class of the node which is passed as argument.
Public methodStatic memberpfsGetSyntaxErr
Return the position in the input file where a parameter file syntax error was detected with an associated error message.
Public methodStatic memberpfsGetVersion
Return a text string containing the date and time when the current software version was built.
Public methodStatic memberpfsInsert
Insert parameter object into a src
Public methodStatic memberpfsIsBool
Indicates if the pfsNode passed as argument refers to a string value.
Public methodStatic memberpfsIsClob
Tell if a Node is a CLOB
Public methodStatic memberpfsIsClobEnd
Returns true of the Clob has no more parameters
Public methodStatic memberpfsIsClobEndS
Returns true of the Clob has no more parameters
Public methodStatic memberpfsIsDefaultPar
Indicates if the pfsNode passed as argument refers to a default parameter definition.
Public methodStatic memberpfsIsDouble
Indicates if the pfsNode passed as argument refers to a double (8-byte double precision floating point) parameter value.
Public methodStatic memberpfsIsFilename
Return true of the node is a filename
Public methodStatic memberpfsIsFloat
Indicates if the pfsNode passed as argument refers to a float (4-byte single precision floating point) parameter value.
Public methodStatic memberpfsIsInt
Indicates if the pfsNode passed as argument refers to an integer parameter value.
Public methodStatic memberpfsIsKeyword
Indicates if the pfsNode passed as argument refers to a keyword of a parameter structure.
Public methodStatic memberpfsIsNumeric
Indicates if the pfsNode passed as argument refers to a numeric parameter value. A numeric value is etther an integer, a float, or a double. For the exact type the respecctive type information functions should be called.
Public methodStatic memberpfsIsParam
Indicates if the pfsNode passed as argument refers to a parameter of a parameter structure.
Public methodStatic memberpfsIsString
Indicates if the pfsNode passed as argument refers to a string value.
Public methodStatic memberpfsIsTarget
Indicates if the pfsNode passed as argument refers to a target of a parameter structure.
Public methodStatic memberpfsIsUndefinedPar
Indicates if the pfsNode passed as argument refers to a string value.
Public methodStatic memberpfsKeywordByNameNum
Returns a reference to the n'th instance of a specific keyword name of the pfsNode (target/section) passed as argument.
Public methodStatic memberCode examplepfsKeywordByNum
Return a reference to the n'th keyword of the pfsNode (target/section) passed as argument.
Public methodStatic memberpfsKeywordParam
Return a reference to the n'th parameter of the m'th instance of a specific keyword name of the pfsNode (target/section), Zero if keyword or parameter was not found.
Public methodStatic memberpfsLoadFile
Open an existing parameter file and create an internal data structure for further processing.
Public methodStatic memberpfsNoChars
Return the number of characters read from the input parameter file.
Public methodStatic memberpfsNoComments
Return the number of comments skipped in the input parameter file
Public methodStatic memberpfsNodeByNum
Get node by number (1 based)
Public methodStatic memberpfsNoLines
Return the number of lines read from the input parameter file
Public methodStatic memberpfsNoTokens
Return the number of terminal syntax elements processed
Public methodStatic memberpfsNumericIsIntType
Indicates if the pfsNode passed as argument refers to a integer type parameter value.
Public methodStatic memberpfsParamByNum
Return a reference to the n'th parameter of the pfsNode (keyword) passed as argument.
Public methodStatic memberpfsPeekErrorGlb
Inspect the current value of the global error code without affecting it.
Public methodStatic memberpfsPutListParam
Write a list of parameters
Public methodStatic memberCode examplepfsSectionByNameNum
Returns a reference to the n'th instance of a specific subsection name of the pfsNode (target/section) passed as argument.
Public methodStatic memberCode examplepfsSectionByNum
Return a reference to the n'th section of the pfsNode (target/section) passed as argument.
Public methodStatic memberpfsSetAnchorFilename
Set anchor filename of node
Public methodStatic memberpfsSetProjectResultRoot
Set the project result root folder
Public methodStatic memberCode examplepfsTargetByNameNum
Return a reference to the n'th instance of a specific target name of a parameter file.
Public methodStatic memberCode examplepfsTargetByNum
Return a reference to the n'th target of a parameter file.
Public methodStatic memberpfsWrite
Write the contents of a parameter file object using the parameter file syntax
Top
Remarks
Copied from pfs C Library documentation:

The MIKE Zero Parameter File Standard (PFS) is intended for storage of a wide range of data, which may be organized or unstructured. Many of those data which do not naturally match the MIKE Zero Data File Standard (DFS) may be stored in a PFS file. Typical applications of PFS files are for storing analysis definition parameters, or for saving internal state parameters between two executions of an application. The structure of the PFS files has been designed with emphasis on robustness and possibilities for a wide extent of automatic data validation. Even if data may easily be exchanged between applications using simple ad hoc file formats, the parameter file concept may be a way to avoid misunderstandings and ease debugging of file based data exchange. The format of a parameter file is defined by a formal syntax which describes how data must be written. Even if the syntax puts limitations on the use of parameter files, it provides possibilities for strictly checking the contents of files and automatic error reporting, with the intension of moving the responsibility for many trivial data validation tasks from the application programmer to the parameter file system. The application programmer accesses a parameter file through a programming interface, and all read/write operations with associated data decoding and encoding are handled by the parameter file system, not by the programmer. The PFS covers components with different levels of specialization and different target groups. The PFS may be transparently integrated into an application without the end-user's knowledge, and for the application programmer, not all components must be mastered. The most general concepts are * parameter text files used for storing actual data * the syntax which describes the format for storing data in text files The application programmer will encounter * a programming interface used to write to and read from parameter files * parameter definition text files defining the data requirement for different applications * runtime instances of parameter files and parameter definitions * (application dependant validation functions) For a first introduction to the PFS it is adequate to think about a parameter file as a text file written to conform with some loosely defined convention, the details of which is initially of minor importance. The PFS has no user dialogs. The external interfaces are the application programming interface, and the actual PFS files. The MIKE Zero Message System is used for error reporting, unless silent version is called. The PFS programming interface is distributed in a Windows DLL and it may be accessed from any programming language supporting the Windows API.

See Also