P4Perl Classes
The P4 module consists of several public classes:
- P4
- P4::DepotFile
- P4::Revision
- P4::Integration
- P4::Map
- P4::MergeData
- P4::Message
- P4::OutputHandler
- P4::Progress
- P4::Spec
The following tables provide brief details about each public class.
P4
The main class used for executing Helix Server commands. Almost everything you do with P4Perl will involve this class.
Method | Description |
---|---|
Construct a new |
|
Print build information including P4Perl version and Helix C/C++ API version. |
|
Clear the output handler. |
|
Initialize the Helix Server client and connect to the Server. |
|
Disconnect from the Helix Core Server. |
|
Returns the number of errors encountered during execution of the last command. |
|
Returns a list of the error strings received during execution of the last command. |
|
Shorthand for running:
$p4->Run( "<spectype>", "-o" );
|
|
Shorthand for running:
$p4->FormatSpec( "<spectype>", hash );
|
|
Converts a Helix Server form of the specified type (client/label etc.) held in the supplied hash into its string representation. |
|
Get current API compatibility level. |
|
Get character set when connecting to Unicode servers. |
|
Get current client workspace ( |
|
Get current working directory. |
|
Get the value of a
Helix Server
environment variable, taking into account |
|
Get the output handler. |
|
Get the current hostname. |
|
Get |
|
Get |
|
Get |
|
Get the current password or ticket. |
|
Get host and port ( |
|
Get the program name as shown by the |
|
Get the progress indicator. |
|
Get the location of the |
|
Get the current username ( |
|
Get the version of your script, as reported to the Helix Core Server. |
|
Test whether or not session has been connected and/or has been dropped. |
|
Test whether or not streams are enabled. |
|
Test whether or not tagged output is enabled. |
|
Test whether or not server performance tracking is enabled. |
|
Iterate through spec results. |
|
Return an array of |
|
Get the location of the configuration file used
( |
|
Shorthand for running: $p4-ParseSpec( "<spectype>", buffer ); |
|
Converts a
Helix Server
form of the specified type ( |
|
Shorthand for running:
$p4-Run( "cmd", arg, ... );
|
|
Run a
Helix Server
command and return its results. Check for errors with
|
|
Runs a |
|
Runs |
|
A thin wrapper for changing your password. |
|
Interface to |
|
Submit a changelist to the server. |
|
Get a list of tickets from the local tickets file. |
|
Shorthand for running:
$p4->SetInput( $spectype );
$p4->Run( "<spectype>", "-i" );
|
|
Returns an integer specifying whether or not the server is case-sensitive. |
|
Returns an integer specifying the server protocol level. |
|
Returns an integer specifying whether or not the server is in Unicode mode. |
|
Specify the API compatibility level to use for this script. |
|
Set character set when connecting to Unicode servers. |
|
Set current client workspace ( |
|
Set current working directory. |
|
On Windows or macOS, set an environment variable in the registry or user preferences. |
|
Set the output handler. |
|
Set the name of the current host ( |
|
Save the supplied argument as input to be supplied to a subsequent command. |
|
Set |
|
Set |
|
Set |
|
Set
Helix Server
password ( |
|
Set host and port ( |
|
Set the program name as shown by the |
|
Set the progress indicator. |
|
Enable or disable streams support. |
|
Set the location of the |
|
Activate or deactivate server performance tracking. By default, tracking is off (0). |
|
Set the
Helix Server
username ( |
|
Set the version of your script, as reported to the Helix Core Server. |
|
Toggles tagged output (1 or 0). By default, tagged output is on (1). |
|
If performance tracking is enabled with |
|
Returns the number of warnings issued by the last command. |
|
Returns a list of the warning strings received during execution of the last command. |
P4::DepotFile
Utility class allowing access to the attributes of a file in the depot.
Returned by P4::RunFilelog()
.
Method | Description |
---|---|
Name of the depot file to which this object refers. |
|
Returns an array of revision objects for the depot file. |
P4::Revision
Utility class allowing access to the attributes of a revision of a file
in the depot. Returned by P4::RunFilelog()
.
Method | Description |
---|---|
Returns the action that created the revision. |
|
Returns the changelist number that gave rise to this revision of the file. |
|
Returns the name of the client from which this revision was submitted. |
|
Returns the name of the depot file to which this object refers. |
|
Returns the description of the change which created this revision. |
|
Returns the MD5 digest for this revision. |
|
Returns the size of this revision. |
|
Returns an array of |
|
Returns the number of this revision. |
|
Returns date/time this revision was created. |
|
Returns the Helix Server filetype of this revision. |
|
Returns the name of the user who created this revision. |
P4::Integration
Utility class allowing access to the attributes of an integration record
for a revision of a file in the depot. Returned by
P4::RunFilelog()
.
Method | Description |
---|---|
Integration method (merge/branch/copy/ignored). |
|
Integrated file. |
|
Start revision. |
|
End revision. |
P4::Map
A class that allows users to create and work with Helix Server mappings without requiring a connection to the Helix Core Server.
Method | Description |
---|---|
Construct a new Map object (class method). |
|
Joins two maps to create a third (class method). |
|
Empties a map. |
|
Returns the number of entries in a map. |
|
Tests whether or not a map object is empty. |
|
Inserts an entry into the map. |
|
Translate a string through a map. |
|
Tests whether a path is mapped. |
|
Returns a new mapping with the left and right sides reversed. |
|
Returns the left side as an array. |
|
Returns the right side as an array. |
|
Returns the map as an array. |
P4::MergeData
Class encapsulating the context of an individual merge during execution
of a p4 resolve
command. Passed to P4::RunResolve
.
Method | Description |
---|---|
Returns the name of "your" file in the merge. (file in workspace) |
|
Returns the name of "their" file in the merge. (file in the depot) |
|
Returns the name of "base" file in the merge. (file in the depot) |
|
Returns the path of "your" file in the merge. (file in workspace) |
|
Returns the path of "their" file in the merge. (temporary file
on workstation into which |
|
Returns the path of the base file in the merge. (temporary file
on workstation into which |
|
Returns the path to the merge result. (temporary file on workstation into which the automatic merge performed by the server has been loaded) |
|
Returns hint from server as to how user might best resolve merge. |
|
If the environment variable |
P4::Message
Class encapsulating the context of an individual error during execution
of
Helix Server
commands. Passed to P4::Messages()
.
Method | Description |
---|---|
Returns the severity class of the error. |
|
Returns the generic class of the error message. |
|
Returns the unique ID of the error message. |
|
Get the text of the error message. |
P4::OutputHandler
Handler class that provides access to streaming output from the server;
call P4::SetHandler()
with an implementation of P4::OutputHandler
to enable
callbacks:
Method | Description |
---|---|
Process binary data. |
|
Process tabular data. |
|
Process information or errors. |
|
Process tagged output. |
|
Process text data. |
P4::Progress
Handler class that provides access to progress indicators from the
server; call P4::SetProgress()
with an implementation of P4::Progress
to enable
callbacks:
Method | Description |
---|---|
Initialize progress indicator as designated type. |
|
Total number of units (if known). |
|
Description and type of units to be used for progress reporting. |
|
If non-zero, user has requested a cancellation of the operation. |
|
If non-zero, operation has failed. |
P4::Resolver
Class for handling resolves in Helix Server.
Method | Description |
---|---|
Perform a resolve and return the resolve decision as a string. |
P4::Spec
Utility class allowing access to the attributes of the fields in a Helix Server form.
Method | Description |
---|---|
Return the value associated with the field named fieldname. |
|
Set the value associated with the field named fieldname. |
|
Lists the fields that are permitted for specs of this type. |