#ifndef CLIENT_H
#define CLIENT_H

/*
 * @(#)Client.h
 *
 * This file is part of webCDwriter - Network CD Writing.
 *
 * Copyright (C) 2000-2004 Jörg P. M. Haeger
 *
 * webCDwriter is free software. See rcdrecord.cpp for details.
 */

#include <stdlib.h>

class Client {
	FILE *inStream, *outStream;
	int socket, verbose;
	int totalKB, oldFreeKB, newFreeKB;
	int CDwasClosed;
	int anonymousUse, copySupport, mp3, verify;

public:
	Client();
	void blank(const char *mode);
	void burnSession(class CommandArgs &args, int blankTOC);
	void client(const char *product, const char *version);
	void connect(const char *host, int port);
	int getAnonymousUse() { return anonymousUse; }
	void listSessions();
	void login(const char *id, const char *password);
	void mkdir(wchar_t *name, int mode, int lastModified);
	void newAccount(const char *userID, const char *eMail);
	void newSession(const char *id);
	void noop();
	void openSession(const char *id);
	void putFile(wchar_t *name,
		int length, int mode, int lastModified,
		FILE *inStream);
	void putTrack(const char *type, int length, const void *bytes);
	void quit();
	void readResult();
	void setFilesystem(int joliet, int rockRidge, int HFS);
	void setProtocol(int version);
	void setVerbose();
	static char *spaceToEsc(const char *str);
	static char *spaceToEsc(wchar_t *str);
	void system(const char *name, const char *version);
	void user(int id, const char *name);

private:
	void exec(const char *command,
		const char *arg1 = "",
		const char *arg2 = "",
		const char *arg3 = "");
};

#endif
