MCPcopy Create free account
hub / github.com/MaxBelkov/visualsyslog / Save

Method Save

source/cfg.cpp:31–63  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

29
30//---------------------------------------------------------------------------
31void TMainCfg::Save(String file, TStorageFileList * sfl)
32{
33 tinyxml2::XMLDocument doc;
34 doc.InsertEndChild( doc.NewDeclaration() );
35
36 XMLNode * hls = doc.InsertEndChild( doc.NewElement(szSetupNode) );
37
38 XMLElementEx * p;
39
40 p = (XMLElementEx *)doc.NewElement(szMainNode);
41 hls->InsertEndChild(p);
42 p->wb("UdpEnable", UdpEnable);
43 p->ws("UdpInterface", UdpInterface);
44 p->wi("UdpPort", UdpPort);
45 p->wb("TcpEnable", TcpEnable);
46 p->ws("TcpInterface", TcpInterface);
47 p->wi("TcpPort", TcpPort);
48 p->wb("D3", b3D);
49 p->wb("WriteRaw", bWriteRaw);
50 p->wb("ReceiveUTF8", bReceiveUTF8);
51
52 p = (XMLElementEx *)doc.NewElement(szMailNode);
53 hls->InsertEndChild(p);
54 Letter.Save(p);
55
56 sfl->Save(hls);
57
58 XMLError err = doc.SaveFile(file.c_str());
59 if( err != XML_SUCCESS )
60 {
61 ReportError2("Error writing file: \"%s\" [%d]", file.c_str(), (int)err);
62 }
63}
64//---------------------------------------------------------------------------
65void TMainCfg::Load(String file, TStorageFileList * sfl)
66{

Callers 7

UdpReceiveMessageFunction · 0.45
TcpReceiveMessageFunction · 0.45
OKButtonClickMethod · 0.45
OKButtonClickMethod · 0.45
FormDestroyMethod · 0.45
aSetupExecuteMethod · 0.45
ProcessMessageRulesFunction · 0.45

Calls 8

ReportError2Function · 0.85
InsertEndChildMethod · 0.80
NewDeclarationMethod · 0.80
NewElementMethod · 0.80
wbMethod · 0.80
wsMethod · 0.80
wiMethod · 0.80
SaveFileMethod · 0.80

Tested by

no test coverage detected