update dev300-m58
[ooovba.git] / sot / source / sdstor / stgio.hxx
blobf7a74b91e5ed941aa0b2f376f52f3c670d2e82e0
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: stgio.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _STGIO_HXX
32 #define _STGIO_HXX
34 #include <stgcache.hxx>
35 #include <stgelem.hxx>
36 #include <tools/string.hxx>
38 class StgFATStrm;
39 class StgDataStrm;
40 class StgDirStrm;
41 class String;
43 enum FAT_ERROR
45 FAT_OK,
46 FAT_WRONGLENGTH,
47 FAT_UNREFCHAIN,
48 FAT_OVERWRITE,
49 FAT_OUTOFBOUNDS,
51 FAT_INMEMORYERROR,
52 FAT_ONFILEERROR,
53 FAT_BOTHERROR
56 struct StgLinkArg
58 String aFile;
59 ULONG nErr;
62 class StgIo : public StgCache {
63 void SetupStreams(); // load all internal streams
64 BOOL bCopied;
65 public:
66 StgIo();
67 ~StgIo();
68 StgHeader aHdr; // storage file header
69 StgFATStrm* pFAT; // FAT stream
70 StgDirStrm* pTOC; // TOC stream
71 StgDataStrm* pDataFAT; // small data FAT stream
72 StgDataStrm* pDataStrm; // small data stream
73 short GetDataPageSize(); // get the logical data page size
74 BOOL Load(); // load a storage file
75 BOOL Init(); // set up an empty file
76 BOOL CommitAll(); // commit everything (root commit)
78 static void SetErrorLink( const Link& );
79 static const Link& GetErrorLink();
80 ULONG ValidateFATs( );
83 #endif