MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / store

Method store

src/openms/source/FORMAT/ParamXMLFile.cpp:30–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28 }
29
30 void ParamXMLFile::store(const String& filename, const Param& param) const
31 {
32 //open file
33 std::ofstream os_;
34 std::ostream* os_ptr;
35 if (filename != "-")
36 {
37 os_.open(filename.c_str(), std::ofstream::out);
38 if (!os_)
39 {
40 throw Exception::UnableToCreateFile(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, filename);
41 }
42 os_ptr = &os_;
43 }
44 else
45 {
46 os_ptr = &std::cout;
47 }
48
49 //write to file stream
50 writeXMLToStream(os_ptr, param);
51
52 os_.close();
53 }
54
55 void ParamXMLFile::writeXMLToStream(std::ostream* os_ptr, const Param& param) const
56 {

Callers 4

writeParamsIfRequestedFunction · 0.95
_testParamFunction · 0.95
testParamXMLFileFunction · 0.95
mainFunction · 0.95

Calls 2

openMethod · 0.45
closeMethod · 0.45

Tested by 2

_testParamFunction · 0.76
testParamXMLFileFunction · 0.76