summaryrefslogtreecommitdiff
path: root/library/backend/vobject.cpp
Unidiff
Diffstat (limited to 'library/backend/vobject.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/backend/vobject.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/library/backend/vobject.cpp b/library/backend/vobject.cpp
index af112a7..9c2ba3b 100644
--- a/library/backend/vobject.cpp
+++ b/library/backend/vobject.cpp
@@ -1162,49 +1162,58 @@ static void writeVObject_(OFile *fp, VObject *o)
1162 appendsOFile(fp,begin); 1162 appendsOFile(fp,begin);
1163 appendcOFile(fp,'\n'); 1163 appendcOFile(fp,'\n');
1164 initPropIterator(&t,o); 1164 initPropIterator(&t,o);
1165 while (moreIteration(&t)) { 1165 while (moreIteration(&t)) {
1166 VObject *eachProp = nextVObject(&t); 1166 VObject *eachProp = nextVObject(&t);
1167 writeProp(fp, eachProp); 1167 writeProp(fp, eachProp);
1168 } 1168 }
1169 appendsOFile(fp,"END:"); 1169 appendsOFile(fp,"END:");
1170 appendsOFile(fp,begin); 1170 appendsOFile(fp,begin);
1171 appendsOFile(fp,"\n\n"); 1171 appendsOFile(fp,"\n\n");
1172 } 1172 }
1173 } 1173 }
1174} 1174}
1175 1175
1176void writeVObject(FILE *fp, VObject *o) 1176void writeVObject(FILE *fp, VObject *o)
1177{ 1177{
1178 OFile ofp; 1178 OFile ofp;
1179 // ##### 1179 // #####
1180 //_setmode(_fileno(fp), _O_BINARY); 1180 //_setmode(_fileno(fp), _O_BINARY);
1181 initOFile(&ofp,fp); 1181 initOFile(&ofp,fp);
1182 writeVObject_(&ofp,o); 1182 writeVObject_(&ofp,o);
1183} 1183}
1184 1184
1185DLLEXPORT(void) writeVObjectToFile(char *fname, VObject *o) 1185DLLEXPORT(void) writeVObjectToFile(char *fname, VObject *o)
1186{ 1186{
1187 QFileDirect f( fname); 1187 QFileDirect f( fname);
1188 if ( !f.open( IO_WriteOnly ) ) { 1188 if ( !f.open( IO_WriteOnly ) ) {
1189 qWarning("Unable to open vobject write %s", fname); 1189 qWarning("Unable to open vobject write %s", fname);
1190 return; 1190 return;
1191 } 1191 }
1192 1192
1193 writeVObject( f.directHandle(),o ); 1193 writeVObject( f.directHandle(),o );
1194} 1194}
1195 1195
1196DLLEXPORT(void) writeVObjectsToFile(char *fname, VObject *list) 1196DLLEXPORT(void) writeVObjectsToFile(char *fname, VObject *list)
1197{ 1197{
1198 QFileDirect f( fname); 1198 QFileDirect f( fname);
1199 if ( !f.open( IO_WriteOnly ) ) { 1199 if ( !f.open( IO_WriteOnly ) ) {
1200 qWarning("Unable to open vobject write %s", fname); 1200 qWarning("Unable to open vobject write %s", fname);
1201 return; 1201 return;
1202 } 1202 }
1203 1203
1204 while (list) { 1204 while (list) {
1205 writeVObject(f.directHandle(),list); 1205 writeVObject(f.directHandle(),list);
1206 list = nextVObjectInList(list); 1206 list = nextVObjectInList(list);
1207 } 1207 }
1208} 1208}
1209 1209
1210DLLEXPORT(const char *) vObjectTypeInfo(VObject *o)
1211{
1212 const char *type = vObjectName( o );
1213 if ( strcmp( type, "TYPE" ) == 0 )
1214 type = vObjectStringZValue( o );
1215 return type;
1216}
1217
1218
1210// end of source file vobject.c 1219// end of source file vobject.c