| 28 | })"; |
| 29 | |
| 30 | bool wd::common::Config::parse() |
| 31 | { |
| 32 | try |
| 33 | { |
| 34 | if (!pDirectory->fileExists("winDurango.json")) { |
| 35 | pFile = pDirectory->CreateFile("winDurango.json"); |
| 36 | pFile->open(); |
| 37 | pFile->write(jsonTemplate); |
| 38 | } else { |
| 39 | pFile = pDirectory->CreateFile("winDurango.json"); |
| 40 | pFile->open(); |
| 41 | pFile->write(jsonTemplate); |
| 42 | } |
| 43 | std::string jsonData = pFile->read(); |
| 44 | data = nlohmann::json::parse(jsonData); |
| 45 | return true; |
| 46 | } |
| 47 | catch (const std::exception &e) |
| 48 | { |
| 49 | return false; |
| 50 | } |
| 51 | catch (...) |
| 52 | { |
| 53 | return false; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | const nlohmann::json& wd::common::Config::jsonData() |
| 58 | { |
no test coverage detected