Get rid of wrap-string-view
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
|
||||
#include "wrap-string.hpp"
|
||||
#include "wrap-string-view.hpp"
|
||||
#include "wrap-vector.hpp"
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include "driver-util.hpp"
|
||||
#include "luastack.hpp"
|
||||
#include "util.hpp"
|
||||
|
||||
|
||||
namespace drv {
|
||||
|
||||
void split_host_port(drv::string_view target, drv::string &host, drv::string &port) {
|
||||
void split_host_port(std::string_view target, drv::string &host, drv::string &port) {
|
||||
size_t lastcolon = target.rfind(':');
|
||||
if (lastcolon == drv::string_view::npos) {
|
||||
if (lastcolon == std::string_view::npos) {
|
||||
host = ""; port = ""; return;
|
||||
}
|
||||
host = target.substr(0, lastcolon);
|
||||
@@ -21,11 +23,11 @@ void split_host_port(drv::string_view target, drv::string &host, drv::string &po
|
||||
}
|
||||
}
|
||||
|
||||
drv::vector<drv::string> parse_control_lst(drv::string_view ctrl) {
|
||||
drv::vector<drv::string> parse_control_lst(std::string_view ctrl) {
|
||||
drv::vector<drv::string> result;
|
||||
while (!ctrl.empty()) {
|
||||
drv::string_view line = util::sv_read_line(ctrl);
|
||||
drv::string_view trimmed = util::sv_trim(line);
|
||||
std::string_view line = util::sv_read_line(ctrl);
|
||||
std::string_view trimmed = util::sv_trim(line);
|
||||
if ((trimmed.size() > 0) && (trimmed[0] != '#')) {
|
||||
result.emplace_back(trimmed);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user