summaryrefslogtreecommitdiff
path: root/libkms++util/helpers.cpp
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-11 20:17:35 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-11 20:17:35 +0300
commit17d180891f1e237ea5d25835999a8b23a6e7946d (patch)
tree5963fe4d338f6272daf55c76ed355effb47afc71 /libkms++util/helpers.cpp
parent38a71ee72c47f3287c327113ce411f236cac05ef (diff)
rename dirs
Diffstat (limited to 'libkms++util/helpers.cpp')
-rw-r--r--libkms++util/helpers.cpp44
1 files changed, 0 insertions, 44 deletions
diff --git a/libkms++util/helpers.cpp b/libkms++util/helpers.cpp
deleted file mode 100644
index 4aa3194..0000000
--- a/libkms++util/helpers.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-#include "kms++util.h"
-#include "strhelpers.h"
-
-using namespace std;
-
-namespace kms {
-
-Connector* resolve_connector(Card& card, const string& str)
-{
- if (str.length() == 0)
- return nullptr;
-
- auto connectors = card.get_connectors();
-
- if (str[0] == '@') {
- char* endptr;
- unsigned id = strtoul(str.c_str() + 1, &endptr, 10);
- if (*endptr == 0) {
- Connector* c = card.get_connector(id);
- if (!c)
- return nullptr;
- else
- return c;
- }
- } else {
- char* endptr;
- unsigned idx = strtoul(str.c_str(), &endptr, 10);
- if (*endptr == 0) {
- if (idx >= connectors.size())
- return nullptr;
- else
- return connectors[idx];
- }
- }
-
- for (Connector* conn : connectors) {
- if (to_lower(conn->fullname()).find(to_lower(str)) != string::npos)
- return conn;
- }
-
- return nullptr;
-}
-
-}