@@ -26,7 +26,11 @@ Official Source Code: https://github.com/wsjcpp/wsjcpp-yaml
2626
2727#include < string.h>
2828#include < iostream>
29+ #include < sstream>
2930#include < algorithm>
31+ #if defined(__CODEGEARC__)
32+ #include < tchar.h>
33+ #endif
3034#include " examples.h"
3135#include " wsjcpp_yaml.h"
3236
@@ -35,22 +39,42 @@ Official Source Code: https://github.com/wsjcpp/wsjcpp-yaml
3539class MyLogger : public IWsjcppYamlLog {
3640 public:
3741 // IWsjcppYamlLog
42+ #if defined(__CODEGEARC__) && !defined(__clang__)
43+ virtual void err (const std::string &TAG, const std::string &sMessage ) {
44+ #else
3845 virtual void err (const std::string &TAG, const std::string &sMessage ) override {
39- std::cerr << TAG << " [error] : " << sMessage << std::endl;
46+ #endif
47+ std::cerr << TAG.c_str () << " [error] : " << sMessage .c_str () << std::endl;
4048 };
49+ #if defined(__CODEGEARC__) && !defined(__clang__)
50+ virtual void throw_err (const std::string &TAG, const std::string &sMessage ) {
51+ #else
4152 virtual void throw_err (const std::string &TAG, const std::string &sMessage ) override {
53+ #endif
4254 std::cerr << TAG << " [critical_error] : " << sMessage << std::endl;
4355 throw std::runtime_error (TAG + " [critical_error] : " + sMessage );
4456 };
57+ #if defined(__CODEGEARC__) && !defined(__clang__)
58+ virtual void warn (const std::string &TAG, const std::string &sMessage ) {
59+ #else
4560 virtual void warn (const std::string &TAG, const std::string &sMessage ) override {
61+ #endif
4662 std::cerr << TAG << " [warn] : " << sMessage << std::endl;
4763 };
64+ #if defined(__CODEGEARC__) && !defined(__clang__)
65+ virtual void info (const std::string &TAG, const std::string &sMessage ) {
66+ #else
4867 virtual void info (const std::string &TAG, const std::string &sMessage ) override {
68+ #endif
4969 std::cout << TAG << " [info] : " << sMessage << std::endl;
5070 };
5171};
5272
73+ #if defined(__CODEGEARC__)
74+ int _tmain (int argc, _TCHAR* argv[]) {
75+ #else
5376int main (int argc, char * argv[]) {
77+ #endif
5478 std::string TAG = " MAIN" ;
5579 // WsjcppCore::initRandom();
5680 // std::string appName = std::string(WSJCPP_APP_NAME);
0 commit comments