Commit | Line | Data |
---|---|---|
b311480e | 1 | // Created on: 2000-03-01 |
2 | // Created by: Denis PASCAL | |
973c2be1 | 3 | // Copyright (c) 2000-2014 OPEN CASCADE SAS |
b311480e | 4 | // |
973c2be1 | 5 | // This file is part of Open CASCADE Technology software library. |
b311480e | 6 | // |
d5f74e42 | 7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published | |
973c2be1 | 9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT | |
11 | // distribution for complete text of the license and disclaimer of any warranty. | |
b311480e | 12 | // |
973c2be1 | 13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. | |
7fd59977 | 15 | |
16 | #include <DDocStd.hxx> | |
17 | #include <Draw.hxx> | |
18 | #include <Draw_Interpretor.hxx> | |
19 | #include <Draw_Viewer.hxx> | |
6d8f9f4a | 20 | #include <Draw_ProgressIndicator.hxx> |
7fd59977 | 21 | #include <DDocStd_DrawDocument.hxx> |
22 | #include <TDocStd_Application.hxx> | |
23 | #include <TDocStd_Document.hxx> | |
24 | #include <TDataStd_Name.hxx> | |
25 | #include <Draw.hxx> | |
26 | #include <Standard_GUID.hxx> | |
27 | #include <Standard_ExtString.hxx> | |
28 | #include <TCollection_AsciiString.hxx> | |
29 | #include <TCollection_ExtendedString.hxx> | |
30 | #include <TDF.hxx> | |
31 | #include <TDF_Data.hxx> | |
32 | #include <TDF_ChildIterator.hxx> | |
33 | #include <TDF_Tool.hxx> | |
34 | ||
35 | #include <OSD_Path.hxx> | |
4ff92abe | 36 | #include <OSD_OpenFile.hxx> |
7fd59977 | 37 | #include <TDocStd_PathParser.hxx> |
c2f5b821 | 38 | #include <XmlLDrivers.hxx> |
7fd59977 | 39 | |
0e93d9e5 | 40 | #include <AIS_InteractiveContext.hxx> |
41 | #include <TPrsStd_AISViewer.hxx> | |
42 | #include <ViewerTest.hxx> | |
43 | #include <V3d_Viewer.hxx> | |
44 | ||
45 | #ifndef _WIN32 | |
7fd59977 | 46 | extern Draw_Viewer dout; |
47 | #else | |
48 | Standard_IMPORT Draw_Viewer dout; | |
49 | #endif | |
50 | ||
7fd59977 | 51 | //======================================================================= |
52 | //function : ListDocuments | |
53 | //purpose : | |
54 | //======================================================================= | |
55 | ||
56 | static Standard_Integer DDocStd_ListDocuments (Draw_Interpretor& di, | |
57 | Standard_Integer nb, | |
58 | const char** /*a*/) | |
59 | { | |
60 | if (nb == 1) { | |
6fe96f84 | 61 | Handle(TDocStd_Application) A = DDocStd::GetApplication(); |
7fd59977 | 62 | Handle(TDocStd_Document) D; |
63 | Standard_Integer nbdoc = A->NbDocuments(); | |
64 | for (Standard_Integer i = 1; i <= nbdoc; i++) { | |
65 | A->GetDocument(i,D); | |
66 | di <<"document " << i; | |
67 | if (D->IsSaved()) { | |
ae9f4b64 | 68 | di << " name : " << D->GetName(); |
69 | di << " path : " << D->GetPath(); | |
7fd59977 | 70 | } |
71 | else di << " not saved"; | |
72 | di << "\n"; | |
73 | } | |
74 | return 0; | |
75 | } | |
586db386 | 76 | di << "DDocStd_ListDocuments : Error\n"; |
7fd59977 | 77 | return 1; |
78 | } | |
79 | ||
80 | ||
81 | //======================================================================= | |
82 | //function : NewDocument | |
83 | //purpose : | |
84 | //======================================================================= | |
85 | ||
86 | static Standard_Integer DDocStd_NewDocument (Draw_Interpretor& di, | |
87 | Standard_Integer nb, | |
88 | const char** a) | |
89 | { | |
90 | Handle(TDocStd_Document) D; | |
91 | Handle(DDocStd_DrawDocument) DD; | |
92 | if (nb == 2) { | |
93 | if (!DDocStd::GetDocument(a[1],D,Standard_False)) { | |
94 | D = new TDocStd_Document("dummy"); | |
95 | DD = new DDocStd_DrawDocument(D); | |
96 | Draw::Set(a[1],DD); | |
586db386 | 97 | di << "document (not handled by application) " << a[1] << " created\n"; |
7fd59977 | 98 | DDocStd::ReturnLabel(di,D->Main()); |
99 | } | |
586db386 | 100 | else di << a[1] << " is already a document\n"; |
7fd59977 | 101 | return 0; |
102 | } | |
103 | if (nb == 3) { | |
104 | if (!DDocStd::GetDocument(a[1],D,Standard_False)) { | |
6fe96f84 | 105 | Handle(TDocStd_Application) A = DDocStd::GetApplication(); |
7fd59977 | 106 | A->NewDocument(a[2],D); |
107 | DD = new DDocStd_DrawDocument(D); | |
108 | TDataStd_Name::Set(D->GetData()->Root(),a[1]); | |
109 | Draw::Set(a[1],DD); | |
586db386 | 110 | di << "document " << a[1] << " created\n"; |
7fd59977 | 111 | DDocStd::ReturnLabel(di,D->Main()); |
112 | } | |
586db386 | 113 | else di << a[1] << " is already a document\n"; |
7fd59977 | 114 | return 0; |
115 | } | |
586db386 | 116 | di << "DDocStd_NewDocument : Error\n"; |
7fd59977 | 117 | return 1; |
118 | } | |
119 | ||
7fd59977 | 120 | //======================================================================= |
121 | //function : Open | |
122 | //purpose : | |
123 | //======================================================================= | |
124 | ||
125 | static Standard_Integer DDocStd_Open (Draw_Interpretor& di, | |
6d8f9f4a | 126 | Standard_Integer nb, |
127 | const char** a) | |
7fd59977 | 128 | { |
4ff92abe | 129 | if (nb >= 3) { |
94f16a89 | 130 | TCollection_ExtendedString path (a[1], Standard_True); |
6fe96f84 | 131 | Handle(TDocStd_Application) A = DDocStd::GetApplication(); |
7fd59977 | 132 | Handle(TDocStd_Document) D; |
133 | Standard_Integer insession = A->IsInSession(path); | |
134 | if (insession > 0) { | |
586db386 | 135 | di <<"document " << insession << " is already in session\n"; |
7fd59977 | 136 | return 0; |
137 | } | |
4ff92abe | 138 | PCDM_ReaderStatus theStatus; |
139 | ||
140 | Standard_Boolean anUseStream = Standard_False; | |
141 | for ( Standard_Integer i = 3; i < nb; i++ ) | |
142 | { | |
143 | if (!strcmp (a[i], "-stream")) | |
144 | { | |
145 | di << "standard SEEKABLE stream is used\n"; | |
146 | anUseStream = Standard_True; | |
147 | break; | |
148 | } | |
149 | } | |
150 | ||
6d8f9f4a | 151 | Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); |
4ff92abe | 152 | if (anUseStream) |
153 | { | |
154 | std::ifstream aFileStream; | |
155 | OSD_OpenStream (aFileStream, path, std::ios::in | std::ios::binary); | |
156 | ||
7e785937 | 157 | theStatus = A->Open (aFileStream, D, aProgress->Start()); |
4ff92abe | 158 | } |
159 | else | |
160 | { | |
7e785937 | 161 | theStatus = A->Open (path, D, aProgress->Start()); |
4ff92abe | 162 | } |
6d8f9f4a | 163 | if (theStatus == PCDM_RS_OK && !D.IsNull()) |
164 | { | |
7fd59977 | 165 | Handle(DDocStd_DrawDocument) DD = new DDocStd_DrawDocument(D); |
166 | TDataStd_Name::Set(D->GetData()->Root(),a[2]); | |
167 | Draw::Set(a[2],DD); | |
168 | return 0; | |
6d8f9f4a | 169 | } |
170 | else | |
171 | { | |
7fd59977 | 172 | switch ( theStatus ) { |
6d8f9f4a | 173 | case PCDM_RS_UserBreak: { |
174 | di << " could not retrieve , user break \n"; | |
175 | break; | |
176 | } | |
15e8b082 M |
177 | case PCDM_RS_AlreadyRetrieved: |
178 | case PCDM_RS_AlreadyRetrievedAndModified: { | |
6d8f9f4a | 179 | di << " already retrieved \n" ; |
180 | break; | |
7fd59977 | 181 | } |
15e8b082 | 182 | case PCDM_RS_NoDriver: { |
6d8f9f4a | 183 | di << " could not retrieve , no Driver to make it \n" ; |
184 | break ; | |
7fd59977 | 185 | } |
15e8b082 M |
186 | case PCDM_RS_UnknownDocument: |
187 | case PCDM_RS_NoModel: { | |
6d8f9f4a | 188 | di << " could not retrieve , Unknown Document or No Model \n"; |
189 | break ; | |
7fd59977 | 190 | } |
15e8b082 M |
191 | case PCDM_RS_TypeNotFoundInSchema: |
192 | case PCDM_RS_UnrecognizedFileFormat: { | |
6d8f9f4a | 193 | di << " could not retrieve , Type not found or Unrecognized File Format\n"; |
194 | break ; | |
7fd59977 | 195 | } |
15e8b082 | 196 | case PCDM_RS_PermissionDenied: { |
6d8f9f4a | 197 | di << " could not retrieve , permission denied \n" ; |
198 | break; | |
7fd59977 | 199 | } |
15e8b082 | 200 | default: |
6d8f9f4a | 201 | di << " could not retrieve \n" ; |
202 | break; | |
7fd59977 | 203 | } |
586db386 | 204 | di << "DDocStd_Open : Error\n"; |
6d8f9f4a | 205 | } |
7fd59977 | 206 | } |
207 | return 1; | |
208 | } | |
209 | ||
210 | //======================================================================= | |
211 | //function : Save | |
212 | //purpose : | |
213 | //======================================================================= | |
214 | ||
215 | static Standard_Integer DDocStd_Save (Draw_Interpretor& di, | |
6d8f9f4a | 216 | Standard_Integer nb, |
217 | const char** a) | |
7fd59977 | 218 | { |
219 | if (nb == 2) { | |
220 | Handle(TDocStd_Document) D; | |
221 | if (!DDocStd::GetDocument(a[1],D)) return 1; | |
6fe96f84 | 222 | Handle(TDocStd_Application) A = DDocStd::GetApplication(); |
7fd59977 | 223 | if (!D->IsSaved()) { |
586db386 | 224 | di << "this document has never been saved\n"; |
7fd59977 | 225 | return 0; |
226 | } | |
6d8f9f4a | 227 | |
228 | Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); | |
7e785937 | 229 | A->Save (D, aProgress->Start()); |
7fd59977 | 230 | return 0; |
231 | } | |
586db386 | 232 | di << "DDocStd_Save : Error\n"; |
7fd59977 | 233 | return 1; |
234 | } | |
235 | ||
236 | //======================================================================= | |
237 | //function : SaveAs | |
238 | //purpose : | |
239 | //======================================================================= | |
240 | ||
241 | static Standard_Integer DDocStd_SaveAs (Draw_Interpretor& di, | |
030ba648 | 242 | Standard_Integer nb, |
243 | const char** a) | |
244 | { | |
4ff92abe | 245 | if (nb >= 3) { |
7fd59977 | 246 | Handle(TDocStd_Document) D; |
247 | if (!DDocStd::GetDocument(a[1],D)) return 1; | |
94f16a89 | 248 | TCollection_ExtendedString path (a[2], Standard_True); |
6fe96f84 | 249 | Handle(TDocStd_Application) A = DDocStd::GetApplication(); |
4ff92abe | 250 | PCDM_StoreStatus theStatus; |
030ba648 | 251 | |
252 | Standard_Boolean anUseStream(Standard_False), isSaveEmptyLabels(Standard_False); | |
4ff92abe | 253 | for ( Standard_Integer i = 3; i < nb; i++ ) |
254 | { | |
255 | if (!strcmp (a[i], "-stream")) | |
256 | { | |
257 | di << "standard SEEKABLE stream is used\n"; | |
258 | anUseStream = Standard_True; | |
259 | break; | |
030ba648 | 260 | } else { |
261 | isSaveEmptyLabels = ((atoi (a[3])) != 0); | |
262 | D->SetEmptyLabelsSavingMode(isSaveEmptyLabels); | |
4ff92abe | 263 | } |
264 | } | |
6d8f9f4a | 265 | |
266 | Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); | |
4ff92abe | 267 | if (anUseStream) |
268 | { | |
269 | std::ofstream aFileStream; | |
270 | OSD_OpenStream (aFileStream, path, std::ios::out | std::ios::binary); | |
7e785937 | 271 | theStatus = A->SaveAs (D, aFileStream, aProgress->Start()); |
4ff92abe | 272 | } |
273 | else | |
274 | { | |
7e785937 | 275 | theStatus = A->SaveAs(D,path, aProgress->Start()); |
4ff92abe | 276 | } |
030ba648 | 277 | |
15e8b082 | 278 | if (theStatus != PCDM_SS_OK ) { |
7fd59977 | 279 | switch ( theStatus ) { |
030ba648 | 280 | case PCDM_SS_DriverFailure: { |
281 | di << "Error saving document: Could not store , no driver found to make it\n"; | |
282 | break ; | |
283 | } | |
284 | case PCDM_SS_WriteFailure: { | |
285 | di << "Error saving document: Write access failure\n"; | |
286 | break; | |
287 | } | |
288 | case PCDM_SS_Failure: { | |
289 | di << "Error saving document: Write failure\n" ; | |
290 | break; | |
291 | } | |
292 | case PCDM_SS_Doc_IsNull: { | |
293 | di << "Error saving document: No document to save\n"; | |
294 | break ; | |
295 | } | |
296 | case PCDM_SS_No_Obj: { | |
297 | di << "Error saving document: No objects written\n"; | |
298 | break; | |
299 | } | |
300 | case PCDM_SS_Info_Section_Error: { | |
301 | di << "Error saving document: Write info section failure\n" ; | |
302 | break; | |
303 | } | |
6d8f9f4a | 304 | case PCDM_SS_UserBreak: { |
305 | di << "Error saving document: User break \n" ; | |
306 | break; | |
307 | } | |
030ba648 | 308 | default: |
309 | break; | |
7fd59977 | 310 | } |
311 | return 1; | |
312 | } else { | |
313 | return 0; | |
314 | } | |
315 | } | |
586db386 | 316 | di << "DDocStd_SaveAs : Error not enough argument\n"; |
7fd59977 | 317 | return 1; |
318 | } | |
319 | ||
320 | //======================================================================= | |
321 | //function : Close | |
322 | //purpose : | |
323 | //======================================================================= | |
324 | ||
d99f0355 | 325 | static Standard_Integer DDocStd_Close (Draw_Interpretor& theDI, |
0e93d9e5 | 326 | Standard_Integer theArgNb, |
327 | const char** theArgVec) | |
7fd59977 | 328 | { |
0e93d9e5 | 329 | if (theArgNb != 2) |
330 | { | |
d99f0355 | 331 | theDI << "DDocStd_Close : Error\n"; |
0e93d9e5 | 332 | return 1; |
333 | } | |
24de79c3 | 334 | |
0e93d9e5 | 335 | Handle(TDocStd_Document) aDoc; |
336 | Standard_CString aDocName = theArgVec[1]; | |
337 | if (!DDocStd::GetDocument (aDocName, aDoc)) | |
338 | { | |
339 | return 1; | |
7fd59977 | 340 | } |
0e93d9e5 | 341 | |
342 | TDF_Label aRoot = aDoc->GetData()->Root(); | |
343 | Handle(TPrsStd_AISViewer) aDocViewer; | |
344 | if (TPrsStd_AISViewer::Find (aRoot, aDocViewer) | |
345 | && !aDocViewer->GetInteractiveContext().IsNull()) | |
346 | { | |
347 | Handle(V3d_Viewer) aViewer = aDocViewer->GetInteractiveContext()->CurrentViewer(); | |
6a24c6de | 348 | V3d_ListOfView aViews; |
349 | for (V3d_ListOfViewIterator aViewIter (aDocViewer->GetInteractiveContext()->CurrentViewer()->DefinedViewIterator()); aViewIter.More(); aViewIter.Next()) | |
0e93d9e5 | 350 | { |
6a24c6de | 351 | aViews.Append (aViewIter.Value()); |
352 | } | |
353 | for (V3d_ListOfViewIterator aViewIter (aViews); aViewIter.More(); aViewIter.Next()) | |
354 | { | |
355 | Handle(V3d_View) aView = aViewIter.Value(); | |
0e93d9e5 | 356 | ViewerTest::RemoveView (aView); |
357 | } | |
358 | } | |
359 | ||
6fe96f84 | 360 | Handle(TDocStd_Application) aDocApp = DDocStd::GetApplication(); |
0e93d9e5 | 361 | |
362 | aDocApp->Close (aDoc); | |
363 | ||
1c8fc6be | 364 | if (Handle(Draw_Drawable3D) aDrawable = Draw::GetExisting (aDocName)) |
365 | { | |
366 | dout.RemoveDrawable (aDrawable); | |
367 | } | |
0e93d9e5 | 368 | Draw::Set (theArgVec[1], Handle(Draw_Drawable3D)()); |
369 | return 0; | |
7fd59977 | 370 | } |
371 | ||
372 | //======================================================================= | |
373 | //function : IsInSession | |
374 | //purpose : | |
375 | //======================================================================= | |
376 | ||
377 | static Standard_Integer DDocStd_IsInSession (Draw_Interpretor& di, | |
378 | Standard_Integer nb, | |
379 | const char** a) | |
380 | { | |
381 | if (nb == 2) { | |
6fe96f84 | 382 | Handle(TDocStd_Application) A = DDocStd::GetApplication(); |
7fd59977 | 383 | di << A->IsInSession(a[1]); |
384 | return 0; | |
385 | } | |
586db386 | 386 | di << "DDocStd_IsInSession : Error\n"; |
7fd59977 | 387 | return 1; |
388 | } | |
389 | ||
390 | ||
391 | //======================================================================= | |
392 | //function : OSDPath | |
393 | //purpose : | |
394 | //======================================================================= | |
395 | ||
396 | static Standard_Integer DDocStd_OSDPath (Draw_Interpretor& di, | |
397 | Standard_Integer nb, | |
398 | const char** a) | |
399 | { | |
400 | if (nb == 2) { | |
401 | OSD_Path path (a[1]); | |
402 | di << "Node : " << path.Node().ToCString() << "\n"; | |
403 | di << "UserName : " << path.UserName().ToCString() << "\n"; | |
404 | di << "Password : " << path.Password().ToCString() << "\n"; | |
405 | di << "Disk : " << path.Disk().ToCString() << "\n"; | |
406 | di << "Trek : " << path.Trek().ToCString() << "\n"; | |
407 | di << "Name : " << path.Name().ToCString() << "\n"; | |
408 | di << "Extension : " << path.Extension().ToCString() << "\n"; | |
409 | return 0; | |
410 | } | |
586db386 | 411 | di << "DDocStd_OSDPath : Error\n"; |
7fd59977 | 412 | return 1; |
413 | } | |
414 | ||
415 | ||
416 | //======================================================================= | |
417 | //function : Path | |
418 | //purpose : | |
419 | //======================================================================= | |
420 | ||
421 | static Standard_Integer DDocStd_Path (Draw_Interpretor& di, | |
422 | Standard_Integer nb, | |
423 | const char** a) | |
424 | { | |
425 | if (nb == 2) { | |
94f16a89 | 426 | TDocStd_PathParser path (TCollection_ExtendedString (a[1], Standard_True)); |
ae9f4b64 | 427 | di << "Trek : " << path.Trek() << "\n"; |
428 | di << "Name : " << path.Name() << "\n"; | |
429 | di << "Extension : " << path.Extension() << "\n"; | |
430 | di << "Path : " << path.Path() << "\n"; | |
7fd59977 | 431 | return 0; |
432 | } | |
586db386 | 433 | di << "DDocStd_Path : Error\n"; |
7fd59977 | 434 | return 1; |
435 | } | |
436 | ||
437 | //======================================================================= | |
438 | //function : AddComment | |
439 | //purpose : | |
440 | //======================================================================= | |
441 | static Standard_Integer DDocStd_AddComment (Draw_Interpretor& di, | |
442 | Standard_Integer nb, | |
443 | const char** a) | |
444 | { | |
445 | if (nb == 3) { | |
446 | Handle(TDocStd_Document) D; | |
447 | if (!DDocStd::GetDocument(a[1],D)) return 1; | |
94f16a89 | 448 | TCollection_ExtendedString comment (a[2], Standard_True); |
6fe96f84 | 449 | // Handle(TDocStd_Application) A = DDocStd::GetApplication(); |
7fd59977 | 450 | // A->AddComment(D,comment); |
451 | D->AddComment(comment); | |
452 | return 0; | |
453 | } | |
586db386 | 454 | di << "DDocStd_AddComment : Wrong arguments number\n"; |
7fd59977 | 455 | return 1; |
456 | } | |
457 | ||
458 | //======================================================================= | |
459 | //function : PrintComments | |
460 | //purpose : | |
461 | //======================================================================= | |
462 | static Standard_Integer DDocStd_PrintComments (Draw_Interpretor& di, | |
463 | Standard_Integer nb, | |
464 | const char** a) | |
465 | { | |
466 | if (nb == 2) { | |
467 | Handle(TDocStd_Document) D; | |
468 | if (!DDocStd::GetDocument(a[1],D)) return 1; | |
469 | ||
470 | TColStd_SequenceOfExtendedString comments; | |
471 | D->Comments(comments); | |
472 | ||
473 | for (int i = 1; i <= comments.Length(); i++) | |
474 | { | |
ae9f4b64 | 475 | di << comments(i) << "\n"; |
7fd59977 | 476 | } |
477 | ||
478 | return 0; | |
479 | } | |
586db386 | 480 | di << "DDocStd_PrintComments : Wrong arguments number\n"; |
7fd59977 | 481 | return 1; |
482 | } | |
483 | ||
c2f5b821 | 484 | //======================================================================= |
485 | //function : SetStorageVerison | |
486 | //purpose : | |
487 | //======================================================================= | |
488 | static Standard_Integer DDocStd_SetStorageVersion (Draw_Interpretor& , | |
489 | Standard_Integer nb, | |
490 | const char** a) | |
491 | { | |
b34d86cb | 492 | if (nb == 3) |
c2f5b821 | 493 | { |
b34d86cb | 494 | Handle(TDocStd_Document) D; |
495 | if (!DDocStd::GetDocument(a[1], D)) return 1; | |
496 | const int version = atoi(a[2]); | |
497 | D->ChangeStorageFormatVersion(version); | |
c2f5b821 | 498 | return 0; |
499 | } | |
500 | return 1; | |
501 | } | |
502 | ||
503 | //======================================================================= | |
504 | //function : GetStorageVerison | |
505 | //purpose : | |
506 | //======================================================================= | |
507 | static Standard_Integer DDocStd_GetStorageVersion (Draw_Interpretor& di, | |
b34d86cb | 508 | Standard_Integer nb, |
509 | const char** a) | |
510 | { | |
511 | if (nb == 2) { | |
512 | Handle(TDocStd_Document) D; | |
513 | if (!DDocStd::GetDocument(a[1], D)) return 1; | |
514 | di << D->StorageFormatVersion() << "\n"; | |
515 | return 0; | |
516 | } | |
517 | return 1; | |
c2f5b821 | 518 | } |
519 | ||
7fd59977 | 520 | //======================================================================= |
521 | //function : ApplicationCommands | |
522 | //purpose : | |
523 | //======================================================================= | |
524 | ||
525 | void DDocStd::ApplicationCommands(Draw_Interpretor& theCommands) | |
526 | { | |
527 | ||
528 | static Standard_Boolean done = Standard_False; | |
529 | if (done) return; | |
530 | done = Standard_True; | |
531 | ||
532 | const char* g = "DDocStd application commands"; | |
533 | ||
534 | // user application commands | |
7fd59977 | 535 | theCommands.Add("ListDocuments", |
536 | "ListDocuments", | |
537 | __FILE__, DDocStd_ListDocuments, g); | |
538 | ||
539 | theCommands.Add("NewDocument", | |
540 | "NewDocument docname format", | |
541 | __FILE__, DDocStd_NewDocument, g); | |
542 | ||
7fd59977 | 543 | theCommands.Add("Open", |
4ff92abe | 544 | "Open path docname [-stream]", |
7fd59977 | 545 | __FILE__, DDocStd_Open, g); |
546 | ||
547 | theCommands.Add("SaveAs", | |
030ba648 | 548 | "SaveAs DOC path [saveEmptyLabels: 0|1] [-stream]", |
7fd59977 | 549 | __FILE__, DDocStd_SaveAs, g); |
550 | ||
551 | theCommands.Add("Save", | |
552 | "Save", | |
553 | __FILE__, DDocStd_Save, g); | |
554 | ||
555 | theCommands.Add("Close", | |
556 | "Close DOC", | |
557 | __FILE__, DDocStd_Close, g); | |
558 | ||
559 | theCommands.Add("IsInSession", | |
560 | "IsInSession path", | |
561 | __FILE__, DDocStd_IsInSession, g); | |
562 | ||
563 | theCommands.Add("OSDPath", | |
564 | "OSDPath string", | |
565 | __FILE__, DDocStd_OSDPath, g); | |
566 | ||
567 | theCommands.Add("Path", | |
568 | "Path string", | |
569 | __FILE__, DDocStd_Path, g); | |
570 | ||
571 | theCommands.Add("AddComment", | |
572 | "AddComment Doc string", | |
573 | __FILE__, DDocStd_AddComment, g); | |
574 | ||
575 | theCommands.Add("PrintComments", | |
576 | "PrintComments Doc", | |
577 | __FILE__, DDocStd_PrintComments, g); | |
c2f5b821 | 578 | |
579 | theCommands.Add("GetStorageVersion", | |
b34d86cb | 580 | "GetStorageVersion Doc", |
c2f5b821 | 581 | __FILE__, DDocStd_GetStorageVersion, g); |
582 | theCommands.Add("SetStorageVersion", | |
b34d86cb | 583 | "SetStorageVersion Doc Version", |
c2f5b821 | 584 | __FILE__, DDocStd_SetStorageVersion, g); |
7fd59977 | 585 | } |