[英]Sending data from C++ to Website
I'm recently working on a project where I have classes written in C++ and a website which is written with HTML5 and JavaScript. 我最近在一个项目中工作,该项目具有用C ++编写的类和一个使用HTML5和JavaScript编写的网站。 Now I want to have data from the C++ program sent to the website.
现在,我想将C ++程序中的数据发送到网站。 Which way is the best to solve that?
最好的解决方法是哪种?
I was looking around for AMQP, WebSockets and JSON. 我一直在寻找AMQP,WebSockets和JSON。 But I didn't get how I can use them and what is the best for this problem and how I can use these technologies.
但是我不知道如何使用它们,什么才是解决此问题的最佳方法,以及如何使用这些技术。
I recommend to use the C++ webtoolkit Wt (pronounced Witty), at http://www.webtoolkit.eu/ . 我建议使用http://www.webtoolkit.eu/上的C ++ webtoolkit Wt(发音为Witty)。
This framework (with integrated application server) lets you design web applications in terms of widgets and signal/slot connections, and leaves much of the web cruft in the hands of the library. 该框架(带有集成的应用程序服务器)使您可以根据小部件和信号/插槽连接来设计Web应用程序,并将大部分Web任务留给了图书馆。 The resulting applications are object-oriented, strictly typed, and perfectly maintainable.
生成的应用程序是面向对象的,严格类型化的且可完美维护的。 The library autodetects the browser's capabilities and uses the proper way to render the site, avoiding browser bugs.
该库会自动检测浏览器的功能,并使用正确的方式呈现网站,从而避免浏览器出现错误。
Wt is written in a modern C++ style, which doesn't need to lead to memory leaks and other mishaps that have always been associated with C++ applications. Wt以现代C ++风格编写,不需要导致内存泄漏和其他与C ++应用程序始终相关的不幸。 C++ is as good as any other language around.
C ++与其他语言一样好。 It is not a matter of performance, it is a matter of style.
这不是性能的问题,而是风格的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.