aboutsummaryrefslogtreecommitdiff
path: root/mp/src/public/tier2/p4helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'mp/src/public/tier2/p4helpers.h')
-rw-r--r--mp/src/public/tier2/p4helpers.h18
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