---------------------------------------------------------------------------
| 29 | |
| 30 | //--------------------------------------------------------------------------- |
| 31 | void 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 | //--------------------------------------------------------------------------- |
| 65 | void TMainCfg::Load(String file, TStorageFileList * sfl) |
| 66 | { |
no test coverage detected