
// Auto-generated file -- do not edit

#include "Box.h"

#include <sstream>

#include "autogen_BackupProtocolClient.h"
#include "IOStream.h"

#include "MemLeakFindOn.h"
BackupProtocolObjectCl::BackupProtocolObjectCl()
{
}
BackupProtocolObjectCl::~BackupProtocolObjectCl()
{
}
BackupProtocolObjectCl::BackupProtocolObjectCl(const BackupProtocolObjectCl &rToCopy)
{
}

BackupProtocolClientError::BackupProtocolClientError()
	: mType(0),
	  mSubType(0)
{
}
BackupProtocolClientError::BackupProtocolClientError(const BackupProtocolClientError &rToCopy)
	: mType(rToCopy.mType),
	  mSubType(rToCopy.mSubType)
{
}
BackupProtocolClientError::~BackupProtocolClientError()
{
}
int BackupProtocolClientError::GetType() const
{
	return 0;
}
void BackupProtocolClientError::SetPropertiesFromStreamData(Protocol &rProtocol)
{
	rProtocol.Read(mType);
	rProtocol.Read(mSubType);
}
bool BackupProtocolClientError::IsError(int &rTypeOut, int &rSubTypeOut) const
{
	rTypeOut = mType;
	rSubTypeOut = mSubType;
	return true;
}
std::string BackupProtocolClientError::GetMessage() const
{
	switch(mSubType)
	{
		case Err_WrongVersion: return "WrongVersion = 1";
		case Err_NotInRightProtocolPhase: return "NotInRightProtocolPhase = 2";
		case Err_BadLogin: return "BadLogin = 3";
		case Err_CannotLockStoreForWriting: return "CannotLockStoreForWriting = 4";
		case Err_SessionReadOnly: return "SessionReadOnly = 5";
		case Err_FileDoesNotVerify: return "FileDoesNotVerify = 6";
		case Err_DoesNotExist: return "DoesNotExist = 7";
		case Err_DirectoryAlreadyExists: return "DirectoryAlreadyExists = 8";
		case Err_CannotDeleteRoot: return "CannotDeleteRoot = 9";
		case Err_TargetNameExists: return "TargetNameExists = 10";
		case Err_StorageLimitExceeded: return "StorageLimitExceeded = 11";
		case Err_DiffFromFileDoesNotExist: return "DiffFromFileDoesNotExist = 12";
		case Err_DoesNotExistInDirectory: return "DoesNotExistInDirectory = 13";
		case Err_PatchConsistencyError: return "PatchConsistencyError = 14";
		default:
			std::ostringstream out;
			out << "Unknown subtype " << mSubType;
			return out.str();
	}
}
void BackupProtocolClientError::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " Error(" << (mType == 0 ? "0x" : "") << std::hex << std::showbase << mType << std::dec << "," << (mSubType == 0 ? "0x" : "") << std::hex << std::showbase << mSubType << std::dec << ")");
}
void BackupProtocolClientError::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " Error(" << (mType == 0 ? "0x" : "") << std::hex << std::showbase << mType << std::dec << "," << (mSubType == 0 ? "0x" : "") << std::hex << std::showbase << mSubType << std::dec << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientVersion::BackupProtocolClientVersion()
	: mVersion(0)
{
}
BackupProtocolClientVersion::BackupProtocolClientVersion(const BackupProtocolClientVersion &rToCopy)
	: mVersion(rToCopy.mVersion)
{
}
BackupProtocolClientVersion::~BackupProtocolClientVersion()
{
}
int BackupProtocolClientVersion::GetType() const
{
	return 1;
}
void BackupProtocolClientVersion::SetPropertiesFromStreamData(Protocol &rProtocol)
{
	rProtocol.Read(mVersion);
}
BackupProtocolClientVersion::BackupProtocolClientVersion(int32_t Version)
	: mVersion(Version)
{
}
void BackupProtocolClientVersion::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mVersion);
}
void BackupProtocolClientVersion::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " Version(" << (mVersion == 0 ? "0x" : "") << std::hex << std::showbase << mVersion << std::dec << ")");
}
void BackupProtocolClientVersion::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " Version(" << (mVersion == 0 ? "0x" : "") << std::hex << std::showbase << mVersion << std::dec << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientLogin::BackupProtocolClientLogin()
	: mClientID(0),
	  mFlags(0)
{
}
BackupProtocolClientLogin::BackupProtocolClientLogin(const BackupProtocolClientLogin &rToCopy)
	: mClientID(rToCopy.mClientID),
	  mFlags(rToCopy.mFlags)
{
}
BackupProtocolClientLogin::~BackupProtocolClientLogin()
{
}
int BackupProtocolClientLogin::GetType() const
{
	return 2;
}
BackupProtocolClientLogin::BackupProtocolClientLogin(int32_t ClientID, int32_t Flags)
	: mClientID(ClientID),
	  mFlags(Flags)
{
}
void BackupProtocolClientLogin::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mClientID);
	rProtocol.Write(mFlags);
}
void BackupProtocolClientLogin::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " Login(" << (mClientID == 0 ? "0x" : "") << std::hex << std::showbase << mClientID << std::dec << "," << (mFlags == 0 ? "0x" : "") << std::hex << std::showbase << mFlags << std::dec << ")");
}
void BackupProtocolClientLogin::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " Login(" << (mClientID == 0 ? "0x" : "") << std::hex << std::showbase << mClientID << std::dec << "," << (mFlags == 0 ? "0x" : "") << std::hex << std::showbase << mFlags << std::dec << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientLoginConfirmed::BackupProtocolClientLoginConfirmed()
	: mClientStoreMarker(0),
	  mBlocksUsed(0),
	  mBlocksSoftLimit(0),
	  mBlocksHardLimit(0)
{
}
BackupProtocolClientLoginConfirmed::BackupProtocolClientLoginConfirmed(const BackupProtocolClientLoginConfirmed &rToCopy)
	: mClientStoreMarker(rToCopy.mClientStoreMarker),
	  mBlocksUsed(rToCopy.mBlocksUsed),
	  mBlocksSoftLimit(rToCopy.mBlocksSoftLimit),
	  mBlocksHardLimit(rToCopy.mBlocksHardLimit)
{
}
BackupProtocolClientLoginConfirmed::~BackupProtocolClientLoginConfirmed()
{
}
int BackupProtocolClientLoginConfirmed::GetType() const
{
	return 3;
}
void BackupProtocolClientLoginConfirmed::SetPropertiesFromStreamData(Protocol &rProtocol)
{
	rProtocol.Read(mClientStoreMarker);
	rProtocol.Read(mBlocksUsed);
	rProtocol.Read(mBlocksSoftLimit);
	rProtocol.Read(mBlocksHardLimit);
}
void BackupProtocolClientLoginConfirmed::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " LoginConfirmed(" << (mClientStoreMarker == 0 ? "0x" : "") << std::hex << std::showbase << mClientStoreMarker << std::dec << "," << (mBlocksUsed == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksUsed << std::dec << "," << (mBlocksSoftLimit == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksSoftLimit << std::dec << "," << (mBlocksHardLimit == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksHardLimit << std::dec << ")");
}
void BackupProtocolClientLoginConfirmed::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " LoginConfirmed(" << (mClientStoreMarker == 0 ? "0x" : "") << std::hex << std::showbase << mClientStoreMarker << std::dec << "," << (mBlocksUsed == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksUsed << std::dec << "," << (mBlocksSoftLimit == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksSoftLimit << std::dec << "," << (mBlocksHardLimit == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksHardLimit << std::dec << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientFinished::BackupProtocolClientFinished()
{
}
BackupProtocolClientFinished::BackupProtocolClientFinished(const BackupProtocolClientFinished &rToCopy)
{
}
BackupProtocolClientFinished::~BackupProtocolClientFinished()
{
}
int BackupProtocolClientFinished::GetType() const
{
	return 4;
}
void BackupProtocolClientFinished::SetPropertiesFromStreamData(Protocol &rProtocol)
{
}
void BackupProtocolClientFinished::WritePropertiesToStreamData(Protocol &rProtocol) const
{
}
bool BackupProtocolClientFinished::IsConversationEnd() const
{
	return true;
}
void BackupProtocolClientFinished::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " Finished(" << ")");
}
void BackupProtocolClientFinished::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " Finished(" << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientSuccess::BackupProtocolClientSuccess()
	: mObjectID(0)
{
}
BackupProtocolClientSuccess::BackupProtocolClientSuccess(const BackupProtocolClientSuccess &rToCopy)
	: mObjectID(rToCopy.mObjectID)
{
}
BackupProtocolClientSuccess::~BackupProtocolClientSuccess()
{
}
int BackupProtocolClientSuccess::GetType() const
{
	return 5;
}
void BackupProtocolClientSuccess::SetPropertiesFromStreamData(Protocol &rProtocol)
{
	rProtocol.Read(mObjectID);
}
void BackupProtocolClientSuccess::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " Success(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << ")");
}
void BackupProtocolClientSuccess::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " Success(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientSetClientStoreMarker::BackupProtocolClientSetClientStoreMarker()
	: mClientStoreMarker(0)
{
}
BackupProtocolClientSetClientStoreMarker::BackupProtocolClientSetClientStoreMarker(const BackupProtocolClientSetClientStoreMarker &rToCopy)
	: mClientStoreMarker(rToCopy.mClientStoreMarker)
{
}
BackupProtocolClientSetClientStoreMarker::~BackupProtocolClientSetClientStoreMarker()
{
}
int BackupProtocolClientSetClientStoreMarker::GetType() const
{
	return 6;
}
BackupProtocolClientSetClientStoreMarker::BackupProtocolClientSetClientStoreMarker(int64_t ClientStoreMarker)
	: mClientStoreMarker(ClientStoreMarker)
{
}
void BackupProtocolClientSetClientStoreMarker::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mClientStoreMarker);
}
void BackupProtocolClientSetClientStoreMarker::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " SetClientStoreMarker(" << (mClientStoreMarker == 0 ? "0x" : "") << std::hex << std::showbase << mClientStoreMarker << std::dec << ")");
}
void BackupProtocolClientSetClientStoreMarker::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " SetClientStoreMarker(" << (mClientStoreMarker == 0 ? "0x" : "") << std::hex << std::showbase << mClientStoreMarker << std::dec << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientGetObject::BackupProtocolClientGetObject()
	: mObjectID(0)
{
}
BackupProtocolClientGetObject::BackupProtocolClientGetObject(const BackupProtocolClientGetObject &rToCopy)
	: mObjectID(rToCopy.mObjectID)
{
}
BackupProtocolClientGetObject::~BackupProtocolClientGetObject()
{
}
int BackupProtocolClientGetObject::GetType() const
{
	return 10;
}
BackupProtocolClientGetObject::BackupProtocolClientGetObject(int64_t ObjectID)
	: mObjectID(ObjectID)
{
}
void BackupProtocolClientGetObject::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mObjectID);
}
void BackupProtocolClientGetObject::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " GetObject(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << ")");
}
void BackupProtocolClientGetObject::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " GetObject(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientMoveObject::BackupProtocolClientMoveObject()
	: mObjectID(0),
	  mMoveFromDirectory(0),
	  mMoveToDirectory(0),
	  mFlags(0)
{
}
BackupProtocolClientMoveObject::BackupProtocolClientMoveObject(const BackupProtocolClientMoveObject &rToCopy)
	: mObjectID(rToCopy.mObjectID),
	  mMoveFromDirectory(rToCopy.mMoveFromDirectory),
	  mMoveToDirectory(rToCopy.mMoveToDirectory),
	  mFlags(rToCopy.mFlags),
	  mNewFilename(rToCopy.mNewFilename)
{
}
BackupProtocolClientMoveObject::~BackupProtocolClientMoveObject()
{
}
int BackupProtocolClientMoveObject::GetType() const
{
	return 11;
}
BackupProtocolClientMoveObject::BackupProtocolClientMoveObject(int64_t ObjectID, int64_t MoveFromDirectory, int64_t MoveToDirectory, int32_t Flags, const BackupStoreFilenameClear& NewFilename)
	: mObjectID(ObjectID),
	  mMoveFromDirectory(MoveFromDirectory),
	  mMoveToDirectory(MoveToDirectory),
	  mFlags(Flags),
	  mNewFilename(NewFilename)
{
}
void BackupProtocolClientMoveObject::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mObjectID);
	rProtocol.Write(mMoveFromDirectory);
	rProtocol.Write(mMoveToDirectory);
	rProtocol.Write(mFlags);
	rProtocol.Write(mNewFilename);
}
void BackupProtocolClientMoveObject::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " MoveObject(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << "," << (mMoveFromDirectory == 0 ? "0x" : "") << std::hex << std::showbase << mMoveFromDirectory << std::dec << "," << (mMoveToDirectory == 0 ? "0x" : "") << std::hex << std::showbase << mMoveToDirectory << std::dec << "," << (mFlags == 0 ? "0x" : "") << std::hex << std::showbase << mFlags << std::dec << "," << "\"" << mNewFilename.GetClearFilename().c_str() << "\"" << ")");
}
void BackupProtocolClientMoveObject::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " MoveObject(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << "," << (mMoveFromDirectory == 0 ? "0x" : "") << std::hex << std::showbase << mMoveFromDirectory << std::dec << "," << (mMoveToDirectory == 0 ? "0x" : "") << std::hex << std::showbase << mMoveToDirectory << std::dec << "," << (mFlags == 0 ? "0x" : "") << std::hex << std::showbase << mFlags << std::dec << "," << "\"" << mNewFilename.GetClearFilename().c_str() << "\"" << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientGetObjectName::BackupProtocolClientGetObjectName()
	: mObjectID(0),
	  mContainingDirectoryID(0)
{
}
BackupProtocolClientGetObjectName::BackupProtocolClientGetObjectName(const BackupProtocolClientGetObjectName &rToCopy)
	: mObjectID(rToCopy.mObjectID),
	  mContainingDirectoryID(rToCopy.mContainingDirectoryID)
{
}
BackupProtocolClientGetObjectName::~BackupProtocolClientGetObjectName()
{
}
int BackupProtocolClientGetObjectName::GetType() const
{
	return 12;
}
BackupProtocolClientGetObjectName::BackupProtocolClientGetObjectName(int64_t ObjectID, int64_t ContainingDirectoryID)
	: mObjectID(ObjectID),
	  mContainingDirectoryID(ContainingDirectoryID)
{
}
void BackupProtocolClientGetObjectName::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mObjectID);
	rProtocol.Write(mContainingDirectoryID);
}
void BackupProtocolClientGetObjectName::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " GetObjectName(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << "," << (mContainingDirectoryID == 0 ? "0x" : "") << std::hex << std::showbase << mContainingDirectoryID << std::dec << ")");
}
void BackupProtocolClientGetObjectName::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " GetObjectName(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << "," << (mContainingDirectoryID == 0 ? "0x" : "") << std::hex << std::showbase << mContainingDirectoryID << std::dec << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientObjectName::BackupProtocolClientObjectName()
	: mNumNameElements(0),
	  mModificationTime(0),
	  mAttributesHash(0),
	  mFlags(0)
{
}
BackupProtocolClientObjectName::BackupProtocolClientObjectName(const BackupProtocolClientObjectName &rToCopy)
	: mNumNameElements(rToCopy.mNumNameElements),
	  mModificationTime(rToCopy.mModificationTime),
	  mAttributesHash(rToCopy.mAttributesHash),
	  mFlags(rToCopy.mFlags)
{
}
BackupProtocolClientObjectName::~BackupProtocolClientObjectName()
{
}
int BackupProtocolClientObjectName::GetType() const
{
	return 13;
}
void BackupProtocolClientObjectName::SetPropertiesFromStreamData(Protocol &rProtocol)
{
	rProtocol.Read(mNumNameElements);
	rProtocol.Read(mModificationTime);
	rProtocol.Read(mAttributesHash);
	rProtocol.Read(mFlags);
}
void BackupProtocolClientObjectName::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " ObjectName(" << (mNumNameElements == 0 ? "0x" : "") << std::hex << std::showbase << mNumNameElements << std::dec << "," << (mModificationTime == 0 ? "0x" : "") << std::hex << std::showbase << mModificationTime << std::dec << "," << (mAttributesHash == 0 ? "0x" : "") << std::hex << std::showbase << mAttributesHash << std::dec << "," << (mFlags == 0 ? "0x" : "") << std::hex << std::showbase << mFlags << std::dec << ")");
}
void BackupProtocolClientObjectName::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " ObjectName(" << (mNumNameElements == 0 ? "0x" : "") << std::hex << std::showbase << mNumNameElements << std::dec << "," << (mModificationTime == 0 ? "0x" : "") << std::hex << std::showbase << mModificationTime << std::dec << "," << (mAttributesHash == 0 ? "0x" : "") << std::hex << std::showbase << mAttributesHash << std::dec << "," << (mFlags == 0 ? "0x" : "") << std::hex << std::showbase << mFlags << std::dec << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientCreateDirectory::BackupProtocolClientCreateDirectory()
	: mContainingDirectoryID(0),
	  mAttributesModTime(0)
{
}
BackupProtocolClientCreateDirectory::BackupProtocolClientCreateDirectory(const BackupProtocolClientCreateDirectory &rToCopy)
	: mContainingDirectoryID(rToCopy.mContainingDirectoryID),
	  mAttributesModTime(rToCopy.mAttributesModTime),
	  mDirectoryName(rToCopy.mDirectoryName)
{
}
BackupProtocolClientCreateDirectory::~BackupProtocolClientCreateDirectory()
{
}
int BackupProtocolClientCreateDirectory::GetType() const
{
	return 20;
}
BackupProtocolClientCreateDirectory::BackupProtocolClientCreateDirectory(int64_t ContainingDirectoryID, int64_t AttributesModTime, const BackupStoreFilenameClear& DirectoryName)
	: mContainingDirectoryID(ContainingDirectoryID),
	  mAttributesModTime(AttributesModTime),
	  mDirectoryName(DirectoryName)
{
}
void BackupProtocolClientCreateDirectory::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mContainingDirectoryID);
	rProtocol.Write(mAttributesModTime);
	rProtocol.Write(mDirectoryName);
}
void BackupProtocolClientCreateDirectory::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " CreateDirectory(" << (mContainingDirectoryID == 0 ? "0x" : "") << std::hex << std::showbase << mContainingDirectoryID << std::dec << "," << (mAttributesModTime == 0 ? "0x" : "") << std::hex << std::showbase << mAttributesModTime << std::dec << "," << "\"" << mDirectoryName.GetClearFilename().c_str() << "\"" << ")");
}
void BackupProtocolClientCreateDirectory::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " CreateDirectory(" << (mContainingDirectoryID == 0 ? "0x" : "") << std::hex << std::showbase << mContainingDirectoryID << std::dec << "," << (mAttributesModTime == 0 ? "0x" : "") << std::hex << std::showbase << mAttributesModTime << std::dec << "," << "\"" << mDirectoryName.GetClearFilename().c_str() << "\"" << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientListDirectory::BackupProtocolClientListDirectory()
	: mObjectID(0),
	  mFlagsMustBeSet(0),
	  mFlagsNotToBeSet(0),
	  mSendAttributes(0)
{
}
BackupProtocolClientListDirectory::BackupProtocolClientListDirectory(const BackupProtocolClientListDirectory &rToCopy)
	: mObjectID(rToCopy.mObjectID),
	  mFlagsMustBeSet(rToCopy.mFlagsMustBeSet),
	  mFlagsNotToBeSet(rToCopy.mFlagsNotToBeSet),
	  mSendAttributes(rToCopy.mSendAttributes)
{
}
BackupProtocolClientListDirectory::~BackupProtocolClientListDirectory()
{
}
int BackupProtocolClientListDirectory::GetType() const
{
	return 21;
}
BackupProtocolClientListDirectory::BackupProtocolClientListDirectory(int64_t ObjectID, int16_t FlagsMustBeSet, int16_t FlagsNotToBeSet, bool SendAttributes)
	: mObjectID(ObjectID),
	  mFlagsMustBeSet(FlagsMustBeSet),
	  mFlagsNotToBeSet(FlagsNotToBeSet),
	  mSendAttributes(SendAttributes)
{
}
void BackupProtocolClientListDirectory::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mObjectID);
	rProtocol.Write(mFlagsMustBeSet);
	rProtocol.Write(mFlagsNotToBeSet);
	rProtocol.Write(mSendAttributes);
}
void BackupProtocolClientListDirectory::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " ListDirectory(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << "," << (mFlagsMustBeSet == 0 ? "0x" : "") << std::hex << std::showbase << mFlagsMustBeSet << std::dec << "," << (mFlagsNotToBeSet == 0 ? "0x" : "") << std::hex << std::showbase << mFlagsNotToBeSet << std::dec << "," << ((mSendAttributes)?"true":"false") << ")");
}
void BackupProtocolClientListDirectory::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " ListDirectory(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << "," << (mFlagsMustBeSet == 0 ? "0x" : "") << std::hex << std::showbase << mFlagsMustBeSet << std::dec << "," << (mFlagsNotToBeSet == 0 ? "0x" : "") << std::hex << std::showbase << mFlagsNotToBeSet << std::dec << "," << ((mSendAttributes)?"true":"false") << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientChangeDirAttributes::BackupProtocolClientChangeDirAttributes()
	: mObjectID(0),
	  mAttributesModTime(0)
{
}
BackupProtocolClientChangeDirAttributes::BackupProtocolClientChangeDirAttributes(const BackupProtocolClientChangeDirAttributes &rToCopy)
	: mObjectID(rToCopy.mObjectID),
	  mAttributesModTime(rToCopy.mAttributesModTime)
{
}
BackupProtocolClientChangeDirAttributes::~BackupProtocolClientChangeDirAttributes()
{
}
int BackupProtocolClientChangeDirAttributes::GetType() const
{
	return 22;
}
BackupProtocolClientChangeDirAttributes::BackupProtocolClientChangeDirAttributes(int64_t ObjectID, int64_t AttributesModTime)
	: mObjectID(ObjectID),
	  mAttributesModTime(AttributesModTime)
{
}
void BackupProtocolClientChangeDirAttributes::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mObjectID);
	rProtocol.Write(mAttributesModTime);
}
void BackupProtocolClientChangeDirAttributes::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " ChangeDirAttributes(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << "," << (mAttributesModTime == 0 ? "0x" : "") << std::hex << std::showbase << mAttributesModTime << std::dec << ")");
}
void BackupProtocolClientChangeDirAttributes::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " ChangeDirAttributes(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << "," << (mAttributesModTime == 0 ? "0x" : "") << std::hex << std::showbase << mAttributesModTime << std::dec << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientDeleteDirectory::BackupProtocolClientDeleteDirectory()
	: mObjectID(0)
{
}
BackupProtocolClientDeleteDirectory::BackupProtocolClientDeleteDirectory(const BackupProtocolClientDeleteDirectory &rToCopy)
	: mObjectID(rToCopy.mObjectID)
{
}
BackupProtocolClientDeleteDirectory::~BackupProtocolClientDeleteDirectory()
{
}
int BackupProtocolClientDeleteDirectory::GetType() const
{
	return 23;
}
BackupProtocolClientDeleteDirectory::BackupProtocolClientDeleteDirectory(int64_t ObjectID)
	: mObjectID(ObjectID)
{
}
void BackupProtocolClientDeleteDirectory::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mObjectID);
}
void BackupProtocolClientDeleteDirectory::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " DeleteDirectory(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << ")");
}
void BackupProtocolClientDeleteDirectory::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " DeleteDirectory(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientUndeleteDirectory::BackupProtocolClientUndeleteDirectory()
	: mObjectID(0)
{
}
BackupProtocolClientUndeleteDirectory::BackupProtocolClientUndeleteDirectory(const BackupProtocolClientUndeleteDirectory &rToCopy)
	: mObjectID(rToCopy.mObjectID)
{
}
BackupProtocolClientUndeleteDirectory::~BackupProtocolClientUndeleteDirectory()
{
}
int BackupProtocolClientUndeleteDirectory::GetType() const
{
	return 24;
}
BackupProtocolClientUndeleteDirectory::BackupProtocolClientUndeleteDirectory(int64_t ObjectID)
	: mObjectID(ObjectID)
{
}
void BackupProtocolClientUndeleteDirectory::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mObjectID);
}
void BackupProtocolClientUndeleteDirectory::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " UndeleteDirectory(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << ")");
}
void BackupProtocolClientUndeleteDirectory::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " UndeleteDirectory(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientStoreFile::BackupProtocolClientStoreFile()
	: mDirectoryObjectID(0),
	  mModificationTime(0),
	  mAttributesHash(0),
	  mDiffFromFileID(0)
{
}
BackupProtocolClientStoreFile::BackupProtocolClientStoreFile(const BackupProtocolClientStoreFile &rToCopy)
	: mDirectoryObjectID(rToCopy.mDirectoryObjectID),
	  mModificationTime(rToCopy.mModificationTime),
	  mAttributesHash(rToCopy.mAttributesHash),
	  mDiffFromFileID(rToCopy.mDiffFromFileID),
	  mFilename(rToCopy.mFilename)
{
}
BackupProtocolClientStoreFile::~BackupProtocolClientStoreFile()
{
}
int BackupProtocolClientStoreFile::GetType() const
{
	return 30;
}
BackupProtocolClientStoreFile::BackupProtocolClientStoreFile(int64_t DirectoryObjectID, int64_t ModificationTime, int64_t AttributesHash, int64_t DiffFromFileID, const BackupStoreFilenameClear& Filename)
	: mDirectoryObjectID(DirectoryObjectID),
	  mModificationTime(ModificationTime),
	  mAttributesHash(AttributesHash),
	  mDiffFromFileID(DiffFromFileID),
	  mFilename(Filename)
{
}
void BackupProtocolClientStoreFile::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mDirectoryObjectID);
	rProtocol.Write(mModificationTime);
	rProtocol.Write(mAttributesHash);
	rProtocol.Write(mDiffFromFileID);
	rProtocol.Write(mFilename);
}
void BackupProtocolClientStoreFile::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " StoreFile(" << (mDirectoryObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mDirectoryObjectID << std::dec << "," << (mModificationTime == 0 ? "0x" : "") << std::hex << std::showbase << mModificationTime << std::dec << "," << (mAttributesHash == 0 ? "0x" : "") << std::hex << std::showbase << mAttributesHash << std::dec << "," << (mDiffFromFileID == 0 ? "0x" : "") << std::hex << std::showbase << mDiffFromFileID << std::dec << "," << "\"" << mFilename.GetClearFilename().c_str() << "\"" << ")");
}
void BackupProtocolClientStoreFile::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " StoreFile(" << (mDirectoryObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mDirectoryObjectID << std::dec << "," << (mModificationTime == 0 ? "0x" : "") << std::hex << std::showbase << mModificationTime << std::dec << "," << (mAttributesHash == 0 ? "0x" : "") << std::hex << std::showbase << mAttributesHash << std::dec << "," << (mDiffFromFileID == 0 ? "0x" : "") << std::hex << std::showbase << mDiffFromFileID << std::dec << "," << "\"" << mFilename.GetClearFilename().c_str() << "\"" << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientGetFile::BackupProtocolClientGetFile()
	: mInDirectory(0),
	  mObjectID(0)
{
}
BackupProtocolClientGetFile::BackupProtocolClientGetFile(const BackupProtocolClientGetFile &rToCopy)
	: mInDirectory(rToCopy.mInDirectory),
	  mObjectID(rToCopy.mObjectID)
{
}
BackupProtocolClientGetFile::~BackupProtocolClientGetFile()
{
}
int BackupProtocolClientGetFile::GetType() const
{
	return 31;
}
BackupProtocolClientGetFile::BackupProtocolClientGetFile(int64_t InDirectory, int64_t ObjectID)
	: mInDirectory(InDirectory),
	  mObjectID(ObjectID)
{
}
void BackupProtocolClientGetFile::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mInDirectory);
	rProtocol.Write(mObjectID);
}
void BackupProtocolClientGetFile::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " GetFile(" << (mInDirectory == 0 ? "0x" : "") << std::hex << std::showbase << mInDirectory << std::dec << "," << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << ")");
}
void BackupProtocolClientGetFile::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " GetFile(" << (mInDirectory == 0 ? "0x" : "") << std::hex << std::showbase << mInDirectory << std::dec << "," << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientSetReplacementFileAttributes::BackupProtocolClientSetReplacementFileAttributes()
	: mInDirectory(0),
	  mAttributesHash(0)
{
}
BackupProtocolClientSetReplacementFileAttributes::BackupProtocolClientSetReplacementFileAttributes(const BackupProtocolClientSetReplacementFileAttributes &rToCopy)
	: mInDirectory(rToCopy.mInDirectory),
	  mAttributesHash(rToCopy.mAttributesHash),
	  mFilename(rToCopy.mFilename)
{
}
BackupProtocolClientSetReplacementFileAttributes::~BackupProtocolClientSetReplacementFileAttributes()
{
}
int BackupProtocolClientSetReplacementFileAttributes::GetType() const
{
	return 32;
}
BackupProtocolClientSetReplacementFileAttributes::BackupProtocolClientSetReplacementFileAttributes(int64_t InDirectory, int64_t AttributesHash, const BackupStoreFilenameClear& Filename)
	: mInDirectory(InDirectory),
	  mAttributesHash(AttributesHash),
	  mFilename(Filename)
{
}
void BackupProtocolClientSetReplacementFileAttributes::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mInDirectory);
	rProtocol.Write(mAttributesHash);
	rProtocol.Write(mFilename);
}
void BackupProtocolClientSetReplacementFileAttributes::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " SetReplacementFileAttributes(" << (mInDirectory == 0 ? "0x" : "") << std::hex << std::showbase << mInDirectory << std::dec << "," << (mAttributesHash == 0 ? "0x" : "") << std::hex << std::showbase << mAttributesHash << std::dec << "," << "\"" << mFilename.GetClearFilename().c_str() << "\"" << ")");
}
void BackupProtocolClientSetReplacementFileAttributes::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " SetReplacementFileAttributes(" << (mInDirectory == 0 ? "0x" : "") << std::hex << std::showbase << mInDirectory << std::dec << "," << (mAttributesHash == 0 ? "0x" : "") << std::hex << std::showbase << mAttributesHash << std::dec << "," << "\"" << mFilename.GetClearFilename().c_str() << "\"" << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientDeleteFile::BackupProtocolClientDeleteFile()
	: mInDirectory(0)
{
}
BackupProtocolClientDeleteFile::BackupProtocolClientDeleteFile(const BackupProtocolClientDeleteFile &rToCopy)
	: mInDirectory(rToCopy.mInDirectory),
	  mFilename(rToCopy.mFilename)
{
}
BackupProtocolClientDeleteFile::~BackupProtocolClientDeleteFile()
{
}
int BackupProtocolClientDeleteFile::GetType() const
{
	return 33;
}
BackupProtocolClientDeleteFile::BackupProtocolClientDeleteFile(int64_t InDirectory, const BackupStoreFilenameClear& Filename)
	: mInDirectory(InDirectory),
	  mFilename(Filename)
{
}
void BackupProtocolClientDeleteFile::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mInDirectory);
	rProtocol.Write(mFilename);
}
void BackupProtocolClientDeleteFile::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " DeleteFile(" << (mInDirectory == 0 ? "0x" : "") << std::hex << std::showbase << mInDirectory << std::dec << "," << "\"" << mFilename.GetClearFilename().c_str() << "\"" << ")");
}
void BackupProtocolClientDeleteFile::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " DeleteFile(" << (mInDirectory == 0 ? "0x" : "") << std::hex << std::showbase << mInDirectory << std::dec << "," << "\"" << mFilename.GetClearFilename().c_str() << "\"" << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientGetBlockIndexByID::BackupProtocolClientGetBlockIndexByID()
	: mObjectID(0)
{
}
BackupProtocolClientGetBlockIndexByID::BackupProtocolClientGetBlockIndexByID(const BackupProtocolClientGetBlockIndexByID &rToCopy)
	: mObjectID(rToCopy.mObjectID)
{
}
BackupProtocolClientGetBlockIndexByID::~BackupProtocolClientGetBlockIndexByID()
{
}
int BackupProtocolClientGetBlockIndexByID::GetType() const
{
	return 34;
}
BackupProtocolClientGetBlockIndexByID::BackupProtocolClientGetBlockIndexByID(int64_t ObjectID)
	: mObjectID(ObjectID)
{
}
void BackupProtocolClientGetBlockIndexByID::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mObjectID);
}
void BackupProtocolClientGetBlockIndexByID::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " GetBlockIndexByID(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << ")");
}
void BackupProtocolClientGetBlockIndexByID::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " GetBlockIndexByID(" << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientGetBlockIndexByName::BackupProtocolClientGetBlockIndexByName()
	: mInDirectory(0)
{
}
BackupProtocolClientGetBlockIndexByName::BackupProtocolClientGetBlockIndexByName(const BackupProtocolClientGetBlockIndexByName &rToCopy)
	: mInDirectory(rToCopy.mInDirectory),
	  mFilename(rToCopy.mFilename)
{
}
BackupProtocolClientGetBlockIndexByName::~BackupProtocolClientGetBlockIndexByName()
{
}
int BackupProtocolClientGetBlockIndexByName::GetType() const
{
	return 35;
}
BackupProtocolClientGetBlockIndexByName::BackupProtocolClientGetBlockIndexByName(int64_t InDirectory, const BackupStoreFilenameClear& Filename)
	: mInDirectory(InDirectory),
	  mFilename(Filename)
{
}
void BackupProtocolClientGetBlockIndexByName::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mInDirectory);
	rProtocol.Write(mFilename);
}
void BackupProtocolClientGetBlockIndexByName::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " GetBlockIndexByName(" << (mInDirectory == 0 ? "0x" : "") << std::hex << std::showbase << mInDirectory << std::dec << "," << "\"" << mFilename.GetClearFilename().c_str() << "\"" << ")");
}
void BackupProtocolClientGetBlockIndexByName::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " GetBlockIndexByName(" << (mInDirectory == 0 ? "0x" : "") << std::hex << std::showbase << mInDirectory << std::dec << "," << "\"" << mFilename.GetClearFilename().c_str() << "\"" << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientUndeleteFile::BackupProtocolClientUndeleteFile()
	: mInDirectory(0),
	  mObjectID(0)
{
}
BackupProtocolClientUndeleteFile::BackupProtocolClientUndeleteFile(const BackupProtocolClientUndeleteFile &rToCopy)
	: mInDirectory(rToCopy.mInDirectory),
	  mObjectID(rToCopy.mObjectID)
{
}
BackupProtocolClientUndeleteFile::~BackupProtocolClientUndeleteFile()
{
}
int BackupProtocolClientUndeleteFile::GetType() const
{
	return 36;
}
BackupProtocolClientUndeleteFile::BackupProtocolClientUndeleteFile(int64_t InDirectory, int64_t ObjectID)
	: mInDirectory(InDirectory),
	  mObjectID(ObjectID)
{
}
void BackupProtocolClientUndeleteFile::WritePropertiesToStreamData(Protocol &rProtocol) const
{
	rProtocol.Write(mInDirectory);
	rProtocol.Write(mObjectID);
}
void BackupProtocolClientUndeleteFile::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " UndeleteFile(" << (mInDirectory == 0 ? "0x" : "") << std::hex << std::showbase << mInDirectory << std::dec << "," << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << ")");
}
void BackupProtocolClientUndeleteFile::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " UndeleteFile(" << (mInDirectory == 0 ? "0x" : "") << std::hex << std::showbase << mInDirectory << std::dec << "," << (mObjectID == 0 ? "0x" : "") << std::hex << std::showbase << mObjectID << std::dec << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientGetAccountUsage::BackupProtocolClientGetAccountUsage()
{
}
BackupProtocolClientGetAccountUsage::BackupProtocolClientGetAccountUsage(const BackupProtocolClientGetAccountUsage &rToCopy)
{
}
BackupProtocolClientGetAccountUsage::~BackupProtocolClientGetAccountUsage()
{
}
int BackupProtocolClientGetAccountUsage::GetType() const
{
	return 40;
}
void BackupProtocolClientGetAccountUsage::WritePropertiesToStreamData(Protocol &rProtocol) const
{
}
void BackupProtocolClientGetAccountUsage::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " GetAccountUsage(" << ")");
}
void BackupProtocolClientGetAccountUsage::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " GetAccountUsage(" << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientAccountUsage::BackupProtocolClientAccountUsage()
	: mBlocksUsed(0),
	  mBlocksInOldFiles(0),
	  mBlocksInDeletedFiles(0),
	  mBlocksInDirectories(0),
	  mBlocksSoftLimit(0),
	  mBlocksHardLimit(0),
	  mBlockSize(0)
{
}
BackupProtocolClientAccountUsage::BackupProtocolClientAccountUsage(const BackupProtocolClientAccountUsage &rToCopy)
	: mBlocksUsed(rToCopy.mBlocksUsed),
	  mBlocksInOldFiles(rToCopy.mBlocksInOldFiles),
	  mBlocksInDeletedFiles(rToCopy.mBlocksInDeletedFiles),
	  mBlocksInDirectories(rToCopy.mBlocksInDirectories),
	  mBlocksSoftLimit(rToCopy.mBlocksSoftLimit),
	  mBlocksHardLimit(rToCopy.mBlocksHardLimit),
	  mBlockSize(rToCopy.mBlockSize)
{
}
BackupProtocolClientAccountUsage::~BackupProtocolClientAccountUsage()
{
}
int BackupProtocolClientAccountUsage::GetType() const
{
	return 41;
}
void BackupProtocolClientAccountUsage::SetPropertiesFromStreamData(Protocol &rProtocol)
{
	rProtocol.Read(mBlocksUsed);
	rProtocol.Read(mBlocksInOldFiles);
	rProtocol.Read(mBlocksInDeletedFiles);
	rProtocol.Read(mBlocksInDirectories);
	rProtocol.Read(mBlocksSoftLimit);
	rProtocol.Read(mBlocksHardLimit);
	rProtocol.Read(mBlockSize);
}
void BackupProtocolClientAccountUsage::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " AccountUsage(" << (mBlocksUsed == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksUsed << std::dec << "," << (mBlocksInOldFiles == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksInOldFiles << std::dec << "," << (mBlocksInDeletedFiles == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksInDeletedFiles << std::dec << "," << (mBlocksInDirectories == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksInDirectories << std::dec << "," << (mBlocksSoftLimit == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksSoftLimit << std::dec << "," << (mBlocksHardLimit == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksHardLimit << std::dec << "," << (mBlockSize == 0 ? "0x" : "") << std::hex << std::showbase << mBlockSize << std::dec << ")");
}
void BackupProtocolClientAccountUsage::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " AccountUsage(" << (mBlocksUsed == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksUsed << std::dec << "," << (mBlocksInOldFiles == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksInOldFiles << std::dec << "," << (mBlocksInDeletedFiles == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksInDeletedFiles << std::dec << "," << (mBlocksInDirectories == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksInDirectories << std::dec << "," << (mBlocksSoftLimit == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksSoftLimit << std::dec << "," << (mBlocksHardLimit == 0 ? "0x" : "") << std::hex << std::showbase << mBlocksHardLimit << std::dec << "," << (mBlockSize == 0 ? "0x" : "") << std::hex << std::showbase << mBlockSize << std::dec << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientGetIsAlive::BackupProtocolClientGetIsAlive()
{
}
BackupProtocolClientGetIsAlive::BackupProtocolClientGetIsAlive(const BackupProtocolClientGetIsAlive &rToCopy)
{
}
BackupProtocolClientGetIsAlive::~BackupProtocolClientGetIsAlive()
{
}
int BackupProtocolClientGetIsAlive::GetType() const
{
	return 42;
}
void BackupProtocolClientGetIsAlive::WritePropertiesToStreamData(Protocol &rProtocol) const
{
}
void BackupProtocolClientGetIsAlive::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " GetIsAlive(" << ")");
}
void BackupProtocolClientGetIsAlive::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " GetIsAlive(" << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClientIsAlive::BackupProtocolClientIsAlive()
{
}
BackupProtocolClientIsAlive::BackupProtocolClientIsAlive(const BackupProtocolClientIsAlive &rToCopy)
{
}
BackupProtocolClientIsAlive::~BackupProtocolClientIsAlive()
{
}
int BackupProtocolClientIsAlive::GetType() const
{
	return 43;
}
void BackupProtocolClientIsAlive::SetPropertiesFromStreamData(Protocol &rProtocol)
{
}
void BackupProtocolClientIsAlive::LogSysLog(const char *Action) const
{
	BOX_TRACE(Action << " IsAlive(" << ")");
}
void BackupProtocolClientIsAlive::LogFile(const char *Action, FILE *File) const
{
	std::ostringstream oss;
	oss << Action << " IsAlive(" << ")";
	::fprintf(File, "%s\n", oss.str().c_str());
	::fflush(File);
}
BackupProtocolClient::BackupProtocolClient(IOStream &rStream)
	: Protocol(rStream), mLogToSysLog(false), mLogToFile(0)
{
}
BackupProtocolClient::~BackupProtocolClient()
{
}
const char *BackupProtocolClient::GetIdentString()
{
	return "Box-Backup:v=C";
}
std::auto_ptr<ProtocolObject> BackupProtocolClient::MakeProtocolObject(int ObjType)
{
	switch(ObjType)
	{
	case 0:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientError);
		break;
	case 1:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientVersion);
		break;
	case 2:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientLogin);
		break;
	case 3:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientLoginConfirmed);
		break;
	case 4:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientFinished);
		break;
	case 5:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientSuccess);
		break;
	case 6:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientSetClientStoreMarker);
		break;
	case 10:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientGetObject);
		break;
	case 11:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientMoveObject);
		break;
	case 12:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientGetObjectName);
		break;
	case 13:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientObjectName);
		break;
	case 20:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientCreateDirectory);
		break;
	case 21:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientListDirectory);
		break;
	case 22:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientChangeDirAttributes);
		break;
	case 23:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientDeleteDirectory);
		break;
	case 24:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientUndeleteDirectory);
		break;
	case 30:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientStoreFile);
		break;
	case 31:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientGetFile);
		break;
	case 32:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientSetReplacementFileAttributes);
		break;
	case 33:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientDeleteFile);
		break;
	case 34:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientGetBlockIndexByID);
		break;
	case 35:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientGetBlockIndexByName);
		break;
	case 36:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientUndeleteFile);
		break;
	case 40:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientGetAccountUsage);
		break;
	case 41:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientAccountUsage);
		break;
	case 42:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientGetIsAlive);
		break;
	case 43:
		return std::auto_ptr<ProtocolObject>(new BackupProtocolClientIsAlive);
		break;
	default:
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnknownCommandRecieved)
	}
}
std::auto_ptr<BackupProtocolObjectCl> BackupProtocolClient::Receive()
{
	std::auto_ptr<BackupProtocolObjectCl> preply((BackupProtocolObjectCl*)(Protocol::Receive().release()));

	if(mLogToSysLog)
	{
		preply->LogSysLog("Receive");
	}
	if(mLogToFile != 0)
	{
		preply->LogFile("Receive", mLogToFile);
	}

	return preply;
}

void BackupProtocolClient::Send(const BackupProtocolObjectCl &rObject)
{
	if(mLogToSysLog)
	{
		rObject.LogSysLog("Send");
	}
	if(mLogToFile != 0)
	{
		rObject.LogFile("Send", mLogToFile);
	}
	Protocol::Send(rObject);
}


void BackupProtocolClient::InformStreamReceiving(u_int32_t Size)
{
	if(mLogToSysLog)
	{
		if(Size==Protocol::ProtocolStream_SizeUncertain)
		{
			BOX_TRACE("Receiving stream, size uncertain");
		}
		else
		{
			BOX_TRACE("Receiving stream, size " << Size);
		}
	}
	if(mLogToFile)
	{
		::fprintf(mLogToFile,
			(Size==Protocol::ProtocolStream_SizeUncertain)
			?"Receiving stream, size uncertain\n"
			:"Receiving stream, size %d\n", Size);
		::fflush(mLogToFile);
	}
}

void BackupProtocolClient::InformStreamSending(u_int32_t Size)
{
	if(mLogToSysLog)
	{
		if(Size==Protocol::ProtocolStream_SizeUncertain)
		{
			BOX_TRACE("Sending stream, size uncertain");
		}
		else
		{
			BOX_TRACE("Sending stream, size " << Size);
		}
	}
	if(mLogToFile)
	{
		::fprintf(mLogToFile,
			(Size==Protocol::ProtocolStream_SizeUncertain)
			?"Sending stream, size uncertain\n"
			:"Sending stream, size %d\n", Size);
		::fflush(mLogToFile);
	}
}

std::auto_ptr<BackupProtocolClientVersion> BackupProtocolClient::Query(const BackupProtocolClientVersion &rQuery)
{
	// Send query
	Send(rQuery);
	
	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 1)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientVersion>((BackupProtocolClientVersion*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("Version command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("Version command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientLoginConfirmed> BackupProtocolClient::Query(const BackupProtocolClientLogin &rQuery)
{
	// Send query
	Send(rQuery);
	
	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 3)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientLoginConfirmed>((BackupProtocolClientLoginConfirmed*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("Login command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("Login command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientFinished> BackupProtocolClient::Query(const BackupProtocolClientFinished &rQuery)
{
	// Send query
	Send(rQuery);
	
	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 4)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientFinished>((BackupProtocolClientFinished*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("Finished command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("Finished command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientSuccess> BackupProtocolClient::Query(const BackupProtocolClientSetClientStoreMarker &rQuery)
{
	// Send query
	Send(rQuery);
	
	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 5)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientSuccess>((BackupProtocolClientSuccess*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("SetClientStoreMarker command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("SetClientStoreMarker command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientSuccess> BackupProtocolClient::Query(const BackupProtocolClientGetObject &rQuery)
{
	// Send query
	Send(rQuery);
	
	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 5)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientSuccess>((BackupProtocolClientSuccess*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("GetObject command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("GetObject command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientSuccess> BackupProtocolClient::Query(const BackupProtocolClientMoveObject &rQuery)
{
	// Send query
	Send(rQuery);
	
	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 5)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientSuccess>((BackupProtocolClientSuccess*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("MoveObject command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("MoveObject command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientObjectName> BackupProtocolClient::Query(const BackupProtocolClientGetObjectName &rQuery)
{
	// Send query
	Send(rQuery);
	
	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 13)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientObjectName>((BackupProtocolClientObjectName*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("GetObjectName command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("GetObjectName command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientSuccess> BackupProtocolClient::Query(const BackupProtocolClientCreateDirectory &rQuery, IOStream &rStream)
{
	// Send query
	Send(rQuery);
		
	// Send stream after the command
	SendStream(rStream);

	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 5)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientSuccess>((BackupProtocolClientSuccess*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("CreateDirectory command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("CreateDirectory command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientSuccess> BackupProtocolClient::Query(const BackupProtocolClientListDirectory &rQuery)
{
	// Send query
	Send(rQuery);
	
	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 5)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientSuccess>((BackupProtocolClientSuccess*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("ListDirectory command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("ListDirectory command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientSuccess> BackupProtocolClient::Query(const BackupProtocolClientChangeDirAttributes &rQuery, IOStream &rStream)
{
	// Send query
	Send(rQuery);
		
	// Send stream after the command
	SendStream(rStream);

	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 5)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientSuccess>((BackupProtocolClientSuccess*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("ChangeDirAttributes command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("ChangeDirAttributes command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientSuccess> BackupProtocolClient::Query(const BackupProtocolClientDeleteDirectory &rQuery)
{
	// Send query
	Send(rQuery);
	
	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 5)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientSuccess>((BackupProtocolClientSuccess*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("DeleteDirectory command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("DeleteDirectory command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientSuccess> BackupProtocolClient::Query(const BackupProtocolClientUndeleteDirectory &rQuery)
{
	// Send query
	Send(rQuery);
	
	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 5)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientSuccess>((BackupProtocolClientSuccess*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("UndeleteDirectory command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("UndeleteDirectory command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientSuccess> BackupProtocolClient::Query(const BackupProtocolClientStoreFile &rQuery, IOStream &rStream)
{
	// Send query
	Send(rQuery);
		
	// Send stream after the command
	SendStream(rStream);

	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 5)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientSuccess>((BackupProtocolClientSuccess*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("StoreFile command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("StoreFile command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientSuccess> BackupProtocolClient::Query(const BackupProtocolClientGetFile &rQuery)
{
	// Send query
	Send(rQuery);
	
	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 5)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientSuccess>((BackupProtocolClientSuccess*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("GetFile command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("GetFile command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientSuccess> BackupProtocolClient::Query(const BackupProtocolClientSetReplacementFileAttributes &rQuery, IOStream &rStream)
{
	// Send query
	Send(rQuery);
		
	// Send stream after the command
	SendStream(rStream);

	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 5)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientSuccess>((BackupProtocolClientSuccess*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("SetReplacementFileAttributes command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("SetReplacementFileAttributes command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientSuccess> BackupProtocolClient::Query(const BackupProtocolClientDeleteFile &rQuery)
{
	// Send query
	Send(rQuery);
	
	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 5)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientSuccess>((BackupProtocolClientSuccess*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("DeleteFile command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("DeleteFile command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientSuccess> BackupProtocolClient::Query(const BackupProtocolClientGetBlockIndexByID &rQuery)
{
	// Send query
	Send(rQuery);
	
	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 5)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientSuccess>((BackupProtocolClientSuccess*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("GetBlockIndexByID command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("GetBlockIndexByID command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientSuccess> BackupProtocolClient::Query(const BackupProtocolClientGetBlockIndexByName &rQuery)
{
	// Send query
	Send(rQuery);
	
	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 5)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientSuccess>((BackupProtocolClientSuccess*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("GetBlockIndexByName command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("GetBlockIndexByName command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientSuccess> BackupProtocolClient::Query(const BackupProtocolClientUndeleteFile &rQuery)
{
	// Send query
	Send(rQuery);
	
	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 5)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientSuccess>((BackupProtocolClientSuccess*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("UndeleteFile command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("UndeleteFile command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientAccountUsage> BackupProtocolClient::Query(const BackupProtocolClientGetAccountUsage &rQuery)
{
	// Send query
	Send(rQuery);
	
	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 41)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientAccountUsage>((BackupProtocolClientAccountUsage*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("GetAccountUsage command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("GetAccountUsage command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
std::auto_ptr<BackupProtocolClientIsAlive> BackupProtocolClient::Query(const BackupProtocolClientGetIsAlive &rQuery)
{
	// Send query
	Send(rQuery);
	
	// Wait for the reply
	std::auto_ptr<BackupProtocolObjectCl> preply(Receive().release());

	if(preply->GetType() == 43)
	{
		// Correct response
		return std::auto_ptr<BackupProtocolClientIsAlive>((BackupProtocolClientIsAlive*)preply.release());
	}
	else
	{
		// Set protocol error
		int type, subType;
		if(preply->IsError(type, subType))
		{
			SetError(type, subType);
			BOX_WARNING("GetIsAlive command failed: received error " <<
				((BackupProtocolClientError&)*preply).GetMessage());
		}
		else
		{
			SetError(Protocol::UnknownError, Protocol::UnknownError);
			BOX_WARNING("GetIsAlive command failed: received "
				"unexpected response type " <<
				preply->GetType());
		}
		
		// Throw an exception
		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
	}
}
