Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::Perforce Class Reference

Handle a connection to a perforce server. More...

Collaboration diagram for Burger::Perforce:

Public Member Functions

 Perforce ()
 Initialize the class.
 
 ~Perforce ()
 Release the perforce tool and clean up.
 
uint_t Init (void)
 Open a connection to perforce.
 
uint_t Shutdown (void)
 Shut down any pending commands from Perforce and release all resources.
 
uint_t Edit (const char *pFilename)
 Issue an "edit" command to open a file.
 
uint_t RevertIfUnchanged (const char *pFilename)
 Issue an "revert" command to revert a file if it hasn't changed.
 

Private Member Functions

 Perforce (const Perforce &)=delete
 
Perforceoperator= (const Perforce &)=delete
 
 Perforce (Perforce &&)=delete
 
Perforceoperator= (Perforce &&)=delete
 

Private Attributes

Filename m_PerforceFilename
 Filename for p4 executable file.
 
uint_t m_bFilenameInitialized
 TRUE if the perforce executable is found
 

Detailed Description

Handle a connection to a perforce server.


This class encapsulates the connecting and invoking of perforce within an application. It simplifies the opening, editing and checking in files for development tools or runtime data management across a development team.

This class is not intended for shipping code. It's inclusion in a shipping game application is discouraged.

Note
This class is only available on Windows and MacOSX targets. On all other targets, it will perform no action and return an error code.

Constructor & Destructor Documentation

◆ Perforce() [1/3]

Burger::Perforce::Perforce ( const Perforce & )
privatedelete

◆ Perforce() [2/3]

Burger::Perforce::Perforce ( Perforce && )
privatedelete

◆ Perforce() [3/3]

Burger::Perforce::Perforce ( )

Initialize the class.


Initialize the class variables, but it won't actually connect to Perforce. Connecting occurs when Init() is called.

See also
Init() and Shutdown()

◆ ~Perforce()

Burger::Perforce::~Perforce ( )

Release the perforce tool and clean up.


See also
Init() and Shutdown()

Member Function Documentation

◆ Edit()

uint_t Burger::Perforce::Edit ( const char * pFilename)

Issue an "edit" command to open a file.


Parameters
pFilenamePointer to a Burgerlib format filename
Returns
Zero if no error, non-zero if an perforce error had occurred
See also
RevertIfUnchanged()

◆ Init()

uint_t Burger::Perforce::Init ( void )

Open a connection to perforce.


Locate the p4 executable file. This call is required before calling Edit() or RevertIfUnchanged()

p4 is located by first looking at the PERFORCE environment variable, scanning the default install folders and finally a search of the PATH environment variable. If it's not found, this call will fail.

Returns
Zero if no error, non-zero if a perforce error had occurred or p4 cannot be found
See also
Shutdown()

◆ operator=() [1/2]

Perforce & Burger::Perforce::operator= ( const Perforce & )
privatedelete

◆ operator=() [2/2]

Perforce & Burger::Perforce::operator= ( Perforce && )
privatedelete

◆ RevertIfUnchanged()

uint_t Burger::Perforce::RevertIfUnchanged ( const char * pFilename)

Issue an "revert" command to revert a file if it hasn't changed.


Given a Burgerlib pathname, perform a "p4 -a revert" command on it to revert the file if it has not changed

Parameters
pFilenamePointer to a Burgerlib format filename
Returns
Zero if no error, non-zero if an perforce error had occurred
See also
Edit()

◆ Shutdown()

uint_t Burger::Perforce::Shutdown ( void )

Shut down any pending commands from Perforce and release all resources.


Returns
Zero if no error, non-zero if an perforce error had occurred
See also
Init()

Member Data Documentation

◆ m_bFilenameInitialized

uint_t Burger::Perforce::m_bFilenameInitialized
private

TRUE if the perforce executable is found

◆ m_PerforceFilename

Filename Burger::Perforce::m_PerforceFilename
private

Filename for p4 executable file.