1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
22 #include <filter/msfilter/dffrecordheader.hxx>
31 /** imports this atom and its child atoms */
32 static Atom
* import(const DffRecordHeader
& rRootRecordHeader
, SvStream
& rStCtrl
);
34 /** @return true if at least one atom with the given nRecType is found */
35 inline bool hasChildAtom(sal_uInt16 nRecType
) const;
37 /** @return the first child atom with nRecType or NULL */
38 inline const Atom
* findFirstChildAtom(sal_uInt16 nRecType
) const;
40 /** @return the next child atom after pLast with nRecType or NULL */
41 const Atom
* findNextChildAtom(sal_uInt16 nRecType
, const Atom
* pLast
) const;
43 /** @return the first child atom or NULL */
44 inline const Atom
* findFirstChildAtom() const;
46 /** @return the next child atom after pLast or NULL */
47 static inline const Atom
* findNextChildAtom(const Atom
* pLast
);
49 /** @return true if this atom is a container */
50 inline bool isContainer() const;
52 /** seeks to the contents of this atom */
53 inline bool seekToContent() const;
55 /** @return the record type */
56 inline sal_uInt16
getType() const;
58 /** @return the record instance */
59 inline sal_uInt16
getInstance() const;
61 /** @return the record length */
62 inline sal_uInt32
getLength() const;
65 Atom(const DffRecordHeader
& rRecordHeader
, SvStream
& rStCtrl
);
68 DffRecordHeader maRecordHeader
;
73 inline bool Atom::hasChildAtom(sal_uInt16 nRecType
) const
75 return findFirstChildAtom(nRecType
) != nullptr;
78 inline const Atom
* Atom::findFirstChildAtom(sal_uInt16 nRecType
) const
80 return findNextChildAtom(nRecType
, nullptr);
83 inline const Atom
* Atom::findFirstChildAtom() const { return mpFirstChild
; }
85 inline const Atom
* Atom::findNextChildAtom(const Atom
* pLast
)
87 return pLast
? pLast
->mpNextAtom
: pLast
;
90 inline bool Atom::isContainer() const { return maRecordHeader
.IsContainer(); }
92 inline bool Atom::seekToContent() const
94 maRecordHeader
.SeekToContent(mrStream
);
95 return mrStream
.GetError() == ERRCODE_NONE
;
98 inline sal_uInt16
Atom::getType() const { return maRecordHeader
.nRecType
; }
100 inline sal_uInt16
Atom::getInstance() const { return maRecordHeader
.nRecInstance
; }
102 inline sal_uInt32
Atom::getLength() const { return maRecordHeader
.nRecLen
; }
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */