LibreOffice Module vcl (master)
1
vcl
source
filter
idxf
dxfgrprd.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
22
#include <rtl/string.hxx>
23
#include <
sal/types.h
>
24
#include <
tools/long.hxx
>
25
26
class
SvStream
;
27
28
class
DXFGroupReader
29
{
30
public
:
31
explicit
DXFGroupReader
(
SvStream
& rIStream );
32
33
bool
GetStatus
()
const
;
34
35
void
SetError
();
36
37
sal_uInt16
Read
();
38
// Reads next group and returns the group code.
39
// In case of an error GetStatus() returns sal_False, group code will be set
40
// to 0 and SetS(0,"EOF") will be executed.
41
bool
Read
(sal_uInt16 nExpectedG) {
return
Read
() == nExpectedG; }
42
43
sal_uInt16
GetG
()
const
;
44
// Return the last group code (the one the last Read() did return).
45
46
tools::Long
GetI
()
const
;
47
// Returns the integer value of the group which was read earlier with Read().
48
// This read must have returned a group code for datatype Integer.
49
// If not 0 is returned
50
51
double
GetF
()
const
;
52
// Returns the floating point value of the group which was read earlier with Read().
53
// This read must have returned a group code for datatype Floatingpoint.
54
// If not 0 is returned
55
56
const
OString&
GetS
()
const
;
57
// Returns the string of the group which was read earlier with Read().
58
// This read must have returned a group code for datatype String.
59
// If not NULL is returned
60
61
sal_uInt64
remainingSize
()
const
;
62
private
:
63
64
tools::Long
ReadI
();
65
double
ReadF
();
66
void
ReadS
();
67
68
SvStream
&
rIS
;
69
bool
bStatus
;
70
sal_uInt16
nLastG
;
71
72
OString
S
;
73
union
{
74
double
F
;
75
tools::Long
I
;
76
};
77
};
78
79
80
inline
bool
DXFGroupReader::GetStatus
()
const
81
{
82
return
bStatus
;
83
}
84
85
86
inline
void
DXFGroupReader::SetError
()
87
{
88
bStatus
=
false
;
89
}
90
91
inline
sal_uInt16
DXFGroupReader::GetG
()
const
92
{
93
return
nLastG
;
94
}
95
96
inline
tools::Long
DXFGroupReader::GetI
()
const
97
{
98
return
I
;
99
}
100
101
inline
double
DXFGroupReader::GetF
()
const
102
{
103
return
F
;
104
}
105
106
inline
const
OString&
DXFGroupReader::GetS
()
const
107
{
108
return
S
;
109
}
110
111
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DXFGroupReader
Definition:
dxfgrprd.hxx:29
DXFGroupReader::S
OString S
Definition:
dxfgrprd.hxx:72
DXFGroupReader::Read
bool Read(sal_uInt16 nExpectedG)
Definition:
dxfgrprd.hxx:41
DXFGroupReader::GetS
const OString & GetS() const
Definition:
dxfgrprd.hxx:106
DXFGroupReader::SetError
void SetError()
Definition:
dxfgrprd.hxx:86
DXFGroupReader::nLastG
sal_uInt16 nLastG
Definition:
dxfgrprd.hxx:70
DXFGroupReader::GetI
tools::Long GetI() const
Definition:
dxfgrprd.hxx:96
DXFGroupReader::ReadI
tools::Long ReadI()
Definition:
dxfgrprd.cxx:158
DXFGroupReader::ReadS
void ReadS()
Definition:
dxfgrprd.cxx:203
DXFGroupReader::GetStatus
bool GetStatus() const
Definition:
dxfgrprd.hxx:80
DXFGroupReader::I
tools::Long I
Definition:
dxfgrprd.hxx:75
DXFGroupReader::bStatus
bool bStatus
Definition:
dxfgrprd.hxx:69
DXFGroupReader::F
double F
Definition:
dxfgrprd.hxx:74
DXFGroupReader::GetF
double GetF() const
Definition:
dxfgrprd.hxx:101
DXFGroupReader::GetG
sal_uInt16 GetG() const
Definition:
dxfgrprd.hxx:91
DXFGroupReader::Read
sal_uInt16 Read()
Definition:
dxfgrprd.cxx:118
DXFGroupReader::remainingSize
sal_uInt64 remainingSize() const
Definition:
dxfgrprd.cxx:208
DXFGroupReader::DXFGroupReader
DXFGroupReader(SvStream &rIStream)
Definition:
dxfgrprd.cxx:109
DXFGroupReader::rIS
SvStream & rIS
Definition:
dxfgrprd.hxx:68
DXFGroupReader::ReadF
double ReadF()
Definition:
dxfgrprd.cxx:189
SvStream
long.hxx
tools::Long
long Long
types.h
Generated on Sun Jul 30 2023 04:35:22 for LibreOffice Module vcl (master) by
1.9.3