• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • kasten
  • controllers
  • view
  • poddecoder
poddata.h
Go to the documentation of this file.
1 /*
2  This file is part of the Okteta Kasten module, made within the KDE community.
3 
4  Copyright 2007,2009 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) version 3, or any
10  later version accepted by the membership of KDE e.V. (or its
11  successor approved by the membership of KDE e.V.), which shall
12  act as a proxy defined in Section 6 of version 3 of the license.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #ifndef PODDATA_H
24 #define PODDATA_H
25 
26 // Okteta core
27 #include <byte.h>
28 #include <oktetacore.h>
29 
30 
31 namespace Okteta
32 {
33 
34 class PODData
35 {
36  public:
37  static const int Size = sizeof(double);
38 
39  public:
40  PODData();
41 
42  public:
43  void setByteOrder( ByteOrder byteOrder );
44  bool updateRawData( int size );
45  Byte* rawData();
46 
47  public:
48  const Byte* originalData() const;
49  const Byte* byteOrderSetData() const;
50  ByteOrder byteOrder() const;
51 
52  unsigned long bitValue( int noOfBitsToRead ) const;
53  void getPointers( const void** P8Bit, const void** P16Bit, const void** P32Bit, const void** P64Bit ) const;
54  const void* pointer( int byteCount ) const;
55  int size() const;
56 
57  protected:
58  // ensure strict alignment for double as needed on some architectures (e.g. PA-RISC)
59  typedef union
60  {
61  double mDummy;
62  Byte mBytes[Size];
63  } Aligned64Bit;
64 
65  protected:
66  Byte* mCurrentOriginalData;
67  Byte* mCurrentEndiannessSetData;
68 
69  Aligned64Bit mOriginalAligned64Bit;
70  Aligned64Bit mByteOrderSetAligned64Bit;
71 
72  int mCurrentSize;
73  ByteOrder mByteOrder;
74 };
75 
76 }
77 
78 #endif
Okteta::PODData::originalData
const Byte * originalData() const
Definition: poddata.cpp:45
Okteta::PODData::Aligned64Bit::mDummy
double mDummy
Definition: poddata.h:61
Okteta::PODData::mByteOrder
ByteOrder mByteOrder
Definition: poddata.h:73
Okteta::PODData::mOriginalAligned64Bit
Aligned64Bit mOriginalAligned64Bit
Definition: poddata.h:69
Okteta::PODData::mCurrentOriginalData
Byte * mCurrentOriginalData
Definition: poddata.h:66
Okteta::Byte
unsigned char Byte
Definition: byte.h:29
Okteta::PODData::PODData
PODData()
Definition: poddata.cpp:37
Okteta::PODData
Definition: poddata.h:34
Okteta::PODData::Size
static const int Size
Definition: poddata.h:37
Okteta::ByteOrder
ByteOrder
Definition: oktetacore.h:111
Okteta::PODData::setByteOrder
void setByteOrder(ByteOrder byteOrder)
Definition: poddata.cpp:53
oktetacore.h
byte.h
Okteta::PODData::pointer
const void * pointer(int byteCount) const
Definition: poddata.cpp:157
Okteta::PODData::byteOrderSetData
const Byte * byteOrderSetData() const
Definition: poddata.cpp:46
Okteta::PODData::size
int size() const
Definition: poddata.cpp:48
Okteta::PODData::Aligned64Bit
Definition: poddata.h:59
Okteta::PODData::mCurrentSize
int mCurrentSize
Definition: poddata.h:72
Okteta::PODData::bitValue
unsigned long bitValue(int noOfBitsToRead) const
Definition: poddata.cpp:67
Okteta::PODData::updateRawData
bool updateRawData(int size)
Definition: poddata.cpp:118
Okteta::PODData::mCurrentEndiannessSetData
Byte * mCurrentEndiannessSetData
Definition: poddata.h:67
Okteta::PODData::rawData
Byte * rawData()
Definition: poddata.cpp:51
Okteta::PODData::getPointers
void getPointers(const void **P8Bit, const void **P16Bit, const void **P32Bit, const void **P64Bit) const
Definition: poddata.cpp:143
Okteta::Size
qint32 Size
Definition: size.h:33
Okteta::PODData::byteOrder
ByteOrder byteOrder() const
Definition: poddata.cpp:47
Okteta::PODData::mByteOrderSetAligned64Bit
Aligned64Bit mByteOrderSetAligned64Bit
Definition: poddata.h:70
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

Skip menu "okteta"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal