summaryrefslogtreecommitdiffstats
path: root/src/modules/objects/class_file.h
blob: 01a54d192d3f0dd17382aa886b35207d0f38bd69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#ifndef	_CLASS_FILE_H_
#define	_CLASS_FILE_H_
//vim: ts=8
//   File : class_file.h
//   Creation date : Thu Sep 21 04:43:01 CEST 2000 by Krzysztof Godlewski 
//
//   This file is part of the KVirc irc client distribution
//   Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net)
//
//   This program is FREE software. You can redistribute it and/or
//   modify it under the terms of the GNU General Public License
//   as published by the Free Software Foundation; either version 2
//   of the License, or (at your opinion) any later version.
//
//   This program is distributed in the HOPE that it will be USEFUL,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//   See the GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with this program. If not, write to the Free Software Foundation,
//   Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//



#include <qfile.h>
#include <qtextstream.h>
#include "kvi_string.h"


/*
//class KviCommand;
class KviParameterList;

class KviScriptFileObject : public KviScriptObject
{
	Q_OBJECT
public:
	KviScriptFileObject(KviScriptObjectClass *, KviScriptObject *, const char *);
	virtual ~KviScriptFileObject();

	static void registerSelf();
	static void unregisterSelf();

protected:
	bool functionSetName(KviCommand *, KviParameterList *, KviStr &);
	bool functionName(KviCommand *, KviParameterList *, KviStr &);
	bool functionOpen(KviCommand *, KviParameterList *, KviStr &);
	bool functionIsOpen(KviCommand *, KviParameterList *, KviStr &);
	bool functionClose(KviCommand *, KviParameterList *, KviStr &);
	bool functionFlush(KviCommand *, KviParameterList *, KviStr &);
	bool functionSize(KviCommand *, KviParameterList *, KviStr &);
	
	bool functionAtEnd(KviCommand *, KviParameterList *, KviStr &);
		// int QFile at() const
	bool functionWhere(KviCommand *, KviParameterList *, KviStr &);
		// void QFile at(int)
	bool functionSeek(KviCommand *, KviParameterList *, KviStr &);
	bool functionPutch(KviCommand *, KviParameterList *, KviStr &);
	bool functionGetch(KviCommand *, KviParameterList *, KviStr &);
	bool functionUngetch(KviCommand *, KviParameterList *, KviStr &);
	
	bool functionReadBlock(KviCommand *, KviParameterList *, KviStr &);
	bool functionWriteBlock(KviCommand *, KviParameterList *, KviStr &);

	bool functionReadLine(KviCommand *, KviParameterList *, KviStr &);
	bool functionWriteLine(KviCommand *, KviParameterList *, KviStr &);
	bool functionHexWrite(KviCommand *, KviParameterList *, KviStr &);
	bool functionHexRead(KviCommand *, KviParameterList *, KviStr &);
	
protected:
	QFile * m_pFile;
};

*/

#include "object_macros.h"

class KviKvsObject_file : public KviKvsObject
{
public:
	KVSO_DECLARE_OBJECT(KviKvsObject_file)
protected:
  	bool functionsetName(KviKvsObjectFunctionCall *c);
	bool functionname(KviKvsObjectFunctionCall *c);
	bool functionopen(KviKvsObjectFunctionCall *c);
	bool functionisOpen(KviKvsObjectFunctionCall *c);
	bool functionclose(KviKvsObjectFunctionCall *c);
	bool functionflush(KviKvsObjectFunctionCall *c);
	bool functionsize(KviKvsObjectFunctionCall *c);
	
	bool functionatEnd(KviKvsObjectFunctionCall *c);
		// int QFile at() const
	bool functionwhere(KviKvsObjectFunctionCall *c);
		// void QFile at(int)
	bool functionseek(KviKvsObjectFunctionCall *c);
	bool functionputch(KviKvsObjectFunctionCall *c);
	bool functiongetch(KviKvsObjectFunctionCall *c);
	bool functionunGetch(KviKvsObjectFunctionCall *c);
	
	bool functionreadBlock(KviKvsObjectFunctionCall *c);
	bool functionwriteBlock(KviKvsObjectFunctionCall *c);

	bool functionreadLine(KviKvsObjectFunctionCall *c);
	bool functionwriteLine(KviKvsObjectFunctionCall *c);
/*	bool functionHexWrite(KviKvsObjectFunctionCall *c);
	bool functionHexRead(KviKvsObjectFunctionCall *c);
*/
protected:
	QFile * m_pFile;
};
#endif	// !_CLASS_FILE_H_