diff options
| author | John Schoenick <[email protected]> | 2015-09-09 18:35:41 -0700 |
|---|---|---|
| committer | John Schoenick <[email protected]> | 2015-09-09 18:35:41 -0700 |
| commit | 0d8dceea4310fde5706b3ce1c70609d72a38efdf (patch) | |
| tree | c831ef32c2c801a5c5a80401736b52c7b5a528ec /mp/src/public/tier2 | |
| parent | Updated the SDK with the latest code from the TF and HL2 branches. (diff) | |
| download | source-sdk-2013-master.tar.xz source-sdk-2013-master.zip | |
Diffstat (limited to 'mp/src/public/tier2')
| -rw-r--r-- | mp/src/public/tier2/p4helpers.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mp/src/public/tier2/p4helpers.h b/mp/src/public/tier2/p4helpers.h index 8d4b3b3f..61c70c81 100644 --- a/mp/src/public/tier2/p4helpers.h +++ b/mp/src/public/tier2/p4helpers.h @@ -33,6 +33,9 @@ public: // Opens the file for add virtual bool Add( void ); + // Reverts the file + virtual bool Revert( void ); + // Is the file in perforce? virtual bool IsFileInPerforce(); @@ -158,4 +161,19 @@ protected: }; +// +// CP4AutoRevert - reverts the file upon construction +// +class CP4AutoRevertFile +{ +public: + explicit CP4AutoRevertFile( char const *szFilename ) : m_spImpl( g_p4factory->AccessFile( szFilename ) ) { m_spImpl->Revert(); } + + CP4File * File() const { return m_spImpl.Get(); } + +protected: + CPlainAutoPtr< CP4File > m_spImpl; +}; + + #endif // #ifndef P4HELPERS_H |