Debian Codegraph @

Kernel/SaveLoadManager.cpp

raw symbols SCIP
1 /* This file is part of the FaCT++ DL reasoner
2 Copyright (C) 2013-2015 Dmitry Tsarkov and The University of Manchester
3 Copyright (C) 2015-2017 Dmitry Tsarkov
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #include <fstream>
21
22 #include "SaveLoadManager.h"cxx . . $ `<file>/Kernel/SaveLoadManager.h`/
23 #include "tNamedEntry.h"cxx . . $ `<file>/Kernel/tNamedEntry.h`/
24
25 bool
26 SaveLoadManagercxx . . $ SaveLoadManager# :: existsContentcxx . . $ SaveLoadManager#existsContent(50ce9a9e25b4a850). ( void ) const
27 {
28 // context is there if a file can be opened
29 return !stdcxx . . $ std/::ifstreamcxx . . $ std/ifstream#(filenamecxx . . $ SaveLoadManager#filename.).failcxx . . $ std/basic_ios#fail(50ce9a9e25b4a850).();
30 }
31
32 void
33 SaveLoadManagercxx . . $ SaveLoadManager# :: clearContentcxx . . $ SaveLoadManager#clearContent(83f5f38750778ac8). ( void ) const
34 {
35 remove(filenamecxx . . $ SaveLoadManager#filename..c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).());
36 }
37
38 void
39 SaveLoadManagercxx . . $ SaveLoadManager# :: preparecxx . . $ SaveLoadManager#prepare(b45ddcbc8423892c). ( bool input )
40 {
41 // close all previously open streams
42 delete ipcxx . . $ SaveLoadManager#ip.;
43 delete opcxx . . $ SaveLoadManager#op.;
44 ipcxx . . $ SaveLoadManager#ip. = nullptr;
45 opcxx . . $ SaveLoadManager#op. = nullptr;
46
47 // open a new one
48 if ( input )
49 ipcxx . . $ SaveLoadManager#ip. = new stdcxx . . $ std/::ifstreamcxx . . $ std/ifstream#(filenamecxx . . $ SaveLoadManager#filename.);
50 else
51 opcxx . . $ SaveLoadManager#op. = new stdcxx . . $ std/::ofstreamcxx . . $ std/ofstream#(filenamecxx . . $ SaveLoadManager#filename.);
52 }
53
54 void
55 SaveLoadManagercxx . . $ SaveLoadManager# :: registerEcxx . . $ SaveLoadManager#registerE(dccc50802eb9f6d5). ( const TNamedEntrycxx . . $ TNamedEntry#* p )
56 {
57 neMapcxx . . $ SaveLoadManager#neMap..addcxx . . $ SaveLoadManager#PointerMap#add(ebd0a1552f8ce24f).(const_cast<TNamedEntrycxx . . $ TNamedEntry#*>(p));
58 if ( p->getEntitycxx . . $ TNamedEntry#getEntity(1a59bfca6295ee56).() != nullptr )
59 eMapcxx . . $ SaveLoadManager#eMap..addcxx . . $ SaveLoadManager#PointerMap#add(ebd0a1552f8ce24f).(const_cast<TNamedEntitycxx . . $ TNamedEntity#*>(p->getEntitycxx . . $ TNamedEntry#getEntity(1a59bfca6295ee56).()));
60 }
61
62 #if 0
63 bool
64 SaveLoadManager :: clearContent ( void ) const
65 {
66 #ifdef WINDOWS
67 SHFILEOPSTRUCT file_op = {
68 nullptr,
69 FO_DELETE,
70 dirname.c_str(), // FIXME!! fully qualified name expected
71 "",
72 FOF_NOCONFIRMATION |
73 FOF_NOERRORUI |
74 FOF_SILENT,
75 false,
76 0,
77 "" };
78 SHFileOperation(&file_op);
79 #endif
80 }
81 #endif