#ifndef WIN32
#include <syslog.h>
#endif

// Auto-generated file -- do not edit

#ifndef AUTOGEN_BACKUPPROTOCOLCLIENT_H
#define AUTOGEN_BACKUPPROTOCOLCLIENT_H

#include "Protocol.h"
#include "ProtocolObject.h"
#include "ServerException.h"

class IOStream;

#include <stdio.h>
#include "BackupStoreFilenameClear.h"

class BackupProtocolServer;
	
class BackupProtocolObjectCl : public ProtocolObject
{
public:
	BackupProtocolObjectCl();
	virtual ~BackupProtocolObjectCl();
	BackupProtocolObjectCl(const BackupProtocolObjectCl &rToCopy);
	
	virtual void LogSysLog(const char *Action) const = 0;
	virtual void LogFile(const char *Action, FILE *file) const = 0;

};
class BackupProtocolClientError : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientError();
	BackupProtocolClientError(const BackupProtocolClientError &rToCopy);
	~BackupProtocolClientError();
	int GetType() const;
	enum
	{
		TypeID = 0
	};
	enum
	{
		ErrorType = 1000,
		Err_WrongVersion = 1,
		Err_NotInRightProtocolPhase = 2,
		Err_BadLogin = 3,
		Err_CannotLockStoreForWriting = 4,
		Err_SessionReadOnly = 5,
		Err_FileDoesNotVerify = 6,
		Err_DoesNotExist = 7,
		Err_DirectoryAlreadyExists = 8,
		Err_CannotDeleteRoot = 9,
		Err_TargetNameExists = 10,
		Err_StorageLimitExceeded = 11,
		Err_DiffFromFileDoesNotExist = 12,
		Err_DoesNotExistInDirectory = 13,
		Err_PatchConsistencyError = 14
	};
	bool IsError(int &rTypeOut, int &rSubTypeOut) const;
	std::string GetMessage() const;
	void SetPropertiesFromStreamData(Protocol &rProtocol);
	int32_t GetType() {return mType;}
	int32_t GetSubType() {return mSubType;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int32_t mType;
	int32_t mSubType;
};

class BackupProtocolClientVersion : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientVersion();
	BackupProtocolClientVersion(const BackupProtocolClientVersion &rToCopy);
	~BackupProtocolClientVersion();
	int GetType() const;
	enum
	{
		TypeID = 1
	};
	void SetPropertiesFromStreamData(Protocol &rProtocol);
	int32_t GetVersion() {return mVersion;}
	BackupProtocolClientVersion(int32_t Version);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetVersion(int32_t Version) {mVersion = Version;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int32_t mVersion;
};

class BackupProtocolClientLogin : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientLogin();
	BackupProtocolClientLogin(const BackupProtocolClientLogin &rToCopy);
	~BackupProtocolClientLogin();
	int GetType() const;
	enum
	{
		TypeID = 2
	};
	enum
	{
		Flags_ReadOnly = 1
	};
	BackupProtocolClientLogin(int32_t ClientID, int32_t Flags);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetClientID(int32_t ClientID) {mClientID = ClientID;}
	void SetFlags(int32_t Flags) {mFlags = Flags;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int32_t mClientID;
	int32_t mFlags;
};

class BackupProtocolClientLoginConfirmed : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientLoginConfirmed();
	BackupProtocolClientLoginConfirmed(const BackupProtocolClientLoginConfirmed &rToCopy);
	~BackupProtocolClientLoginConfirmed();
	int GetType() const;
	enum
	{
		TypeID = 3
	};
	void SetPropertiesFromStreamData(Protocol &rProtocol);
	int64_t GetClientStoreMarker() {return mClientStoreMarker;}
	int64_t GetBlocksUsed() {return mBlocksUsed;}
	int64_t GetBlocksSoftLimit() {return mBlocksSoftLimit;}
	int64_t GetBlocksHardLimit() {return mBlocksHardLimit;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mClientStoreMarker;
	int64_t mBlocksUsed;
	int64_t mBlocksSoftLimit;
	int64_t mBlocksHardLimit;
};

class BackupProtocolClientFinished : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientFinished();
	BackupProtocolClientFinished(const BackupProtocolClientFinished &rToCopy);
	~BackupProtocolClientFinished();
	int GetType() const;
	enum
	{
		TypeID = 4
	};
	bool IsConversationEnd() const;
	void SetPropertiesFromStreamData(Protocol &rProtocol);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
};

class BackupProtocolClientSuccess : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientSuccess();
	BackupProtocolClientSuccess(const BackupProtocolClientSuccess &rToCopy);
	~BackupProtocolClientSuccess();
	int GetType() const;
	enum
	{
		TypeID = 5
	};
	void SetPropertiesFromStreamData(Protocol &rProtocol);
	int64_t GetObjectID() {return mObjectID;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mObjectID;
};

class BackupProtocolClientSetClientStoreMarker : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientSetClientStoreMarker();
	BackupProtocolClientSetClientStoreMarker(const BackupProtocolClientSetClientStoreMarker &rToCopy);
	~BackupProtocolClientSetClientStoreMarker();
	int GetType() const;
	enum
	{
		TypeID = 6
	};
	BackupProtocolClientSetClientStoreMarker(int64_t ClientStoreMarker);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetClientStoreMarker(int64_t ClientStoreMarker) {mClientStoreMarker = ClientStoreMarker;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mClientStoreMarker;
};

class BackupProtocolClientGetObject : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientGetObject();
	BackupProtocolClientGetObject(const BackupProtocolClientGetObject &rToCopy);
	~BackupProtocolClientGetObject();
	int GetType() const;
	enum
	{
		TypeID = 10
	};
	enum
	{
		NoObject = 0
	};
	BackupProtocolClientGetObject(int64_t ObjectID);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetObjectID(int64_t ObjectID) {mObjectID = ObjectID;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mObjectID;
};

class BackupProtocolClientMoveObject : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientMoveObject();
	BackupProtocolClientMoveObject(const BackupProtocolClientMoveObject &rToCopy);
	~BackupProtocolClientMoveObject();
	int GetType() const;
	enum
	{
		TypeID = 11
	};
	enum
	{
		Flags_MoveAllWithSameName = 1,
		Flags_AllowMoveOverDeletedObject = 2
	};
	BackupProtocolClientMoveObject(int64_t ObjectID, int64_t MoveFromDirectory, int64_t MoveToDirectory, int32_t Flags, const BackupStoreFilenameClear& NewFilename);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetObjectID(int64_t ObjectID) {mObjectID = ObjectID;}
	void SetMoveFromDirectory(int64_t MoveFromDirectory) {mMoveFromDirectory = MoveFromDirectory;}
	void SetMoveToDirectory(int64_t MoveToDirectory) {mMoveToDirectory = MoveToDirectory;}
	void SetFlags(int32_t Flags) {mFlags = Flags;}
	void SetNewFilename(const BackupStoreFilenameClear& NewFilename) {mNewFilename = NewFilename;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mObjectID;
	int64_t mMoveFromDirectory;
	int64_t mMoveToDirectory;
	int32_t mFlags;
	BackupStoreFilenameClear mNewFilename;
};

class BackupProtocolClientGetObjectName : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientGetObjectName();
	BackupProtocolClientGetObjectName(const BackupProtocolClientGetObjectName &rToCopy);
	~BackupProtocolClientGetObjectName();
	int GetType() const;
	enum
	{
		TypeID = 12
	};
	enum
	{
		ObjectID_DirectoryOnly = 0
	};
	BackupProtocolClientGetObjectName(int64_t ObjectID, int64_t ContainingDirectoryID);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetObjectID(int64_t ObjectID) {mObjectID = ObjectID;}
	void SetContainingDirectoryID(int64_t ContainingDirectoryID) {mContainingDirectoryID = ContainingDirectoryID;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mObjectID;
	int64_t mContainingDirectoryID;
};

class BackupProtocolClientObjectName : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientObjectName();
	BackupProtocolClientObjectName(const BackupProtocolClientObjectName &rToCopy);
	~BackupProtocolClientObjectName();
	int GetType() const;
	enum
	{
		TypeID = 13
	};
	enum
	{
		NumNameElements_ObjectDoesntExist = 0
	};
	void SetPropertiesFromStreamData(Protocol &rProtocol);
	int32_t GetNumNameElements() {return mNumNameElements;}
	int64_t GetModificationTime() {return mModificationTime;}
	int64_t GetAttributesHash() {return mAttributesHash;}
	int16_t GetFlags() {return mFlags;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int32_t mNumNameElements;
	int64_t mModificationTime;
	int64_t mAttributesHash;
	int16_t mFlags;
};

class BackupProtocolClientCreateDirectory : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientCreateDirectory();
	BackupProtocolClientCreateDirectory(const BackupProtocolClientCreateDirectory &rToCopy);
	~BackupProtocolClientCreateDirectory();
	int GetType() const;
	enum
	{
		TypeID = 20
	};
	BackupProtocolClientCreateDirectory(int64_t ContainingDirectoryID, int64_t AttributesModTime, const BackupStoreFilenameClear& DirectoryName);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetContainingDirectoryID(int64_t ContainingDirectoryID) {mContainingDirectoryID = ContainingDirectoryID;}
	void SetAttributesModTime(int64_t AttributesModTime) {mAttributesModTime = AttributesModTime;}
	void SetDirectoryName(const BackupStoreFilenameClear& DirectoryName) {mDirectoryName = DirectoryName;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mContainingDirectoryID;
	int64_t mAttributesModTime;
	BackupStoreFilenameClear mDirectoryName;
};

class BackupProtocolClientListDirectory : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientListDirectory();
	BackupProtocolClientListDirectory(const BackupProtocolClientListDirectory &rToCopy);
	~BackupProtocolClientListDirectory();
	int GetType() const;
	enum
	{
		TypeID = 21
	};
	enum
	{
		Flags_INCLUDE_EVERYTHING = -1,
		Flags_EXCLUDE_NOTHING = 0,
		Flags_EXCLUDE_EVERYTHING = 15,
		Flags_File = 1,
		Flags_Dir = 2,
		Flags_Deleted = 4,
		Flags_OldVersion = 8,
		RootDirectory = 1
	};
	BackupProtocolClientListDirectory(int64_t ObjectID, int16_t FlagsMustBeSet, int16_t FlagsNotToBeSet, bool SendAttributes);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetObjectID(int64_t ObjectID) {mObjectID = ObjectID;}
	void SetFlagsMustBeSet(int16_t FlagsMustBeSet) {mFlagsMustBeSet = FlagsMustBeSet;}
	void SetFlagsNotToBeSet(int16_t FlagsNotToBeSet) {mFlagsNotToBeSet = FlagsNotToBeSet;}
	void SetSendAttributes(bool SendAttributes) {mSendAttributes = SendAttributes;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mObjectID;
	int16_t mFlagsMustBeSet;
	int16_t mFlagsNotToBeSet;
	bool mSendAttributes;
};

class BackupProtocolClientChangeDirAttributes : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientChangeDirAttributes();
	BackupProtocolClientChangeDirAttributes(const BackupProtocolClientChangeDirAttributes &rToCopy);
	~BackupProtocolClientChangeDirAttributes();
	int GetType() const;
	enum
	{
		TypeID = 22
	};
	BackupProtocolClientChangeDirAttributes(int64_t ObjectID, int64_t AttributesModTime);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetObjectID(int64_t ObjectID) {mObjectID = ObjectID;}
	void SetAttributesModTime(int64_t AttributesModTime) {mAttributesModTime = AttributesModTime;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mObjectID;
	int64_t mAttributesModTime;
};

class BackupProtocolClientDeleteDirectory : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientDeleteDirectory();
	BackupProtocolClientDeleteDirectory(const BackupProtocolClientDeleteDirectory &rToCopy);
	~BackupProtocolClientDeleteDirectory();
	int GetType() const;
	enum
	{
		TypeID = 23
	};
	BackupProtocolClientDeleteDirectory(int64_t ObjectID);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetObjectID(int64_t ObjectID) {mObjectID = ObjectID;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mObjectID;
};

class BackupProtocolClientUndeleteDirectory : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientUndeleteDirectory();
	BackupProtocolClientUndeleteDirectory(const BackupProtocolClientUndeleteDirectory &rToCopy);
	~BackupProtocolClientUndeleteDirectory();
	int GetType() const;
	enum
	{
		TypeID = 24
	};
	BackupProtocolClientUndeleteDirectory(int64_t ObjectID);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetObjectID(int64_t ObjectID) {mObjectID = ObjectID;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mObjectID;
};

class BackupProtocolClientStoreFile : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientStoreFile();
	BackupProtocolClientStoreFile(const BackupProtocolClientStoreFile &rToCopy);
	~BackupProtocolClientStoreFile();
	int GetType() const;
	enum
	{
		TypeID = 30
	};
	BackupProtocolClientStoreFile(int64_t DirectoryObjectID, int64_t ModificationTime, int64_t AttributesHash, int64_t DiffFromFileID, const BackupStoreFilenameClear& Filename);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetDirectoryObjectID(int64_t DirectoryObjectID) {mDirectoryObjectID = DirectoryObjectID;}
	void SetModificationTime(int64_t ModificationTime) {mModificationTime = ModificationTime;}
	void SetAttributesHash(int64_t AttributesHash) {mAttributesHash = AttributesHash;}
	void SetDiffFromFileID(int64_t DiffFromFileID) {mDiffFromFileID = DiffFromFileID;}
	void SetFilename(const BackupStoreFilenameClear& Filename) {mFilename = Filename;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mDirectoryObjectID;
	int64_t mModificationTime;
	int64_t mAttributesHash;
	int64_t mDiffFromFileID;
	BackupStoreFilenameClear mFilename;
};

class BackupProtocolClientGetFile : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientGetFile();
	BackupProtocolClientGetFile(const BackupProtocolClientGetFile &rToCopy);
	~BackupProtocolClientGetFile();
	int GetType() const;
	enum
	{
		TypeID = 31
	};
	BackupProtocolClientGetFile(int64_t InDirectory, int64_t ObjectID);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetInDirectory(int64_t InDirectory) {mInDirectory = InDirectory;}
	void SetObjectID(int64_t ObjectID) {mObjectID = ObjectID;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mInDirectory;
	int64_t mObjectID;
};

class BackupProtocolClientSetReplacementFileAttributes : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientSetReplacementFileAttributes();
	BackupProtocolClientSetReplacementFileAttributes(const BackupProtocolClientSetReplacementFileAttributes &rToCopy);
	~BackupProtocolClientSetReplacementFileAttributes();
	int GetType() const;
	enum
	{
		TypeID = 32
	};
	BackupProtocolClientSetReplacementFileAttributes(int64_t InDirectory, int64_t AttributesHash, const BackupStoreFilenameClear& Filename);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetInDirectory(int64_t InDirectory) {mInDirectory = InDirectory;}
	void SetAttributesHash(int64_t AttributesHash) {mAttributesHash = AttributesHash;}
	void SetFilename(const BackupStoreFilenameClear& Filename) {mFilename = Filename;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mInDirectory;
	int64_t mAttributesHash;
	BackupStoreFilenameClear mFilename;
};

class BackupProtocolClientDeleteFile : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientDeleteFile();
	BackupProtocolClientDeleteFile(const BackupProtocolClientDeleteFile &rToCopy);
	~BackupProtocolClientDeleteFile();
	int GetType() const;
	enum
	{
		TypeID = 33
	};
	BackupProtocolClientDeleteFile(int64_t InDirectory, const BackupStoreFilenameClear& Filename);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetInDirectory(int64_t InDirectory) {mInDirectory = InDirectory;}
	void SetFilename(const BackupStoreFilenameClear& Filename) {mFilename = Filename;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mInDirectory;
	BackupStoreFilenameClear mFilename;
};

class BackupProtocolClientGetBlockIndexByID : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientGetBlockIndexByID();
	BackupProtocolClientGetBlockIndexByID(const BackupProtocolClientGetBlockIndexByID &rToCopy);
	~BackupProtocolClientGetBlockIndexByID();
	int GetType() const;
	enum
	{
		TypeID = 34
	};
	BackupProtocolClientGetBlockIndexByID(int64_t ObjectID);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetObjectID(int64_t ObjectID) {mObjectID = ObjectID;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mObjectID;
};

class BackupProtocolClientGetBlockIndexByName : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientGetBlockIndexByName();
	BackupProtocolClientGetBlockIndexByName(const BackupProtocolClientGetBlockIndexByName &rToCopy);
	~BackupProtocolClientGetBlockIndexByName();
	int GetType() const;
	enum
	{
		TypeID = 35
	};
	BackupProtocolClientGetBlockIndexByName(int64_t InDirectory, const BackupStoreFilenameClear& Filename);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetInDirectory(int64_t InDirectory) {mInDirectory = InDirectory;}
	void SetFilename(const BackupStoreFilenameClear& Filename) {mFilename = Filename;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mInDirectory;
	BackupStoreFilenameClear mFilename;
};

class BackupProtocolClientUndeleteFile : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientUndeleteFile();
	BackupProtocolClientUndeleteFile(const BackupProtocolClientUndeleteFile &rToCopy);
	~BackupProtocolClientUndeleteFile();
	int GetType() const;
	enum
	{
		TypeID = 36
	};
	BackupProtocolClientUndeleteFile(int64_t InDirectory, int64_t ObjectID);
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	void SetInDirectory(int64_t InDirectory) {mInDirectory = InDirectory;}
	void SetObjectID(int64_t ObjectID) {mObjectID = ObjectID;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mInDirectory;
	int64_t mObjectID;
};

class BackupProtocolClientGetAccountUsage : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientGetAccountUsage();
	BackupProtocolClientGetAccountUsage(const BackupProtocolClientGetAccountUsage &rToCopy);
	~BackupProtocolClientGetAccountUsage();
	int GetType() const;
	enum
	{
		TypeID = 40
	};
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
};

class BackupProtocolClientAccountUsage : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientAccountUsage();
	BackupProtocolClientAccountUsage(const BackupProtocolClientAccountUsage &rToCopy);
	~BackupProtocolClientAccountUsage();
	int GetType() const;
	enum
	{
		TypeID = 41
	};
	void SetPropertiesFromStreamData(Protocol &rProtocol);
	int64_t GetBlocksUsed() {return mBlocksUsed;}
	int64_t GetBlocksInOldFiles() {return mBlocksInOldFiles;}
	int64_t GetBlocksInDeletedFiles() {return mBlocksInDeletedFiles;}
	int64_t GetBlocksInDirectories() {return mBlocksInDirectories;}
	int64_t GetBlocksSoftLimit() {return mBlocksSoftLimit;}
	int64_t GetBlocksHardLimit() {return mBlocksHardLimit;}
	int32_t GetBlockSize() {return mBlockSize;}
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
	int64_t mBlocksUsed;
	int64_t mBlocksInOldFiles;
	int64_t mBlocksInDeletedFiles;
	int64_t mBlocksInDirectories;
	int64_t mBlocksSoftLimit;
	int64_t mBlocksHardLimit;
	int32_t mBlockSize;
};

class BackupProtocolClientGetIsAlive : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientGetIsAlive();
	BackupProtocolClientGetIsAlive(const BackupProtocolClientGetIsAlive &rToCopy);
	~BackupProtocolClientGetIsAlive();
	int GetType() const;
	enum
	{
		TypeID = 42
	};
	void WritePropertiesToStreamData(Protocol &rProtocol) const;
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
};

class BackupProtocolClientIsAlive : public BackupProtocolObjectCl
{
public:
	BackupProtocolClientIsAlive();
	BackupProtocolClientIsAlive(const BackupProtocolClientIsAlive &rToCopy);
	~BackupProtocolClientIsAlive();
	int GetType() const;
	enum
	{
		TypeID = 43
	};
	void SetPropertiesFromStreamData(Protocol &rProtocol);
	virtual void LogSysLog(const char *Action) const;
	virtual void LogFile(const char *Action, FILE *file) const;
private:
};

class BackupProtocolClient : public Protocol
{
public:
	BackupProtocolClient(IOStream &rStream);
	virtual ~BackupProtocolClient();

	std::auto_ptr<BackupProtocolObjectCl> Receive();
	void Send(const BackupProtocolObjectCl &rObject);
	void SetLogToSysLog(bool Log = false) {mLogToSysLog = Log;}
	void SetLogToFile(FILE *File = 0) {mLogToFile = File;}
	std::auto_ptr<BackupProtocolClientVersion> Query(const BackupProtocolClientVersion &rQuery);
	std::auto_ptr<BackupProtocolClientLoginConfirmed> Query(const BackupProtocolClientLogin &rQuery);
	std::auto_ptr<BackupProtocolClientFinished> Query(const BackupProtocolClientFinished &rQuery);
	std::auto_ptr<BackupProtocolClientSuccess> Query(const BackupProtocolClientSetClientStoreMarker &rQuery);
	std::auto_ptr<BackupProtocolClientSuccess> Query(const BackupProtocolClientGetObject &rQuery);
	std::auto_ptr<BackupProtocolClientSuccess> Query(const BackupProtocolClientMoveObject &rQuery);
	std::auto_ptr<BackupProtocolClientObjectName> Query(const BackupProtocolClientGetObjectName &rQuery);
	std::auto_ptr<BackupProtocolClientSuccess> Query(const BackupProtocolClientCreateDirectory &rQuery, IOStream &rStream);
	std::auto_ptr<BackupProtocolClientSuccess> Query(const BackupProtocolClientListDirectory &rQuery);
	std::auto_ptr<BackupProtocolClientSuccess> Query(const BackupProtocolClientChangeDirAttributes &rQuery, IOStream &rStream);
	std::auto_ptr<BackupProtocolClientSuccess> Query(const BackupProtocolClientDeleteDirectory &rQuery);
	std::auto_ptr<BackupProtocolClientSuccess> Query(const BackupProtocolClientUndeleteDirectory &rQuery);
	std::auto_ptr<BackupProtocolClientSuccess> Query(const BackupProtocolClientStoreFile &rQuery, IOStream &rStream);
	std::auto_ptr<BackupProtocolClientSuccess> Query(const BackupProtocolClientGetFile &rQuery);
	std::auto_ptr<BackupProtocolClientSuccess> Query(const BackupProtocolClientSetReplacementFileAttributes &rQuery, IOStream &rStream);
	std::auto_ptr<BackupProtocolClientSuccess> Query(const BackupProtocolClientDeleteFile &rQuery);
	std::auto_ptr<BackupProtocolClientSuccess> Query(const BackupProtocolClientGetBlockIndexByID &rQuery);
	std::auto_ptr<BackupProtocolClientSuccess> Query(const BackupProtocolClientGetBlockIndexByName &rQuery);
	std::auto_ptr<BackupProtocolClientSuccess> Query(const BackupProtocolClientUndeleteFile &rQuery);
	std::auto_ptr<BackupProtocolClientAccountUsage> Query(const BackupProtocolClientGetAccountUsage &rQuery);
	std::auto_ptr<BackupProtocolClientIsAlive> Query(const BackupProtocolClientGetIsAlive &rQuery);

	inline std::auto_ptr<BackupProtocolClientVersion> QueryVersion(int32_t Version)
	{
		BackupProtocolClientVersion send(Version);
		return Query(send);
	}
	inline std::auto_ptr<BackupProtocolClientLoginConfirmed> QueryLogin(int32_t ClientID, int32_t Flags)
	{
		BackupProtocolClientLogin send(ClientID, Flags);
		return Query(send);
	}
	inline std::auto_ptr<BackupProtocolClientFinished> QueryFinished()
	{
		BackupProtocolClientFinished send;
		return Query(send);
	}
	inline std::auto_ptr<BackupProtocolClientSuccess> QuerySetClientStoreMarker(int64_t ClientStoreMarker)
	{
		BackupProtocolClientSetClientStoreMarker send(ClientStoreMarker);
		return Query(send);
	}
	inline std::auto_ptr<BackupProtocolClientSuccess> QueryGetObject(int64_t ObjectID)
	{
		BackupProtocolClientGetObject send(ObjectID);
		return Query(send);
	}
	inline std::auto_ptr<BackupProtocolClientSuccess> QueryMoveObject(int64_t ObjectID, int64_t MoveFromDirectory, int64_t MoveToDirectory, int32_t Flags, const BackupStoreFilenameClear& NewFilename)
	{
		BackupProtocolClientMoveObject send(ObjectID, MoveFromDirectory, MoveToDirectory, Flags, NewFilename);
		return Query(send);
	}
	inline std::auto_ptr<BackupProtocolClientObjectName> QueryGetObjectName(int64_t ObjectID, int64_t ContainingDirectoryID)
	{
		BackupProtocolClientGetObjectName send(ObjectID, ContainingDirectoryID);
		return Query(send);
	}
	inline std::auto_ptr<BackupProtocolClientSuccess> QueryCreateDirectory(int64_t ContainingDirectoryID, int64_t AttributesModTime, const BackupStoreFilenameClear& DirectoryName, IOStream &rStream)
	{
		BackupProtocolClientCreateDirectory send(ContainingDirectoryID, AttributesModTime, DirectoryName);
		return Query(send, rStream);
	}
	inline std::auto_ptr<BackupProtocolClientSuccess> QueryListDirectory(int64_t ObjectID, int16_t FlagsMustBeSet, int16_t FlagsNotToBeSet, bool SendAttributes)
	{
		BackupProtocolClientListDirectory send(ObjectID, FlagsMustBeSet, FlagsNotToBeSet, SendAttributes);
		return Query(send);
	}
	inline std::auto_ptr<BackupProtocolClientSuccess> QueryChangeDirAttributes(int64_t ObjectID, int64_t AttributesModTime, IOStream &rStream)
	{
		BackupProtocolClientChangeDirAttributes send(ObjectID, AttributesModTime);
		return Query(send, rStream);
	}
	inline std::auto_ptr<BackupProtocolClientSuccess> QueryDeleteDirectory(int64_t ObjectID)
	{
		BackupProtocolClientDeleteDirectory send(ObjectID);
		return Query(send);
	}
	inline std::auto_ptr<BackupProtocolClientSuccess> QueryUndeleteDirectory(int64_t ObjectID)
	{
		BackupProtocolClientUndeleteDirectory send(ObjectID);
		return Query(send);
	}
	inline std::auto_ptr<BackupProtocolClientSuccess> QueryStoreFile(int64_t DirectoryObjectID, int64_t ModificationTime, int64_t AttributesHash, int64_t DiffFromFileID, const BackupStoreFilenameClear& Filename, IOStream &rStream)
	{
		BackupProtocolClientStoreFile send(DirectoryObjectID, ModificationTime, AttributesHash, DiffFromFileID, Filename);
		return Query(send, rStream);
	}
	inline std::auto_ptr<BackupProtocolClientSuccess> QueryGetFile(int64_t InDirectory, int64_t ObjectID)
	{
		BackupProtocolClientGetFile send(InDirectory, ObjectID);
		return Query(send);
	}
	inline std::auto_ptr<BackupProtocolClientSuccess> QuerySetReplacementFileAttributes(int64_t InDirectory, int64_t AttributesHash, const BackupStoreFilenameClear& Filename, IOStream &rStream)
	{
		BackupProtocolClientSetReplacementFileAttributes send(InDirectory, AttributesHash, Filename);
		return Query(send, rStream);
	}
	inline std::auto_ptr<BackupProtocolClientSuccess> QueryDeleteFile(int64_t InDirectory, const BackupStoreFilenameClear& Filename)
	{
		BackupProtocolClientDeleteFile send(InDirectory, Filename);
		return Query(send);
	}
	inline std::auto_ptr<BackupProtocolClientSuccess> QueryGetBlockIndexByID(int64_t ObjectID)
	{
		BackupProtocolClientGetBlockIndexByID send(ObjectID);
		return Query(send);
	}
	inline std::auto_ptr<BackupProtocolClientSuccess> QueryGetBlockIndexByName(int64_t InDirectory, const BackupStoreFilenameClear& Filename)
	{
		BackupProtocolClientGetBlockIndexByName send(InDirectory, Filename);
		return Query(send);
	}
	inline std::auto_ptr<BackupProtocolClientSuccess> QueryUndeleteFile(int64_t InDirectory, int64_t ObjectID)
	{
		BackupProtocolClientUndeleteFile send(InDirectory, ObjectID);
		return Query(send);
	}
	inline std::auto_ptr<BackupProtocolClientAccountUsage> QueryGetAccountUsage()
	{
		BackupProtocolClientGetAccountUsage send;
		return Query(send);
	}
	inline std::auto_ptr<BackupProtocolClientIsAlive> QueryGetIsAlive()
	{
		BackupProtocolClientGetIsAlive send;
		return Query(send);
	}

private:
	BackupProtocolClient(const BackupProtocolClient &rToCopy);
	virtual void InformStreamReceiving(u_int32_t Size);
	virtual void InformStreamSending(u_int32_t Size);
private:
	bool mLogToSysLog;
private:
	FILE *mLogToFile;

protected:	
	virtual std::auto_ptr<ProtocolObject> MakeProtocolObject(int ObjType);
	virtual const char *GetIdentString();
};

#endif // AUTOGEN_BACKUPPROTOCOLCLIENT_H

