共 50 篇文章 |
|
_finddata_t fileInfo;2. 遍历文件夹及其子文件夹下所有文件。do{ //判断是否有子目录 if (FileInfo.attrib &_A_SUBDIR) { //这个语句很重要 if( (strcmp(FileInfo.name,".") != 0 ) &&(strcmp(FileInfo.name,"..") != 0)) { string newPath = folderPath + "\\" + FileInfo.name; dfsFolder(newP... 阅30 转自Sachchit 公众公开 13-10-12 17:33 |
linux qt 隐藏鼠标 热拔插 USB 鼠标 指针。在main函数中,实例化了APPLICATION后,调用QApplication::setOverrideCursor(Qt::BlankCursor);任一控件下显示与关闭鼠标this->setCursor(Qt::BlankCursor); //隐藏鼠标this->setCursor(Qt::ArrowCursor); //显示正常鼠标this改为需要隐藏鼠标的部件,就可以令当鼠标移动到该部件时候,效果... 阅20 转自若渴若愚 公众公开 12-11-25 11:41 |
Linux两个函数mbstowcs() 与wcstombs()Linux两个函数mbstowcs() 与wcstombs()int n = wcstombs(str,wcstr,55);还有呢,转码还可以使iconv函数族,包含以下三个函数:iconv_t iconv_open(const char *tocode, const char *fromcode);size_t iconv(iconv_t cd,char **inbuf,size_t *inbytesleft,char **outbuf,size_t *outbytesleft);int iconv_c... 阅68 转自shanewfx 公众公开 12-09-26 12:14 |
case 3: //这里就开始进行UTF8->Unicode temp[j + 1] = ((utf8[i] &0x0F) <<4) | ((utf8[i + 1] >>2) &0x0F); temp[j] = ((utf8[i + 1] &0x03) <<6) + (utf8[i + 2] &0x3F);j++) { if (code_table[j - 1].unicode >code_table[j].... 阅8243 转57 评0 公众公开 12-09-26 12:11 |
#include <iconv.h>iconv函数族有三个函数,原型如下:(1) iconv_t iconv_open(const char *tocode, const char *fromcode);此函数说明将要进行哪两种编码的转换,tocode是目标编码,fromcode是原编码,该函数返回一个转换句柄,供以下两个函数使用。(3) int iconv_close(iconv_t cd);//代码转换:从一种编码转为另一种编码int code_convert(cha... 阅123 转0 评0 公众公开 12-09-26 12:09 |
计算程序运行时间我们有时需要得到程序的运行时间,但我们也要知道,根本不可能精确测量某一个程序运行的确切时间 [3],文献[4]中说的很明白,现摘录如下。操作系统用计时器来记录每个进程使用的累计时间,原理很简单,计时器中断发生时,操作系统会在当前进程列表中寻找哪个进程是活动的,一旦发现进程A正在运行立马就给进程A的计数值增加计时... 阅20 转自开花结果 公众公开 12-09-26 12:00 |
linux下串口的阻塞和非阻塞操作有两个可以进行控制串口阻塞性(同时控制read和write):一个是在打开串口的时候,open函数是否带O_NDELAY;对于read,no block指当串口输入缓冲区没有数据的时候,read函数立即返回,返回值为0。对于write,no block指当串口输出缓冲区满,或剩下的空间小于将要写入的字节数,则write将进行写操作,写入当前串口... 阅111 转0 评0 公众公开 12-09-26 12:00 |
#include <stdio.h>#include <string.h>#include <stdlib.h>int LeakTest(char * Para){ if(NULL==Para){ //local_log("LeakTest Func: empty parameter\n");}int LeakTest(char * Para){ char * Logmsg = new char[128];./beam-3.4.2/bin/beam_configure --c gcc./beam-3.4.2/bin/beam_configure --cpp g++./beam... 阅99 转0 评0 公众公开 12-09-26 11:37 |
SHR:shared memory 共享内存1、除了自身进程的共享内存,也包括其他进程的共享内存2、虽然进程只使用了几个共享库的函数,但它包含了整个共享库的大小3、计算某个进程所占的物理内存大小公式:RES – SHR4、swap out后,它将会降下来。序号 列名 含义a PID 进程idb PPID 父进程idc RUSER Real user named UID 进程所有者的用户ide USER 进程所... 阅8429 转12 评0 公众公开 12-09-25 21:14 |
QString QString::fromAscii ( const char * str, int size = -1 )QString QString::fromLatin1 ( const char * str, int size = -1 ) QString QString::fromLocal8Bit ( const char * str, int size = -1 )QString QString::fromUtf8 ( const char * str, int size = -1 )2 string --> QStringQString::fromStdString(string)3 QString ---... 阅213 转0 评0 公众公开 12-09-23 11:11 |