summaryrefslogtreecommitdiffstats
path: root/src/marshal.h
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2011-08-21 08:11:15 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2011-08-21 08:11:15 (GMT)
commitd71a726489094c4fc1cf94f27a6eaa9a9f56a538 (patch)
tree26df576f6822a144ec9e57d58a5e9cca717ebd7b /src/marshal.h
parent9e5aed6d58f0e33ca942f67daa49971d885b0110 (diff)
downloadDoxygen-d71a726489094c4fc1cf94f27a6eaa9a9f56a538.zip
Doxygen-d71a726489094c4fc1cf94f27a6eaa9a9f56a538.tar.gz
Doxygen-d71a726489094c4fc1cf94f27a6eaa9a9f56a538.tar.bz2
Release-1.7.5.1
Diffstat (limited to 'src/marshal.h')
-rw-r--r--src/marshal.h67
1 files changed, 15 insertions, 52 deletions
diff --git a/src/marshal.h b/src/marshal.h
index a30c431..ad25b5d 100644
--- a/src/marshal.h
+++ b/src/marshal.h
@@ -1,3 +1,18 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2011 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
#ifndef MARSHAL_H
#define MARSHAL_H
@@ -25,58 +40,6 @@ class Entry;
#define NULL_LIST 0xffffffff
-class FileStorage : public QFile, public StorageIntf
-{
- public:
- FileStorage() : QFile() {}
- FileStorage( const QString &name) : QFile(name) {}
- int read(char *buf,uint size) { return QFile::readBlock(buf,size); }
- int write(const char *buf,uint size) { return QFile::writeBlock(buf,size); }
-};
-
-class StreamStorage : public StorageIntf
-{
- public:
- StreamStorage()
- {
- m_data=0;
- m_offset=0;
- m_len=0;
- }
- ~StreamStorage()
- {
- delete m_data;
- }
- StreamStorage(char *data,uint len)
- {
- m_data=data;
- m_offset=0;
- m_len=len;
- }
- int read(char *buf,uint size)
- {
- int bytesLeft = QMIN((int)size,m_len-m_offset);
- if (bytesLeft>0) memcpy(buf,m_data,bytesLeft);
- m_offset+=bytesLeft;
- return bytesLeft;
- }
- int write(const char *buf,uint size)
- {
- m_data=(char *)realloc(m_data,m_offset+size);
- memcpy(m_data+m_offset,buf,size);
- m_offset+=size;
- m_len+=size;
- return size;
- }
- void rewind() { m_offset=0; }
- char *data() const { return m_data; }
- int size() { return m_len; }
- private:
- char *m_data;
- int m_offset;
- int m_len;
-};
-
//----- marshaling function: datatype -> byte stream --------------------
void marshalInt(StorageIntf *s,int v);