aboutsummaryrefslogtreecommitdiff
path: root/db/uobject.cpp
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-09-09 17:17:44 +0200
committerneodarz <neodarz@neodarz.net>2019-09-09 17:17:44 +0200
commitbc6aeaa834d666221171d302d4f101ce65608898 (patch)
tree9fecfeb46e4189fb4baebf7f1bd1fb1277b36631 /db/uobject.cpp
parent5b66830ca806e00f415d6ee83b15e410130de371 (diff)
downloadumosapicpp-bc6aeaa834d666221171d302d4f101ce65608898.tar.xz
umosapicpp-bc6aeaa834d666221171d302d4f101ce65608898.zip
Refactoring some code to be more readable
Diffstat (limited to 'db/uobject.cpp')
-rw-r--r--db/uobject.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/db/uobject.cpp b/db/uobject.cpp
index 25b13e6..38b472f 100644
--- a/db/uobject.cpp
+++ b/db/uobject.cpp
@@ -3,7 +3,9 @@
using bsoncxx::builder::basic::kvp;
using bsoncxx::builder::basic::make_document;
-std::string uobject::retrieveAll(std::string collection, struct json_object* jsonObjects) {
+UmosapiService::uobject::uobject() {}
+
+std::string UmosapiService::uobject::retrieveAll(std::string collection, struct json_object* jsonObjects) {
auto conn = mongo.get_connection();
@@ -18,7 +20,7 @@ std::string uobject::retrieveAll(std::string collection, struct json_object* jso
return json_object_to_json_string_ext(jsonObjects, JSON_C_TO_STRING_SPACED | JSON_C_TO_STRING_PRETTY);
}
-std::string uobject::add(std::string collection, struct json_object* jsonObject, const char * body) {
+std::string UmosapiService::uobject::add(std::string collection, struct json_object* jsonObject, const char * body) {
auto conn = mongo.get_connection();
auto coll = (*conn)[config["mongo_db"]][collection];
@@ -77,7 +79,7 @@ std::string uobject::add(std::string collection, struct json_object* jsonObject,
return json_object_to_json_string_ext(jsonObject, JSON_C_TO_STRING_SPACED | JSON_C_TO_STRING_PRETTY);
}
-std::string uobject::remove(std::string collection, std::string oid, struct json_object* jsonObject) {
+std::string UmosapiService::uobject::remove(std::string collection, std::string oid, struct json_object* jsonObject) {
auto conn = mongo.get_connection();
auto coll = (*conn)[config["mongo_db"]][collection];
@@ -109,7 +111,7 @@ std::string uobject::remove(std::string collection, std::string oid, struct json
}
}
-std::string uobject::searchKeyValue(std::string collection, std::string key, std::string value, struct json_object* jsonArray) {
+std::string UmosapiService::uobject::searchKeyValue(std::string collection, std::string key, std::string value, struct json_object* jsonArray) {
auto conn = mongo.get_connection();
auto coll = (*conn)[config["mongo_db"]][collection];