* WIP

* WIP

* WIP

* cleaned up multi

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* split up python module

* WIP

* WIP

* WIP

* WIP

* WIP

* ok

* fixed bugs from rebase

* WIP

* fixed broken test

* WIP

* fixed python

* WIP

* sphinx help

* including new commands

* docs

* WIP

* WIP

* more tests

* added missing public header

* WIP
This commit is contained in:
Dhanya Thattil
2019-08-07 11:21:07 +02:00
committed by GitHub
parent 98ddf154b2
commit 4ceee97c03
58 changed files with 2317 additions and 571 deletions

View File

@ -0,0 +1,18 @@
#include "ToString.h"
namespace sls {
std::string ToString(const std::vector<std::string> &vec,
const char delimiter) {
std::ostringstream os;
if (vec.empty())
return os.str();
auto it = vec.cbegin();
os << *it++;
if (vec.size() > 1) {
while (it != vec.cend())
os << delimiter << *it++;
}
return os.str();
}
} // namespace sls

View File

@ -47,6 +47,18 @@ std::string concatenateIfDifferent(const std::vector<T> &container) {
}
}
std::string RemoveUnit(std::string &str) {
auto it = str.begin();
while (it != str.end()) {
if (std::isalpha(*it))
break;
++it;
}
auto pos = it - str.begin();
auto unit = str.substr(pos);
str.erase(it, end(str));
return unit;
}
template std::string concatenateIfDifferent(const std::vector<IpAddr> &);
template std::string concatenateIfDifferent(const std::vector<MacAddr> &);