Handle a connection to a perforce server. More...
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 | |
Perforce & | operator= (const Perforce &)=delete |
Perforce (Perforce &&)=delete | |
Perforce & | operator= (Perforce &&)=delete |
Private Attributes | |
Filename | m_PerforceFilename |
Filename for p4 executable file. | |
uint_t | m_bFilenameInitialized |
TRUE if the perforce executable is found | |
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.
|
privatedelete |
|
privatedelete |
Burger::Perforce::Perforce | ( | ) |
Initialize the class.
Initialize the class variables, but it won't actually connect to Perforce. Connecting occurs when Init() is called.
Burger::Perforce::~Perforce | ( | ) |
uint_t Burger::Perforce::Edit | ( | const char * | pFilename | ) |
Issue an "edit" command to open a file.
pFilename | Pointer to a Burgerlib format filename |
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.
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
pFilename | Pointer to a Burgerlib format filename |
uint_t Burger::Perforce::Shutdown | ( | void | ) |