C++
monkey_four
这个作者很懒,什么都没留下…
展开
-
从路径中取目录/文件/创建目录/判断目录是否存在
/t原创 2014-06-21 14:12:54 · 1673 阅读 · 0 评论 -
C++ 代码中调用scp自动传文件
最近在开发过程中需要把文件传到另一条服务器上,且要写在原创 2014-11-12 14:10:51 · 4420 阅读 · 1 评论 -
c++正则表达式日期格式匹配
匹配的日期格式如:2015-03-05 12:08:20这里用到boost正则表达式匹配库函数,cregex reg = cregex::compile("(\\d{4})-(0\\d{1}|1[0-2])-(0\\d{1}|[12]\\d{1}|3[01])\\s(0\\d{1}|1\\d{1}|2[0-3]):[0-5]\\d{1}:([0-5]\\d{1})"); bool原创 2015-07-02 15:46:35 · 4118 阅读 · 0 评论 -
mongodb数组写操作
mongodb中一条document格式为:先想给数组jobs添加一个元素,如{"job_name":"name1", "finish_time":1435043559}C++代码如下: shared_ptr session = MongoSessionFactory::GetSession(); BSONObjBuilder condition; con原创 2015-06-23 17:10:06 · 678 阅读 · 0 评论 -
CppCMS添加cookie
在做登陆页面时,一般都是通过cookie来原创 2014-10-27 10:38:13 · 829 阅读 · 0 评论 -
简单登陆页面
先看效果图原创 2014-10-11 14:20:59 · 1079 阅读 · 0 评论 -
读取MongoDB ObjectID并转换为string
代码为:boost::shared_ptr LoginService::Login(const std::string& email, const std::string& pwd) { boost::shared_ptr login_page(new LoginPage); mongo::BSONObjBuilder condition; condition.append("em原创 2014-09-23 16:54:16 · 23574 阅读 · 0 评论 -
CentOs 6.5 编译安装Clang++ 3.4.2
fds原创 2014-08-20 12:39:09 · 3056 阅读 · 2 评论 -
MongDB读取操作(c++)
MongoDB中数据存储以BSON串形式原创 2014-08-01 16:50:41 · 1239 阅读 · 0 评论 -
CentOS 安装Boost 1.55.0
1.用rpm -qa boost 查CentOS 6.5自带boost版本原创 2014-09-12 17:31:35 · 11115 阅读 · 1 评论 -
CentOS 6.5升级GCC 4.9.1
1. 下载gcc 4.9.1源代码原创 2014-08-21 15:25:00 · 3474 阅读 · 0 评论 -
单向链表操作
今天花了一天时间把单向lianb原创 2014-08-30 17:10:53 · 440 阅读 · 0 评论 -
MongoDB C++ driver之$or查询
mongo shell语法:{ $or: [ { }, { }, ... , { } ] }选择器$or后面必须是数组,严格说来是BSON Array格式。如:db.getCollection('db.test').find({$or:[{url:"url1"},{url:"url2"}]})如果用C++代码实现逻辑或查询,可以写成: std::shared_ptr s原创 2015-10-13 16:31:04 · 1271 阅读 · 0 评论