Skip to content

Commit 025f935

Browse files
author
Daniel Kroening
committed
remove deprecated split_string variant
This function has been deprecated since 14.11.2019, and the replacement is easy to put in place.
1 parent cd3c603 commit 025f935

File tree

2 files changed

+9
-22
lines changed

2 files changed

+9
-22
lines changed

src/util/string_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ void split_string(
9999
// delim can't be a space character if using strip
100100
PRECONDITION(!std::isspace(delim) || !strip);
101101

102-
std::vector<std::string> result;
102+
std::vector<std::string> result =
103+
split_string(s, delim, strip);
103104

104-
split_string(s, delim, result, strip);
105105
if(result.size() != 2)
106106
{
107107
throw deserialization_exceptiont{"expected string '" + s +

src/util/string_utils.h

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,22 @@ std::string strip_string(const std::string &s);
2020

2121
std::string capitalize(const std::string &str);
2222

23+
void split_string(
24+
const std::string &s,
25+
char delim,
26+
std::string &left,
27+
std::string &right,
28+
bool strip=false);
29+
2330
/// Given a string s, split into a sequence of substrings when separated by
2431
/// specified delimiter.
2532
/// \param s: The string to split up
2633
/// \param delim: The character to use as the delimiter
27-
/// \param [out] result: The sub strings. Must be empty.
2834
/// \param strip: If true, strip_string will be used on each element, removing
2935
/// whitespace from the beginning and end of each element
3036
/// \param remove_empty: If true, all empty-string elements will be removed.
3137
/// This is applied after strip so whitespace only elements will be removed if
3238
/// both are set to true.
33-
DEPRECATED(SINCE(
34-
2019,
35-
11,
36-
14,
37-
"use split_string(s, delim, strip, remove_empty) instead"))
38-
void split_string(
39-
const std::string &s,
40-
char delim,
41-
std::vector<std::string> &result,
42-
bool strip = false,
43-
bool remove_empty = false);
44-
45-
void split_string(
46-
const std::string &s,
47-
char delim,
48-
std::string &left,
49-
std::string &right,
50-
bool strip=false);
51-
5239
std::vector<std::string> split_string(
5340
const std::string &s,
5441
char delim,

0 commit comments

Comments
 (0)