[Cppcms-users] json settings get and set
Brought to you by:
artyom-beilis
|
From: Marcel H. <ke...@co...> - 2012-04-24 09:25:19
|
Hi everyone,
I have a strange error when I try to do the following:
if (hours <= 6 || hours >= 20) { //time between 20 and 6
if (settings().get("internal.isDay", false) == true) {
cache().rise("TimeChange");
settings().set("internal.isDay", false);
}
} else { //time between 7 and 19
if (settings().get("internal.isDay", true) == false) {
cache().rise("TimeChange");
settings().set("internal.isDay", true);
}
}
I tried it at first with set<bool> but it does not work either.
The error is:
/home/marcel/projects/cppcms/BrowserGame/src/backgroundprocessor.cpp: In
member function ‘void BackGroundProcessor::TimeToBackground()’:
/home/marcel/projects/cppcms/BrowserGame/src/backgroundprocessor.cpp:36:42:
error: no matching function for call to ‘cppcms::json::value::set(const
char [15], bool) const’
/home/marcel/projects/cppcms/BrowserGame/src/backgroundprocessor.cpp:36:42:
note: candidates are:
In file included from /usr/local/include/cppcms/service.h:18:0,
from /home/marcel/projects/cppcms/BrowserGame/src/backgroundprocessor.cpp:7:
/usr/local/include/cppcms/json.h:342:8: note: void
cppcms::json::value::set(const string&, const T&) [with T = bool;
std::string = std::basic_string<char>] <near match>
/usr/local/include/cppcms/json.h:342:8: note: no known conversion for
implicit ‘this’ parameter from ‘const cppcms::json::value*’ to
‘cppcms::json::value*’
/usr/local/include/cppcms/json.h:350:8: note: void
cppcms::json::value::set(const char*, const T&) [with T = bool] <near match>
/usr/local/include/cppcms/json.h:350:8: note: no known conversion for
implicit ‘this’ parameter from ‘const cppcms::json::value*’ to
‘cppcms::json::value*’
make[2]: *** [CMakeFiles/bg.dir/src/backgroundprocessor.cpp.o] Error 1
Any suggestions?
Regards,
Marcel
|