marshal.h 3.91 KB
Newer Older
Dimitri van Heesch's avatar
Dimitri van Heesch committed
1 2
/******************************************************************************
 *
Dimitri van Heesch's avatar
Dimitri van Heesch committed
3
 * Copyright (C) 1997-2013 by Dimitri van Heesch.
Dimitri van Heesch's avatar
Dimitri van Heesch committed
4 5 6 7 8 9 10 11 12 13 14 15
 *
 * 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.
 *
 */

16 17 18 19 20 21 22 23 24
#ifndef MARSHAL_H
#define MARSHAL_H

#include <qlist.h>
#include <qfile.h>
#include "sortdict.h"
#include "store.h"

class ArgumentList;
25 26 27 28
struct BaseInfo;
struct Grouping;
struct SectionInfo;
struct ListItemInfo;
29 30 31 32 33
class QCString;
class QGString;
class SectionDict;
class MemberSDict;
class GroupList;
34
class MemberList;
35 36
struct BodyInfo;
struct DocInfo;
37
struct BriefInfo;
38
class ExampleSDict;
39
class Entry;
40 41 42 43 44 45 46

#define NULL_LIST 0xffffffff

//----- marshaling function: datatype -> byte stream --------------------

void marshalInt(StorageIntf *s,int v);
void marshalUInt(StorageIntf *s,uint v);
47
void marshalUInt64(StorageIntf *s,uint64 v);
48 49 50 51 52 53 54 55 56 57 58 59 60
void marshalBool(StorageIntf *s,bool b);
void marshalQCString(StorageIntf *s,const QCString &str);
void marshalQGString(StorageIntf *s,const QGString &str);
void marshalArgumentList(StorageIntf *s,ArgumentList *argList);
void marshalArgumentLists(StorageIntf *s,QList<ArgumentList> *argLists);
void marshalBaseInfoList(StorageIntf *s, QList<BaseInfo> *baseList);
void marshalGroupingList(StorageIntf *s, QList<Grouping> *groups);
void marshalSectionInfoList(StorageIntf *s, QList<SectionInfo> *anchors);
void marshalItemInfoList(StorageIntf *s, QList<ListItemInfo> *sli);
void marshalObjPointer(StorageIntf *s,void *obj);
void marshalSectionDict(StorageIntf *s,SectionDict *sections);
void marshalMemberSDict(StorageIntf *s,MemberSDict *memberSDict);
void marshalDocInfo(StorageIntf *s,DocInfo *docInfo);
61
void marshalBriefInfo(StorageIntf *s,BriefInfo *briefInfo);
62 63 64 65 66
void marshalBodyInfo(StorageIntf *s,BodyInfo *bodyInfo);
void marshalGroupList(StorageIntf *s,GroupList *groupList);
void marshalMemberList(StorageIntf *s,MemberList *ml);
void marshalExampleSDict(StorageIntf *s,ExampleSDict *ed);
void marshalMemberLists(StorageIntf *s,SDict<MemberList> *mls);
67 68
void marshalEntry(StorageIntf *s,Entry *e);
void marshalEntryTree(StorageIntf *s,Entry *e);
69 70 71 72 73

//----- unmarshaling function: byte stream -> datatype ------------------

int                  unmarshalInt(StorageIntf *s);
uint                 unmarshalUInt(StorageIntf *s);
74
uint64               unmarshalUInt64(StorageIntf *s);
75 76 77 78 79 80 81 82 83 84 85 86 87
bool                 unmarshalBool(StorageIntf *s);
QCString             unmarshalQCString(StorageIntf *s);
QGString             unmarshalQGString(StorageIntf *s);
ArgumentList *       unmarshalArgumentList(StorageIntf *s);
QList<ArgumentList> *unmarshalArgumentLists(StorageIntf *s);
QList<BaseInfo> *    unmarshalBaseInfoList(StorageIntf *s);
QList<Grouping> *    unmarshalGroupingList(StorageIntf *s);
QList<SectionInfo> * unmarshalSectionInfoList(StorageIntf *s);
QList<ListItemInfo> *unmarshalItemInfoList(StorageIntf *s);
void *               unmarshalObjPointer(StorageIntf *s);
SectionDict *        unmarshalSectionDict(StorageIntf *s);
MemberSDict *        unmarshalMemberSDict(StorageIntf *s);
DocInfo *            unmarshalDocInfo(StorageIntf *s);
88
BriefInfo *          unmarshalBriefInfo(StorageIntf *s);
89 90 91 92 93
BodyInfo *           unmarshalBodyInfo(StorageIntf *s);
GroupList *          unmarshalGroupList(StorageIntf *s);
MemberList *         unmarshalMemberList(StorageIntf *s);
ExampleSDict *       unmarshalExampleSDict(StorageIntf *s);
SDict<MemberList> *  unmarshalMemberLists(StorageIntf *s);
94 95
Entry *              unmarshalEntry(StorageIntf *s);
Entry *              unmarshalEntryTree(StorageIntf *s);
96 97

#endif