myfile.h
1/* This file is part of the KDE project
2 Copyright (C) 1999 Werner Trobin <trobin@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18
19DESCRIPTION
20
21 A data-structure to hold the file data for an OLE stream. Shared storage is
22 used to implement reference counting and storage reclamation.
23*/
24
25#ifndef MYFILE_H
26#define MYFILE_H
27
28#include <tqcstring.h>
29
30class myFile: public TQByteArray
31{
32public:
33 myFile() { data = 0L; length = 0; }
34
35 // NOTE: this implementation may look completely ugly, but its features are
36 // mostly for backwards compatibility. If you feel like cleaning up, be my
37 // guest!
38
39 const unsigned char *data;
40 unsigned int length;
41
42 void setRawData(const unsigned char *data, unsigned length)
43 {
44 this->data = data;
45 this->length = length;
46 TQByteArray::setRawData((const char *)data, length);
47 }
48};
49#endif // MYFILE_H