LibreOffice Module filter (master) 1
dffrecordheader.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_FILTER_MSFILTER_DFFRECORDHEADER_HXX
21#define INCLUDED_FILTER_MSFILTER_DFFRECORDHEADER_HXX
22
24#include <svx/msdffdef.hxx>
25#include <sal/types.h>
26#include <tools/solar.h>
27#include <tools/stream.hxx>
28
30{
31public:
32 sal_uInt8 nRecVer; // may be DFF_PSFLAG_CONTAINER
33 sal_uInt16 nRecInstance;
34 sal_uInt16 nImpVerInst;
35 sal_uInt16 nRecType;
36 sal_uInt32 nRecLen;
38
39 DffRecordHeader() : nRecVer(0), nRecInstance(0), nImpVerInst(0),
40 nRecType(0), nRecLen(0), nFilePos(0) {}
41 bool IsContainer() const { return nRecVer == DFF_PSFLAG_CONTAINER; }
42 sal_uLong GetRecBegFilePos() const { return nFilePos; }
44 { return nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen; }
45 bool SeekToEndOfRecord(SvStream& rIn) const
46 {
47 sal_uInt64 const nPos = nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen;
48 return checkSeek(rIn, nPos);
49 }
50 bool SeekToContent(SvStream& rIn) const
51 {
52 sal_uInt64 const nPos = nFilePos + DFF_COMMON_RECORD_HEADER_SIZE;
53 return checkSeek(rIn, nPos);
54 }
55 bool SeekToBegOfRecord(SvStream& rIn) const
56 {
57 return checkSeek(rIn, nFilePos);
58 }
59
61};
62
63#endif
64/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uLong GetRecEndFilePos() const
bool SeekToEndOfRecord(SvStream &rIn) const
sal_uLong GetRecBegFilePos() const
bool SeekToBegOfRecord(SvStream &rIn) const
sal_uInt16 nRecInstance
bool IsContainer() const
sal_uInt16 nImpVerInst
bool SeekToContent(SvStream &rIn) const
bool ReadDffRecordHeader(SvStream &rIn, DffRecordHeader &rRec)
sal_uInt16 nPos
#define DFF_COMMON_RECORD_HEADER_SIZE
#define DFF_PSFLAG_CONTAINER
#define MSFILTER_DLLPUBLIC
sal_uIntPtr sal_uLong
TOOLS_DLLPUBLIC bool checkSeek(SvStream &rSt, sal_uInt64 nOffset)
unsigned char sal_uInt8