LibreOffice Module sd (master) 1
pptatom.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#pragma once
21
23
24namespace ppt
25{
26class Atom
27{
28public:
29 ~Atom();
30
32 static Atom* import(const DffRecordHeader& rRootRecordHeader, SvStream& rStCtrl);
33
35 inline bool hasChildAtom(sal_uInt16 nRecType) const;
36
38 inline const Atom* findFirstChildAtom(sal_uInt16 nRecType) const;
39
41 const Atom* findNextChildAtom(sal_uInt16 nRecType, const Atom* pLast) const;
42
44 inline const Atom* findFirstChildAtom() const;
45
47 static inline const Atom* findNextChildAtom(const Atom* pLast);
48
50 inline bool isContainer() const;
51
53 inline bool seekToContent() const;
54
56 inline sal_uInt16 getType() const;
57
59 inline sal_uInt16 getInstance() const;
60
62 inline sal_uInt32 getLength() const;
63
64private:
65 Atom(const DffRecordHeader& rRecordHeader, SvStream& rStCtrl);
66
71};
72
73inline bool Atom::hasChildAtom(sal_uInt16 nRecType) const
74{
75 return findFirstChildAtom(nRecType) != nullptr;
76}
77
78inline const Atom* Atom::findFirstChildAtom(sal_uInt16 nRecType) const
79{
80 return findNextChildAtom(nRecType, nullptr);
81}
82
83inline const Atom* Atom::findFirstChildAtom() const { return mpFirstChild; }
84
85inline const Atom* Atom::findNextChildAtom(const Atom* pLast)
86{
87 return pLast ? pLast->mpNextAtom : pLast;
88}
89
90inline bool Atom::isContainer() const { return maRecordHeader.IsContainer(); }
91
92inline bool Atom::seekToContent() const
93{
95 return mrStream.GetError() == ERRCODE_NONE;
96}
97
98inline sal_uInt16 Atom::getType() const { return maRecordHeader.nRecType; }
99
100inline sal_uInt16 Atom::getInstance() const { return maRecordHeader.nRecInstance; }
101
102inline sal_uInt32 Atom::getLength() const { return maRecordHeader.nRecLen; }
103
104} // namespace ppt
105
106/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 nRecInstance
bool IsContainer() const
sal_uInt32 nRecLen
sal_uInt16 nRecType
bool SeekToContent(SvStream &rIn) const
ErrCode GetError() const
Atom * mpFirstChild
Definition: pptatom.hxx:69
Atom(const DffRecordHeader &rRecordHeader, SvStream &rStCtrl)
Definition: pptatom.cxx:25
SvStream & mrStream
Definition: pptatom.hxx:67
bool seekToContent() const
seeks to the contents of this atom
Definition: pptatom.hxx:92
sal_uInt16 getType() const
Definition: pptatom.hxx:98
bool hasChildAtom(sal_uInt16 nRecType) const
Definition: pptatom.hxx:73
Atom * mpNextAtom
Definition: pptatom.hxx:70
sal_uInt16 getInstance() const
Definition: pptatom.hxx:100
sal_uInt32 getLength() const
Definition: pptatom.hxx:102
DffRecordHeader maRecordHeader
Definition: pptatom.hxx:68
bool isContainer() const
Definition: pptatom.hxx:90
const Atom * findFirstChildAtom() const
Definition: pptatom.hxx:83
const Atom * findNextChildAtom(sal_uInt16 nRecType, const Atom *pLast) const
returns the next child atom after pLast with nRecType or NULL
Definition: pptatom.cxx:93
#define ERRCODE_NONE