原创 std::bind 用法

#include <string> #include <functional> #include <iostream> using namespace std; class Worker { public: static Worke

原创 opencv 圖像編碼

#include "utils/FileOps.h" #include "opencv2/opencv.hpp" using namespace std; int main() { cv::Mat src = cv::imread(

原创 C++ STL 實現全排列與組合

#include <algorithm> #include <string> #include <vector> using namespace std; template <typename T> void combine_inne

原创 opencv 透視變換

cv::Point2f src_pts[4]; src_pts[0] = coners[0]; src_pts[1] = coners[1]; src_pts[2] = c

原创 windows下的計時函數

#ifndef TIMESTAMP_H #define TIMESTAMP_H #include <windows.h> inline __int64 getCount() { LARGE_INTEGER _count;

原创 c++ windows api 獲取文件版本號

#include <string> #include <windows.h> #pragma comment(lib,"version.lib") bool QueryValue(const std::string& ValueNa

原创 c++ windows 生成guid

std::string getNewGuid() { GUID guid; ::CoCreateGuid(&guid); const int len = 60; char dst[len]; m

原创 C++用宏定義實現PROPERTY

#define PROPERTY_RW(T,var) public: \ void set_##var(const T& _var){m_##var=_var;}\ T get_##var(){return m_##var;}\ pri

原创 dll parser

#pragma once #ifndef _DLL_PARSER_H_ #define _DLL_PARSER_H_ #include <string> #include <map> #include <functional> #in

原创 C++簡單配置文件程序(基於rapidjson)

#include <string> #include <map> #include <algorithm> #ifdef _WIN32 #pragma warning(disable:4996) #include <windows.h

原创 rapidjosn 使用

    std::string output;     readFileContent("dotline.coh", output);     printf("%d\n", output.size());          Documen

原创 base64編解碼

#include <string> void base64Decode(const std::string &input, std::string &output) { //解碼錶 const char DecodeT

原创 SHA-256算法

#include <iostream> #include <string> #ifndef SUCCESS #define SUCCESS 0 #endif // SUCCESS #ifndef FAIL #define FAIL

原创 STL容器和shared_ptr的正確用法

#include <string> #include <vector> #include <memory> #include <map> template <class T> using SPVEC = std::vector<std

原创 C++11 字符串與數字互轉

#pragma once #ifndef _STRING_CONVERT #define _STRING_CONVERT #include <string> template<class T> std::string toStr