~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to parts/documentation/protocols/chm/chmfile.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2006-05-23 18:39:42 UTC
  • Revision ID: james.westby@ubuntu.com-20060523183942-hucifbvh68k2bwz7
Tags: upstream-3.3.2
Import upstream version 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  This library is free software; you can redistribute it and/or
 
2
    modify it under the terms of the GNU Library General Public
 
3
    License as published by the Free Software Foundation; either
 
4
    version 2 of the License, or (at your option) any later version.
 
5
 
 
6
    This library is distributed in the hope that it will be useful,
 
7
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
8
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
9
    Library General Public License for more details.
 
10
 
 
11
    You should have received a copy of the GNU Library General Public License
 
12
    along with this library; see the file COPYING.LIB.  If not, write to
 
13
    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
14
    Boston, MA 02111-1307, USA.
 
15
*/
 
16
 
 
17
#ifndef __chmfile_h__
 
18
#define __chmfile_h__
 
19
 
 
20
#include <cstdio>
 
21
#include <qmap.h>
 
22
#include <qstring.h>
 
23
 
 
24
class QFile;
 
25
 
 
26
struct ChmDirTableEntry
 
27
{
 
28
    ChmDirTableEntry() : section(0), offset(0), length(0) {}
 
29
    ChmDirTableEntry( uint s, uint o, uint l )
 
30
        : section(s), offset(o), length(l) {}
 
31
 
 
32
    uint section;
 
33
    uint offset;
 
34
    uint length;
 
35
};
 
36
 
 
37
typedef QMap<QString, ChmDirTableEntry> ChmDirectoryMap;
 
38
 
 
39
class Chm
 
40
{
 
41
public:
 
42
    bool read( const QString&, ChmDirectoryMap&, QByteArray& ) const;
 
43
 
 
44
private:
 
45
    bool getChunk( QFile&, uint, ChmDirectoryMap& ) const;
 
46
    uint getEncInt( QFile&, uint& ) const;
 
47
    uint getName( QFile&, QString& ) const;
 
48
    uint getIntel32( QFile& ) const;
 
49
    uint getIntel64( QFile& ) const;
 
50
};
 
51
 
 
52
#endif // __chmfile_h__
 
53