summaryrefslogtreecommitdiff
path: root/src/cardTypeHandlerInfo.cpp
diff options
context:
space:
mode:
authorAotrix <[email protected]>2025-10-23 21:50:40 +0200
committerAotrix <[email protected]>2025-10-23 21:50:40 +0200
commitc52572cda2da510de941e99edacfe5d3f93e1bc6 (patch)
tree248fb5a33b69dce452c13f946838d5c0dd643158 /src/cardTypeHandlerInfo.cpp
parent22f0f64d883f4d5322d8ae071197ee24227262d2 (diff)
formatted text
Diffstat (limited to 'src/cardTypeHandlerInfo.cpp')
-rw-r--r--src/cardTypeHandlerInfo.cpp53
1 files changed, 22 insertions, 31 deletions
diff --git a/src/cardTypeHandlerInfo.cpp b/src/cardTypeHandlerInfo.cpp
index b49057a..46e8f56 100644
--- a/src/cardTypeHandlerInfo.cpp
+++ b/src/cardTypeHandlerInfo.cpp
@@ -1,41 +1,32 @@
#include "cardTypeHandlerInfo.hpp"
-void CardTypeHandlerInfo::addCardInfo(
- const std::string &kCardType, const std::string &kCardValueRegex,
- const std::function<const std::string(const std::string &)>
- kJSONToSQLConverter) {
- // TODO: complete
+void CardTypeHandlerInfo::addCardInfo(const std::string &kCardType, const std::string &kCardValueRegex,
+ const std::function<const std::string(const std::string &)> kJSONToSQLConverter) {
}
const CardTypeHandlerInfo cardTypeHandlerInfoList() {
CardTypeHandlerInfo aCardTypeHandlerInfo;
- aCardTypeHandlerInfo.addCardInfo(
- "INT", "[0-9]+",
- [](const std::string &kJSONContent) { return kJSONContent; });
-
- aCardTypeHandlerInfo.addCardInfo(
- "BOOL", "true|false",
- [](const std::string &kJSONContent) { return kJSONContent; });
-
- aCardTypeHandlerInfo.addCardInfo(
- "STRING", "\"[^\"?]*\"", [](const std::string &kJSONContent) {
- std::string aCopyOfJSONValue = kJSONContent;
- *aCopyOfJSONValue.begin() = '\'';
- *std::prev(aCopyOfJSONValue.end()) = '\'';
- return aCopyOfJSONValue;
- });
-
- aCardTypeHandlerInfo.addCardInfo(
- "LIST_OF_INT", "\\[[0-9,]*\\]", [](const std::string &kJSONContent) {
- std::string aCopyOfJSONValue = kJSONContent;
- aCopyOfJSONValue.append("\'");
- aCopyOfJSONValue.insert(aCopyOfJSONValue.begin(), '\'');
- return aCopyOfJSONValue;
- });
-
- aCardTypeHandlerInfo.addCardInfo(
- "NULL", "null", [](const std::string &kJSONContent) { return "NULL"; });
+ aCardTypeHandlerInfo.addCardInfo("INT", "[0-9]+", [](const std::string &kJSONContent) { return kJSONContent; });
+
+ aCardTypeHandlerInfo.addCardInfo("BOOL", "true|false",
+ [](const std::string &kJSONContent) { return kJSONContent; });
+
+ aCardTypeHandlerInfo.addCardInfo("STRING", "\"[^\"?]*\"", [](const std::string &kJSONContent) {
+ std::string aCopyOfJSONValue = kJSONContent;
+ *aCopyOfJSONValue.begin() = '\'';
+ *std::prev(aCopyOfJSONValue.end()) = '\'';
+ return aCopyOfJSONValue;
+ });
+
+ aCardTypeHandlerInfo.addCardInfo("LIST_OF_INT", "\\[[0-9,]*\\]", [](const std::string &kJSONContent) {
+ std::string aCopyOfJSONValue = kJSONContent;
+ aCopyOfJSONValue.append("\'");
+ aCopyOfJSONValue.insert(aCopyOfJSONValue.begin(), '\'');
+ return aCopyOfJSONValue;
+ });
+
+ aCardTypeHandlerInfo.addCardInfo("NULL", "null", [](const std::string &kJSONContent) { return "NULL"; });
return aCardTypeHandlerInfo;
}