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

subversion at boxbackup.org subversion at boxbackup.org
Sun Jan 22 16:36:27 GMT 2012


Author: chris
Date: 2012-01-22 16:36:27 +0000 (Sun, 22 Jan 2012)
New Revision: 3068

Modified:
   box/trunk/lib/backupstore/BackupStoreDirectory.cpp
   box/trunk/lib/backupstore/BackupStoreDirectory.h
Log:
Rename the BackupStoreDirectory::AddEntry's AttributesModTime parameter to AttributesHash to avoid misleading the reader.


Modified: box/trunk/lib/backupstore/BackupStoreDirectory.cpp
===================================================================
--- box/trunk/lib/backupstore/BackupStoreDirectory.cpp	2012-01-22 16:35:37 UTC (rev 3067)
+++ box/trunk/lib/backupstore/BackupStoreDirectory.cpp	2012-01-22 16:36:27 UTC (rev 3068)
@@ -115,7 +115,8 @@
 //
 // Function
 //		Name:    BackupStoreDirectory::ReadFromStream(IOStream &, int)
-//		Purpose: Reads the directory contents from a stream. Exceptions will yeild incomplete reads.
+//		Purpose: Reads the directory contents from a stream.
+//			 Exceptions will result in incomplete reads.
 //		Created: 2003/08/26
 //
 // --------------------------------------------------------------------------
@@ -131,7 +132,12 @@
 	// Check magic value...
 	if(OBJECTMAGIC_DIR_MAGIC_VALUE != ntohl(hdr.mMagicValue))
 	{
-		THROW_EXCEPTION(BackupStoreException, BadDirectoryFormat)
+		THROW_EXCEPTION_MESSAGE(BackupStoreException, BadDirectoryFormat,
+			"Wrong magic number in directory object " << 
+			BOX_FORMAT_OBJECTID(mObjectID) << ": expected " <<
+			BOX_FORMAT_HEX32(OBJECTMAGIC_DIR_MAGIC_VALUE) <<
+			" but found " <<
+			BOX_FORMAT_HEX32(ntohl(hdr.mMagicValue)));
 	}
 	
 	// Get data
@@ -307,9 +313,13 @@
 //		Created: 2003/08/27
 //
 // --------------------------------------------------------------------------
-BackupStoreDirectory::Entry *BackupStoreDirectory::AddEntry(const BackupStoreFilename &rName, box_time_t ModificationTime, int64_t ObjectID, int64_t SizeInBlocks, int16_t Flags, box_time_t AttributesModTime)
+BackupStoreDirectory::Entry *
+BackupStoreDirectory::AddEntry(const BackupStoreFilename &rName,
+	box_time_t ModificationTime, int64_t ObjectID, int64_t SizeInBlocks,
+	int16_t Flags, uint64_t AttributesHash)
 {
-	Entry *pnew = new Entry(rName, ModificationTime, ObjectID, SizeInBlocks, Flags, AttributesModTime);
+	Entry *pnew = new Entry(rName, ModificationTime, ObjectID,
+		SizeInBlocks, Flags, AttributesHash);
 	try
 	{
 		mEntries.push_back(pnew);

Modified: box/trunk/lib/backupstore/BackupStoreDirectory.h
===================================================================
--- box/trunk/lib/backupstore/BackupStoreDirectory.h	2012-01-22 16:35:37 UTC (rev 3067)
+++ box/trunk/lib/backupstore/BackupStoreDirectory.h	2012-01-22 16:36:27 UTC (rev 3068)
@@ -149,7 +149,10 @@
 			bool StreamAttributes = true, bool StreamDependencyInfo = true) const;
 			
 	Entry *AddEntry(const Entry &rEntryToCopy);
-	Entry *AddEntry(const BackupStoreFilename &rName, box_time_t ModificationTime, int64_t ObjectID, int64_t SizeInBlocks, int16_t Flags, box_time_t AttributesModTime);
+	Entry *AddEntry(const BackupStoreFilename &rName,
+		box_time_t ModificationTime, int64_t ObjectID,
+		int64_t SizeInBlocks, int16_t Flags,
+		uint64_t AttributesHash);
 	void DeleteEntry(int64_t ObjectID);
 	Entry *FindEntryByID(int64_t ObjectID) const;
 	




More information about the Boxbackup-commit mailing list