[Box Backup-commit] COMMIT r3170 - box/trunk/lib/backupstore

subversion at boxbackup.org subversion at boxbackup.org
Wed Aug 21 02:00:23 BST 2013


Author: chris
Date: 2013-08-21 02:00:23 +0100 (Wed, 21 Aug 2013)
New Revision: 3170

Modified:
   box/trunk/lib/backupstore/BackupStoreContext.h
Log:
Allow getting the name of the current phase of a BackupStoreContext.

Useful for debugging when the phase is not as expected.


Modified: box/trunk/lib/backupstore/BackupStoreContext.h
===================================================================
--- box/trunk/lib/backupstore/BackupStoreContext.h	2013-08-21 00:57:17 UTC (rev 3169)
+++ box/trunk/lib/backupstore/BackupStoreContext.h	2013-08-21 01:00:23 UTC (rev 3170)
@@ -66,6 +66,19 @@
 	};
 	
 	int GetPhase() const {return mProtocolPhase;}
+	std::string GetPhaseName() const
+	{
+		switch(mProtocolPhase)
+		{
+			case Phase_Version:  return "Phase_Version";
+			case Phase_Login:    return "Phase_Login";
+			case Phase_Commands: return "Phase_Commands";
+			default:
+				std::ostringstream oss;
+				oss << "Unknown phase " << mProtocolPhase;
+				return oss.str();
+		}
+	}
 	void SetPhase(int NewPhase) {mProtocolPhase = NewPhase;}
 	
 	// Read only locking




More information about the Boxbackup-commit mailing list