MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / remove

Method remove

src/model/ExternalFile.cpp:65–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 }
64
65 std::vector<IdfObject> ExternalFile_Impl::remove() {
66 if (!fileName().empty()) {
67 path p = filePath();
68 if (exists(p)) {
69 try {
70 boost::filesystem::remove(p);
71 } catch (std::exception&) {
72 LOG(Warn, "Could not remove file \"" << p << "\"");
73 }
74 }
75 }
76
77 std::vector<openstudio::IdfObject> tmp;
78
79 // ScheduleFile
80 std::vector<ScheduleFile> sfs = scheduleFiles();
81 for (auto& scheduleFile : sfs) {
82 std::vector<openstudio::IdfObject> tmp2 = scheduleFile.remove();
83 tmp.insert(tmp.end(), tmp2.begin(), tmp2.end());
84 }
85
86 // PythonPluginInstance
87 std::vector<PythonPluginInstance> ppis = pythonPluginInstances();
88 for (auto& pythonPluginInstance : ppis) {
89 std::vector<openstudio::IdfObject> tmp2 = pythonPluginInstance.remove();
90 tmp.insert(tmp.end(), tmp2.begin(), tmp2.end());
91 }
92
93 // ChillerElectricASHRAE205
94 std::vector<ChillerElectricASHRAE205> chs = chillerElectricASHRAE205s();
95 for (auto& ch : chs) {
96 std::vector<openstudio::IdfObject> tmp2 = ch.remove();
97 tmp.insert(tmp.end(), tmp2.begin(), tmp2.end());
98 }
99
100 std::vector<openstudio::IdfObject> idfObjects = ModelObject_Impl::remove();
101 idfObjects.insert(idfObjects.end(), tmp.begin(), tmp.end());
102
103 return idfObjects;
104 }
105
106 std::string ExternalFile_Impl::fileName() const {
107 boost::optional<std::string> value = getString(OS_External_FileFields::FileName, true);

Callers 1

ExternalFileMethod · 0.45

Calls 4

beginMethod · 0.80
emptyMethod · 0.45
insertMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected