P4Perl Classes
The P4 module consists of several public classes:
The following tables provide brief details about each public class.
P4
The main class used for executing Perforce commands. Almost everything you do with P4Perl will involve this class.
Method |
Description |
---|---|
Construct a new |
|
Print build information including P4Perl version and Perforce API version. |
|
Clear the output handler. |
|
Initialize the Perforce client and connect to the Server. |
|
Disconnect from the Perforce 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( "
|
|
Shorthand for running:
$p4->FormatSpec( "
|
|
Converts a Perforce 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 Perforce 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 p4 monitor show -e command. |
|
Get the progress indicator. |
|
Get the location of the |
|
Get the current username ( |
|
Get the version of your script, as reported to the Perforce 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( "
|
|
Converts a Perforce form of the specified type
( |
|
Shorthand for running:
$p4-Run( "
|
|
Run a Perforce command and return its results. Check for
errors with |
|
Runs a p4 filelog on the
|
|
Runs p4 login using a password or ticket set by the user. |
|
A thin wrapper for changing your password. |
|
Interface to p4 resolve. |
|
Submit a changelist to the server. |
|
Get a list of tickets from the local tickets file. |
|
Shorthand for running:
$p4->SetInput( $spectype );
$p4->Run( "
|
|
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 OS X, 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 Perforce password ( |
|
Set host and port ( |
|
Set the program name as shown by the p4 monitor show -e command. |
|
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 Perforce username ( |
|
Set the version of your script, as reported to the Perforce 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 Perforce 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()
.
P4::Map
A class that allows users to create and work with Perforce mappings without requiring a connection to the Perforce 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 Perforce 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 Perforce.
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 Perforce form.
Method |
Description |
---|---|
Return the value associated with the field named
|
|
Set the value associated with the field named
|
|
Lists the fields that are permitted for specs of this type. |