-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathkit.hpp
55 lines (41 loc) · 1.61 KB
/
kit.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// kit.hpp
// Neo4j-cpp-driver
//
// Created by skyblue on 2017/7/9.
// Copyright © 2017年 skyblue. All rights reserved.
//
#ifndef kit_hpp
#define kit_hpp
#include <iostream>
#include <string>
#include <json/json.h>
namespace neo4jDriver
{
class Kit
{
public:
/*
* 解析出HTTP协议头中的状态码
*/
static std::string getStatusCode(std::string httpHeader);
/*
* 根据字段名和属性数组生成条件字符串
*/
static std::string getWhereString(std::string fieldName, Json::Value &properties, std::string idFieldName = "");
static std::string getWhereString(std::string fieldName, std::string propertiesNamePrefix, Json::Value &properties, std::string idFieldName = "");
/*
* 根据字段名和属性数组生成设置字符串
*/
static std::string getSetString(std::string fieldName, Json::Value &properties);
/*
* 根据label数组生成label字符串
*/
static std::string getLabelString(const std::vector<std::string> &labels);
static unsigned long long int getNodeOrRelationshipID(std::string nodeOrRelationshipSelf);
private:
static std::string append(std::string fieldName, Json::Value &properties, std::string appendToken, std::string idFieldName = "");
static std::string append(std::string fieldName, std::string propertiesNamePrefix, Json::Value &properties, std::string appendToken, std::string idFieldName = "");
};
}
#endif /* kit_hpp */