Re: [Cppcms-users] Migration Guide
Brought to you by:
artyom-beilis
From: Markus R. <us...@ma...> - 2012-03-05 14:52:55
|
Hi! Artyom Beilis wrote: >> Yeah, I was also using CppCMS 1.x.x for some time now. > >> But I had some legacy code which needed to be ported to 1.x. >> I am sure, however, I am not the only one in this situation, so I >> finished the article: >> http://cppcms.com/wikipp/en/page/cppcms_1x_migration >> >> CppCMS 1.x is vastly superior to 0.x - I realized that again during >> porting ;) >> > > Yes, I've began to write it but then left as I thought it was not > really required as most of the users had already switched by now. Yeah, you are right. But there is always some legacy code somewhere. >> I am not very fond of json as configuration format - even though it is >> very good as data exchange format - because it lacks comments. > > Actually I was sure that it was mentioned in documentation (but I can't > find it now) There are many discussions about the lacking of comments. > CppCMS json parser supports two extensions to the standard json syntax, > that make it very easy to use for configuration: > > 1. C++ style comments i.e. "//" > 2. It ignores trailing comma in objects and array definitions > so stuff like that works. > > { > "foo" : 10, > "bar" : 20, > // "baz" : 30 > } Yeah, that are useful extensions but in the end it is not json anymore. Perl implemented # comments and others may do other or do not support them at all. > It makes it very suitable as configuration file format. > >> What do you think >> about a patch which let you switch to http://www.libelektra.org/ at >> compiletime if preferred? >> >> Basically it would be just an alternative implementation of >> json::value service::load_settings(int argc,char *argv[]) >> >> What do you think? >> > > I'm not really fond of adding more 3rd party dependencies. > > What is the license libelektra distributed under? It is BSD licenced. And as described: you can choose at build time if you want that dependency or not. >>> I don't understand the question, you mean extra spaces when you press >> on >>> "view plain" ? >> >> Steps to reproduce: >> Go to http://cppcms.com/wikipp/en/page/cppcms_1x_json with firefox/chrome >> Select some text of a sourcecode, press ctrl+c and ctrl+v or middle >> mouse. >> >> I get: >> my_object["name"]="Moshe"; >> my_object["salary"]=1000.0; >> (Note the two spaces at the end of each line) >> >> I expect: >> No spaces at the end of lines. >> >> It seems to be some problem within the syntax highlighter, which >> generates a "<span>; </span>" that adds these two spaces. It is a >> little bit strange, >> because the line numbers are suppressed successfully. >> >> Workaround: >> Press "view plain" and copy there. >> > > I assume that this is syntax highlighter bug > > (I hadn't written it, I just use it) Yeah, I think that too. So its up to me to report the bug there I assume ;) >> Yeah, the decision to drop CgiCC is ok, cppcms is now more homogen and >> easier to use. >> > > Also CgiCC was quite buggy and limited :-) > I don't miss it. ;) best regards Markus |