Mercurial > octave
changeset 29213:397d043bb2ff
Add changes missing in cf059093ffbc.
* liboctave/util/lo-regexp.h, liboctave/util/lo-regexp.cc (match, is_match,
replace): Add const qualifier to member functions.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Mon, 21 Dec 2020 18:55:51 +0100 |
parents | cf059093ffbc |
children | 6e031c8ed59c |
files | liboctave/util/lo-regexp.cc liboctave/util/lo-regexp.h |
diffstat | 2 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/util/lo-regexp.cc Mon Dec 21 16:48:11 2020 +0100 +++ b/liboctave/util/lo-regexp.cc Mon Dec 21 18:55:51 2020 +0100 @@ -247,7 +247,7 @@ } regexp::match_data - regexp::match (const std::string& buffer) + regexp::match (const std::string& buffer) const { // check if input is valid utf-8 const uint8_t *buf_str = reinterpret_cast<const uint8_t *> (buffer.c_str ()); @@ -465,7 +465,8 @@ } rep_token_t; std::string - regexp::replace (const std::string& buffer, const std::string& replacement) + regexp::replace (const std::string& buffer, + const std::string& replacement) const { std::string retval;
--- a/liboctave/util/lo-regexp.h Mon Dec 21 16:48:11 2020 +0100 +++ b/liboctave/util/lo-regexp.h Mon Dec 21 18:55:51 2020 +0100 @@ -71,16 +71,16 @@ compile_internal (); } - match_data match (const std::string& buffer); + match_data match (const std::string& buffer) const; bool is_match (const std::string& buffer) const; Array<bool> is_match (const string_vector& buffer) const; std::string replace (const std::string& buffer, - const std::string& replacement); + const std::string& replacement) const; - static regexp::match_data + static match_data match (const std::string& pat, const std::string& buffer, const regexp::opts& opt = regexp::opts (), const std::string& who = "regexp")