Fix a bug in function registry, improve docs
This commit is contained in:
@@ -177,6 +177,24 @@ StringVec split_lines(const std::string &s) {
|
||||
return result;
|
||||
}
|
||||
|
||||
StringVec split_docstring(const std::string &s) {
|
||||
StringVec result;
|
||||
int start = 0;
|
||||
for (int i = 0; i < int(s.size()); i++) {
|
||||
if (s[i]=='|') {
|
||||
int len = i-start;
|
||||
if ((len > 0)||(start > 0)) {
|
||||
result.push_back(s.substr(start, i-start));
|
||||
}
|
||||
start = i + 1;
|
||||
}
|
||||
}
|
||||
if (start < int(s.size())) {
|
||||
result.push_back(s.substr(start, s.size()-start));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string join(const StringVec &strs, const std::string &sep) {
|
||||
if (strs.empty()) return "";
|
||||
std::ostringstream oss;
|
||||
|
||||
Reference in New Issue
Block a user