I'm maintaining/developing a platform for homework testing. It's mostly automatic. What I need to add now is code analysis. I need to check the code for specific constructs. For example: Does the file main.cpp contain a class named user with a const method get_name() ? Is there some tool out there that would allow me to do such stuff (ideal would be something that can be scripted
我正在维护/开发一个作业测试平台。 这主要是自动的。 我现在需要添加的是代码分析。 我需要检查特定结构的代码。 例如: 文件main.cpp是否包含一个名为user的类,其中包含一个const方法get_name() ? 是否有一些工具可以让我做这样的事情(理想是可以编写脚本的东西)。 仅限Linux。 一种可能是通过GCC运行代码并使用GCC-XML扩展来生成程序内部结构的XML描述。 然后,您可以使用您最喜欢的XML库来解析文档,或者如
FIXED by setting near clipping plane to 1, rather than 0 (not sure why it was like that to start with). See the question for skeleton code, and Adrian's answer for how and why this works. I have a few different camera positions, and my scene consists of a single quad. The quad is such that it projects exactly onto the viewport/window in the first frame. I want to project a texture from
通过将裁剪平面设置为1而不是0来固定(不知道为什么它是这样开始的)。 查看关于框架代码的问题,以及Adrian关于如何以及为何运作的答案。 我有几个不同的摄像头位置,我的场景由一个四边形组成。 四边形是这样的,它正好投影到第一帧的视口/窗口上。 我想从这个相机位置投影到四边形上。 纹理也完全覆盖视口。 我做的第一件事是 // GL_QUADS... glTexCoord2f( /*one corner of s,t space*/); glVertex3f(/
I have a small but itching problem. How do I get the correct case for a Windows path in Qt? Let's say i have a path c:documents and settingswolfgangdocuments stored in a QString str and i want to know the correct case, here C:Document and SettingsWolfgangDocuments . QDir(str).absolutePath() doesn't get me the path with correct case. Any suggestions, since I have no clue what else i
我有一个小但很痒的问题。 我如何在Qt中获得Windows路径的正确大小写? 假设我有一个存储在QString str的路径c:documents and settingswolfgangdocuments ,我想知道正确的大小写,这里是C:Document and SettingsWolfgangDocuments 。 QDir(str).absolutePath()不会为我提供正确大小写的路径。 任何建议,因为我不知道还有什么我可以尝试? 感谢您的时间! 没有简单的方法来做到这一点,但你可以尝试做一个QDir.entryL
I have worked with java for a while now, and I found checkstyle to be very useful. I am starting to work with c++ and I was wondering if there is a style checker with similar functionality. I am mainly looking for the ability to write customized checks. What about Vera++ ? Vera++ is a programmable tool for verification, analysis and transformation of C++ source code. Vera++ is mainly an en
我已经使用了一段时间的java,并且发现checkstyle非常有用。 我开始使用c ++,我想知道是否有一个具有类似功能的样式检查器。 我主要是在寻找写定制检查的能力。 怎么样Vera ++? Vera ++是一款用于验证,分析和转换C ++源代码的可编程工具。 Vera ++主要是一个引擎,用于解析C ++源文件,并以各种集合的形式将解析结果呈现给脚本 - 脚本实际上执行所请求的任务。 点击这里查看更完整的演示。 crc.hpp:157: keyword 'ex
I am currently learning a little bit haskell and started to figure out how monads work. Since I normaly code C++ and I think the monad pattern would be (as fas as I understand it right now) be realy awesome to use in C++, too, for example for futures etc, I wonder if there is a way to implement an interface, or a base class, to enforce a correct overload of the functions bind and return (of ca
我现在正在学习一点Haskell,并开始弄清楚monad是如何工作的。 由于我正常编写C ++代码,因此我认为monad模式(就像我现在所理解的那样)是非常棒的,可以在C ++中使用,例如期货等, 我不知道是否有实现一个接口,或一个基类的方式,来执行的功能的正确的过载bind并return (与另一名原因的比换取C ++)对于派生类型? 为了更清楚我的想法: 考虑我们有以下非会员功能: auto foo(const int x) const -> std::string;
I'd like to be able to introspect a C++ class for its name, contents (ie members and their types) etc. I'm talking native C++ here, not managed C++, which has reflection. I realise C++ supplies some limited information using RTTI. Which additional libraries (or other techniques) could supply this information? What you need to do is have the preprocessor generate reflection data about
我希望能够反省一个C ++类的名称,内容(即成员和他们的类型)等。我在这里讲的是本地C ++,而不是托管C ++,它有反思。 我意识到C ++使用RTTI提供一些有限的信息。 哪些额外的库(或其他技术)可以提供这些信息? 你需要做的是让预处理器产生关于这些字段的反射数据。 这些数据可以存储为嵌套类。 首先,为了使它更容易和更干净地写入预处理器,我们将使用类型化表达式。 类型化表达式就是将该类型放在括号中的表达式。
I've been playing around with embedding resources into my c++ program. In order to do this I hexdump the data to a simple array, ie unsigned char image_png[] ={ 0x0a, 0x0b, 0x0c, 0x0d, ... }; Some of these resources are not used after loading (ie they get converted to something else and then the original data is just bulk... though a small bit of bulk for the ease of distribution might
我一直在玩嵌入资源到我的C ++程序。 为了做到这一点,我hexdump数据到一个简单的数组,即 unsigned char image_png[] ={ 0x0a, 0x0b, 0x0c, 0x0d, ... }; 其中一些资源在加载后不会被使用(即它们被转换为其他东西,然后原始数据只是散装......尽管为了便于分配而少量散装可能是值得的)。 我很好奇是否有办法将资源嵌入到程序中,这样我就不必担心二进制能够找到所有最重要的资源,但是在完成使用之后将其释放,以便
I'm trying to figure out whether the display is off. Just to clarify what I mean by display is off; windows has the Turn off the display options in the power options. I've looked at this MSDN page, and noticed SC_MONITORPOWER parameter which "Sets the state of the display ". Is there any way to get the state of the display? Notes I need to support all windows version &g
我试图弄清楚显示屏是否关闭。 只是为了澄清我的意思是显示是关闭的; windows已关闭电源选项中的显示选项。 我查看了这个MSDN页面,并注意到了“设置显示状态”的SC_MONITORPOWER参数。 有什么方法可以获得显示状态吗? 笔记 我需要支持所有Windows版本> = XP
how to turn wireless on/off programmatically by that I mean doing the same thing as going to metro control panel (in windows 8) and switch the wireless on/off . I have search on Google and in here but all I could find was how to enable/disable a connection(programmatically) and how to enable/disable the adapter. this should be related to Airplane mode but turning it on and off causes the wire
如何以编程方式打开/关闭无线网络,我的意思是与进入地铁控制面板(在Windows 8中)做同样的事情并打开/关闭无线。 我在谷歌上搜索,在这里,但我能找到的是如何启用/禁用连接(以编程方式)以及如何启用/禁用适配器。 这应该与飞行模式有关,但打开和关闭它会导致无线设备停止工作(对于例如东道主的网络,表现很奇怪),直到驱动程序被禁用 - >启用(加上我不知道如何打开/关闭飞行模式)。 - 请帮助标记此问题。
I want to handle power off button pressing on my notebook with Windows 7. I've configured power management options to do nothing on this event, so it will not turn off immediately, but i want to catch the moment when user presses power button. How it can be done in C++? I think there should be some WMI (Windows Management Instrumentation) events for this. Hope this helps: http://msdn.micr
我想用Windows 7处理我的笔记本电脑上的电源关闭按钮。我已经配置了电源管理选项,不会对此事件做任何事情,所以它不会立即关闭,但我想捕捉用户按下电源按钮的时刻。 它如何在C ++中完成? 我认为应该有一些WMI(Windows Management Instrumentation)事件。 希望这有助于:http://msdn.microsoft.com/en-us/library/aa394101%28v=VS.85%29.aspx 这不是特定于笔记本电脑,也不是特定于电源按钮。 这适用于用于关闭机器的