summaryrefslogtreecommitdiffstats
path: root/src/marshal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/marshal.cpp')
-rw-r--r--src/marshal.cpp42
1 files changed, 32 insertions, 10 deletions
diff --git a/src/marshal.cpp b/src/marshal.cpp
index 43c5511..f13b6fd 100644
--- a/src/marshal.cpp
+++ b/src/marshal.cpp
@@ -344,6 +344,14 @@ void marshalMemberLists(StorageIntf *s,SDict<MemberList> *mls)
}
}
+void marshalLocalToc(StorageIntf *s,const LocalToc &lt)
+{
+ marshalInt(s,lt.mask());
+ marshalInt(s,lt.htmlLevel());
+ marshalInt(s,lt.latexLevel());
+ marshalInt(s,lt.xmlLevel());
+}
+
void marshalEntry(StorageIntf *s,Entry *e)
{
marshalUInt(s,HEADER);
@@ -355,11 +363,7 @@ void marshalEntry(StorageIntf *s,Entry *e)
marshalUInt64(s,e->spec);
marshalInt(s,e->initLines);
marshalBool(s,e->stat);
- marshalInt(s,e->localToc);
- for (int i = 0; i < sizeof(e->localTocLevel) / sizeof(*(e->localTocLevel)) ; i++)
- {
- marshalInt(s,e->localTocLevel[i]);
- }
+ marshalLocalToc(s,e->localToc);
marshalBool(s,e->explicitExternal);
marshalBool(s,e->proto);
marshalBool(s,e->subGrouping);
@@ -729,6 +733,28 @@ SDict<MemberList> *unmarshalMemberLists(StorageIntf *s)
return result;
}
+LocalToc unmarshalLocalToc(StorageIntf *s)
+{
+ LocalToc result;
+ int mask = unmarshalInt(s);
+ int htmlLevel = unmarshalInt(s);
+ int latexLevel = unmarshalInt(s);
+ int xmlLevel = unmarshalInt(s);
+ if ((mask & LocalToc::Html)!=0)
+ {
+ result.enableHtml(htmlLevel);
+ }
+ if ((mask & LocalToc::Latex)!=0)
+ {
+ result.enableLatex(latexLevel);
+ }
+ if ((mask & LocalToc::Xml)!=0)
+ {
+ result.enableXml(xmlLevel);
+ }
+ return result;
+}
+
Entry * unmarshalEntry(StorageIntf *s)
{
Entry *e = new Entry;
@@ -742,11 +768,7 @@ Entry * unmarshalEntry(StorageIntf *s)
e->spec = unmarshalUInt64(s);
e->initLines = unmarshalInt(s);
e->stat = unmarshalBool(s);
- e->localToc = unmarshalInt(s);
- for (int i = 0; i < sizeof(e->localTocLevel) / sizeof(*(e->localTocLevel)) ; i++)
- {
- e->localTocLevel[i] = unmarshalInt(s);
- }
+ e->localToc = unmarshalLocalToc(s);
e->explicitExternal = unmarshalBool(s);
e->proto = unmarshalBool(s);
e->subGrouping = unmarshalBool(s);