shared
This commit is contained in:
parent
728129e5ce
commit
a1e98c1bdc
@ -720,7 +720,9 @@ bool ConfSimple::commentsAsXML(ostream& out)
|
||||
{
|
||||
string::size_type pos = line.m_data.find_first_not_of("# ");
|
||||
if (pos != string::npos) {
|
||||
out << line.m_data.substr(pos) << endl;
|
||||
out << line.m_data.substr(pos) << "\n";
|
||||
} else {
|
||||
out << "\n";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@ -347,7 +347,7 @@ template void stringsToCSV<vector<string> >(const vector<string>&, string&,
|
||||
#endif
|
||||
|
||||
void stringToTokens(const string& str, vector<string>& tokens,
|
||||
const string& delims, bool skipinit)
|
||||
const string& delims, bool skipinit, bool allowempty)
|
||||
{
|
||||
string::size_type startPos = 0, pos;
|
||||
|
||||
@ -367,7 +367,7 @@ void stringToTokens(const string& str, vector<string>& tokens,
|
||||
}
|
||||
if (pos == startPos) {
|
||||
// Dont' push empty tokens after first
|
||||
if (tokens.empty()) {
|
||||
if (allowempty || tokens.empty()) {
|
||||
tokens.emplace_back();
|
||||
}
|
||||
startPos = ++pos;
|
||||
|
||||
@ -142,7 +142,7 @@ template <class T> void stringsToCSV(const T& tokens, std::string& s,
|
||||
extern void stringToTokens(const std::string& s,
|
||||
std::vector<std::string>& tokens,
|
||||
const std::string& delims = " \t",
|
||||
bool skipinit = true);
|
||||
bool skipinit = true, bool allowempty = false);
|
||||
|
||||
/** Like toTokens but with multichar separator */
|
||||
extern void stringSplitString(const std::string& str,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user