PFSBuilder Class |
Namespace: DHI.PFS
The PFSBuilder type exposes the following members.
Name | Description | |
---|---|---|
PFSBuilder |
Creates a new PFSFile object.
|
Name | Description | |
---|---|---|
AddBool |
Add a Boolean value to keyword.
The Boolean value is written true or false. Restrictions: The function is only valid within the scope of a keyword. | |
AddClob |
Add a Clob parameter to keyword
Restrictions: The function is only valid within the scope of a keyword. | |
AddClobBool |
Add a bool value to the current Clob parameter.
Restrictions: The function is only valid within the scope of a Clob. | |
AddClobDouble |
Add a double precision floating-point (real) value to Clob.
Restrictions: The function is only valid within the scope of a Clob. | |
AddClobFilename |
Add a file name value to Clob.
Restrictions: The function is only valid within the scope of a Clob. | |
AddClobFloat |
Add a single precision floating-point (real) value to Clob.
Restrictions: The function is only valid within the scope of a Clob. | |
AddClobInt |
Add an integer (4 byte) value to the current Clob parameter.
Restrictions: The function is only valid within the scope of a Clob. | |
AddClobString |
Add a string value to Clob.
Restrictions: The function is only valid within the scope of a Clob. | |
AddDouble |
Add a double precision floating-point (real) value to keyword.
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. | |
AddFileName |
Add a filename (string) value parameter to keyword.
A file name string is in general a relative path string, relative to the pfs file at hand. If an absolute file name is entered, the PFS system will try to make the path relative to the pfs file, when the pfs file is written to disc, hence the relative string value in the PFS file will depend on the location of the pfs file for absolute file names. Restrictions: The function is only valid within the scope of a keyword. | |
AddInt |
Add a four-byte integer to keyword.
Restrictions: The function is only valid within the scope of a keyword | |
AddKeyword |
Add a keyword to a section, ie the start of a list of parameter list.
This function is used to define the start of a list of parameters. It has no end-counterpart, and the keyword scope is automaticalle "ended" by any other keyword or section related method. Restrictions: This function must be called within the scope of a section. | |
AddSection |
Start a new section within the scope of a target/section
| |
AddString |
Add a null-terminated character string to keyword.
Restrictions: The function is only valid within the scope of a keyword. | |
AddTarget |
Add a new target (top-level section) to a parameter file object.
This function is always the first function to be called, and the target definition must be terminated by a pfsEndSection. A target is ended by calling EndSection Restrictions: Possible previous targets must be have been properly terminated by calls to pfsEndSection. | |
AddUndefinedPar |
Add an undefined parameter to keyword.
Undefined can mean different things for different applications, though the most common is "use default value". Before using the undefined parameter, be sure that the model/tool that uses the PFS file supports handling undefined parameters. Restrictions: The function is only valid within the scope of a keyword. | |
EndSection |
Terminate a target or a section.
Restrictions: Each pfsEndSection must match a pfsAddTarget or a pfsAddSection. | |
Equals | (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetInternalHandlePointer |
Get the underlying internal PFS handle pointer.
For internal use only | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Write |
Write the contents of a PFS object to file
|
Name | Description | |
---|---|---|
AddDate |
Add a date as 3 integers (yyyy, MM, dd). The time part is ignored
(Defined by PFSExtensions.)Restrictions: The function is only valid within the scope of a keyword. | |
AddDateTime |
Add a date and time as 6 integers (year, month, day, hours, minutes, seconds).
(Defined by PFSExtensions.)Restrictions: The function is only valid within the scope of a keyword. | |
AddDouble(IEnumerableDouble) | Overloaded.
Add a number of double precision floating-point (real) values.
(Defined by PFSExtensions.)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. | |
AddDouble(Double) | Overloaded.
Add a number of double precision floating-point (real) values.
(Defined by PFSExtensions.)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. | |
AddInt(IEnumerableInt32) | Overloaded.
Add a number of four-byte integer.
(Defined by PFSExtensions.)Restrictions: The function is only valid within the scope of a keyword | |
AddInt(Int32) | Overloaded.
Add a number of four-byte integer.
(Defined by PFSExtensions.)Restrictions: The function is only valid within the scope of a keyword | |
AddKeywordValues |
Define a keyword, and adds a number of default type of parameters.
A convenience method that will call the appropriate Add method
for the provided type.
(Defined by PFSExtensions.)Each parameter must be one of the types:
Restrictions: This function must be called within the scope of a section. | |
AddTime |
Add a time as 3 integers (hours, minutes, seconds). The date part is ignored
(Defined by PFSExtensions.)Restrictions: The function is only valid within the scope of a keyword. |
PFSBuilder builder = new PFSBuilder(); builder.AddTarget("Run11"); // Add keyword and parameters builder.AddKeyword("key1"); builder.AddInt(2); builder.AddBool(true); // Add keyword and parameters in once call builder.AddKeywordValues("key2", 3.3, 4, "someText"); // Add subsections builder.AddSection("Results"); builder.AddSection("Result"); builder.AddKeywordValues("outid", "default out"); // File name parameter builder.AddKeyword("file"); builder.AddFileName(@".\output.res11"); builder.EndSection(); builder.EndSection(); // End target section (Run11) builder.EndSection();