c++ string类字符串查找
https://blog.csdn.net/qq_45797026/article/details/108359461
实现插件加载卸载函数:
extern "C" UNTITLEDSHARED_EXPORT GxPluginPackage *CreatePluginPackage();
extern "C" UNTITLEDSHARED_EXPORT void ReleasePluginPackage();
c++ 线程:boost::async(boost::launch::async,std::bind(&TargetRecognizeRunner::run,this));
链接器:-lpthread
延时(ms):poll(0, 0, secs);
#pragma comment(lib, "ws2_32.lib")
#pragma comment (lib, "oes_api.lib")
1、atoi
功 能:把一字符串转换为整数
2、atol
功 能:把一字符串转换为长整形
3、atof
功 能:把一个字符串转换为双精度浮点数
4、strtod
功 能:将字符串转换为双精度浮点型值,并报告不能被转换的所有剩余数字
5、strtol
功 能:将字符串转换为长整形值,并报告不能被转换的所有剩余数字
6、strtoul
功 能:将字符串转换为无符号长整形值,并报告不能被转换的所有剩余数字。
//获取毫秒微秒
#include <sys/time.h>
struct timeval tv;
gettimeofday(&tv, 0);
tv.tv_usec / 1000;
//套接字忽略管道破裂信号
send(clientA_sockfd, send_len.data(), 5, MSG_NOSIGNAL);
/*
centos 修改文件夹权限: chmod -R 777 /path/
ps -aux | grep nginx 查看进程
*/
/*
获取当前时间
return:
now_timec: 当前string格式的时间
*/
std::string get_now_time() {
//时间序列
time_t t = time(0);
//当前时间,char
char now_timec[32] = { NULL };
//将时间序列转换为字符串
strftime(now_timec, sizeof(now_timec), "%Y-%m-%d.%H:%M:%S", localtime(&t));
return now_timec;
}
读写文件:
FILE *fp = NULL;
fp = fopen("TransLog.txt", "a+");
fprintf(fp, "This is testing for fprintf...\n");
fclose(fp);
linux库目录:D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\Linux\include\usr
vs_linux附加依赖项中添加:-lpthread
互斥锁----------------->
#include <mutex>
std::mutex m;
m.lock();
m.unlock();
<-----------------------
//bson->json->反序列化
json str = json::parse(bson_as_canonical_extended_json(doc, NULL));
//json序列化
std::string str = str.dump();
// 执行查询操作
cursor = mongoc_collection_find(collection, MONGOC_QUERY_NONE, 0, 0, 0, query, NULL, NULL);
cursor = mongoc_collection_find_with_opts(collection, query, NULL, NULL);