Perforce API for the .Net CLR P4.Net

P4Form.LoadFromSpec Method 

Parses a Perforce form without making a server connection.

[Visual Basic]
Public Shared Function LoadFromSpec( _
   ByVal formCommand As String, _
   ByVal specDef As String, _
   ByVal formContents As String, _
   ByVal encoding As Encoding _
) As P4Form
[C#]
public static P4Form LoadFromSpec(
   string formCommand,
   string specDef,
   string formContents,
   Encoding encoding
);

Parameters

formCommand
The command that would otherwise be used to fetch the form.
specDef
The Perforce 'specdef' for the form.
formContents
The raw formated form text.
encoding
Server encoding (either ANSI or UFT-8).

Return Value

A Perforce form object.

Remarks

LoadFromSpec can be used to parse a form without making a call to the server. LoadFromSpec can be useful in form triggers. It does require you to know the SpecDef to call, which can change when upgrading or changing the server configuration.

See Also

P4Form Class | P4API Namespace