mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Improve lint_off to allow multiple messages and comments (#2755 partial).
This commit is contained in:
@@ -327,6 +327,14 @@ string VString::replaceWord(const string& str, const string& from, const string&
|
||||
return result;
|
||||
}
|
||||
|
||||
std::deque<string> VString::split(const string& str, char delimiter) {
|
||||
std::deque<std::string> results;
|
||||
std::istringstream is{str};
|
||||
std::string token;
|
||||
while (std::getline(is, token, delimiter)) results.push_back(token);
|
||||
return results;
|
||||
}
|
||||
|
||||
bool VString::endsWith(const string& str, const string& suffix) {
|
||||
if (str.length() < suffix.length()) return false;
|
||||
return str.compare(str.length() - suffix.length(), suffix.length(), suffix) == 0;
|
||||
|
||||
Reference in New Issue
Block a user