Qt 4.8
Public Functions | Properties | List of all members
QDynamicBufferResourceRoot Class Reference
Inheritance diagram for QDynamicBufferResourceRoot:
QResourceRoot QDynamicFileResourceRoot

Public Functions

const ucharmappingBuffer () const
 
virtual QString mappingRoot () const
 
 QDynamicBufferResourceRoot (const QString &_root)
 
bool registerSelf (const uchar *b)
 
virtual ResourceRootType type () const
 
 ~QDynamicBufferResourceRoot ()
 
- Public Functions inherited from QResourceRoot
QStringList children (int node) const
 
const uchardata (int node, qint64 *size) const
 
int findNode (const QString &path, const QLocale &locale=QLocale()) const
 
bool isCompressed (int node) const
 
bool isContainer (int node) const
 
bool mappingRootSubdir (const QString &path, QString *match=0) const
 
bool operator!= (const QResourceRoot &other) const
 
bool operator== (const QResourceRoot &other) const
 
 QResourceRoot ()
 
 QResourceRoot (const uchar *t, const uchar *n, const uchar *d)
 
virtual ~QResourceRoot ()
 

Properties

const ucharbuffer
 
QString root
 

Additional Inherited Members

- Public Types inherited from QResourceRoot
enum  ResourceRootType { Resource_Builtin, Resource_File, Resource_Buffer }
 
- Public Variables inherited from QResourceRoot
QAtomicInt ref
 
- Protected Functions inherited from QResourceRoot
void setSource (const uchar *t, const uchar *n, const uchar *d)
 

Detailed Description

Definition at line 895 of file qresource.cpp.

Constructors and Destructors

◆ QDynamicBufferResourceRoot()

QDynamicBufferResourceRoot::QDynamicBufferResourceRoot ( const QString _root)
inline

Definition at line 901 of file qresource.cpp.

901 : root(_root), buffer(0) { }

◆ ~QDynamicBufferResourceRoot()

QDynamicBufferResourceRoot::~QDynamicBufferResourceRoot ( )
inline

Definition at line 902 of file qresource.cpp.

902 { }

Functions

◆ mappingBuffer()

const uchar* QDynamicBufferResourceRoot::mappingBuffer ( ) const
inline

Definition at line 903 of file qresource.cpp.

Referenced by QResource::unregisterResource().

903 { return buffer; }

◆ mappingRoot()

virtual QString QDynamicBufferResourceRoot::mappingRoot ( ) const
inlinevirtual

Reimplemented from QResourceRoot.

Definition at line 904 of file qresource.cpp.

Referenced by QResource::unregisterResource().

904 { return root; }

◆ registerSelf()

bool QDynamicBufferResourceRoot::registerSelf ( const uchar b)
inline

Definition at line 907 of file qresource.cpp.

Referenced by QResource::registerResource(), and QDynamicFileResourceRoot::registerSelf().

907  {
908  //setup the data now
909  int offset = 0;
910 
911  //magic number
912  if(b[offset+0] != 'q' || b[offset+1] != 'r' ||
913  b[offset+2] != 'e' || b[offset+3] != 's') {
914  return false;
915  }
916  offset += 4;
917 
918  const int version = (b[offset+0] << 24) + (b[offset+1] << 16) +
919  (b[offset+2] << 8) + (b[offset+3] << 0);
920  offset += 4;
921 
922  const int tree_offset = (b[offset+0] << 24) + (b[offset+1] << 16) +
923  (b[offset+2] << 8) + (b[offset+3] << 0);
924  offset += 4;
925 
926  const int data_offset = (b[offset+0] << 24) + (b[offset+1] << 16) +
927  (b[offset+2] << 8) + (b[offset+3] << 0);
928  offset += 4;
929 
930  const int name_offset = (b[offset+0] << 24) + (b[offset+1] << 16) +
931  (b[offset+2] << 8) + (b[offset+3] << 0);
932  offset += 4;
933 
934  if(version == 0x01) {
935  buffer = b;
936  setSource(b+tree_offset, b+name_offset, b+data_offset);
937  return true;
938  }
939  return false;
940  }
void setSource(const uchar *t, const uchar *n, const uchar *d)
Definition: qresource.cpp:141

◆ type()

virtual ResourceRootType QDynamicBufferResourceRoot::type ( ) const
inlinevirtual

Reimplemented from QResourceRoot.

Reimplemented in QDynamicFileResourceRoot.

Definition at line 905 of file qresource.cpp.

Properties

◆ buffer

const uchar* QDynamicBufferResourceRoot::buffer
private

Definition at line 898 of file qresource.cpp.

◆ root

QString QDynamicBufferResourceRoot::root
private

Definition at line 897 of file qresource.cpp.


The documentation for this class was generated from the following file: