|
2 | 2 | #include <iostream> |
3 | 3 | #include <algorithm> |
4 | 4 | #include "wsjcpp_yaml.h" |
5 | | -#include "wsjcpp_core.h" |
| 5 | +// #include "wsjcpp_core.h" |
6 | 6 |
|
7 | 7 | int main(int argc, char* argv[]) { |
8 | 8 | std::string TAG = "MAIN"; |
9 | | - WsjcppCore::initRandom(); |
10 | | - std::string appName = std::string(WSJCPP_APP_NAME); |
11 | | - std::string appVersion = std::string(WSJCPP_APP_VERSION); |
12 | | - std::string appLogPath = ".wsjcpp-yaml-logs"; |
13 | | - WsjcppLog::setLogDirectory(appLogPath); |
14 | | - if (!WsjcppCore::dirExists(appLogPath)) { |
15 | | - WsjcppCore::makeDir(appLogPath); |
16 | | - } |
| 9 | + // WsjcppCore::initRandom(); |
| 10 | + // std::string appName = std::string(WSJCPP_APP_NAME); |
| 11 | + // std::string appVersion = std::string(WSJCPP_APP_VERSION); |
| 12 | + // std::string appLogPath = ".wsjcpp-yaml-logs"; |
| 13 | + // WsjcppLog::setLogDirectory(appLogPath); |
| 14 | + // if (!WsjcppCore::dirExists(appLogPath)) { |
| 15 | + // WsjcppCore::makeDir(appLogPath); |
| 16 | + // } |
17 | 17 | WsjcppYaml yaml; |
18 | 18 | std::string sError; |
19 | 19 | std::string sFilePath = "./unit-tests.wsjcpp/data-tests/read-file/example-voiting-app/docker-compose.yml"; |
| 20 | + std::cout << "Reading file " << sFilePath << "..." << std::endl; |
20 | 21 | if (!yaml.loadFromFile(sFilePath, sError)) { |
21 | | - WsjcppLog::err(TAG, "Could not read data from file: " + sError); |
| 22 | + std::cerr << "Error: " << sError.c_str() << std::endl; |
| 23 | + // WsjcppLog::err(TAG, sError); |
22 | 24 | return -1; |
23 | 25 | } |
| 26 | + std::cout << "Done." << std::endl; |
24 | 27 |
|
| 28 | + std::cout << "Saving to file " << sFilePath << "..." << std::endl; |
25 | 29 | if (!yaml.saveToFile(sFilePath, sError)) { |
26 | | - WsjcppLog::err(TAG, "Could not save data to file: " + sError); |
| 30 | + std::cerr << "Could not save data to file: " << sFilePath.c_str() << std::endl << "Error: " << sError.c_str() << std::endl; |
| 31 | + // WsjcppLog::err(TAG, ); |
27 | 32 | return -1; |
28 | 33 | } |
| 34 | + std::cout << "Done." << std::endl; |
| 35 | + |
29 | 36 |
|
30 | 37 | return 0; |
31 | 38 | } |
0 commit comments