Mercurial > jwe > octave
diff src/DLD-FUNCTIONS/regexp.cc @ 5765:7ba9ad1fec11
[project @ 2006-04-17 05:05:15 by jwe]
author | jwe |
---|---|
date | Mon, 17 Apr 2006 05:05:17 +0000 |
parents | 8d7162924bd3 |
children | 5c1feeea5227 |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/regexp.cc Sun Apr 16 19:10:01 2006 +0000 +++ b/src/DLD-FUNCTIONS/regexp.cc Mon Apr 17 05:05:17 2006 +0000 @@ -27,6 +27,8 @@ #include <config.h> #endif +#include <sstream> + #include "defun-dld.h" #include "error.h" #include "gripes.h" @@ -127,7 +129,7 @@ string_vector named; int nnames = 0; int inames = 0; - OSSTREAM buf; + std::ostringstream buf; Array<int> named_idx; while ((new_pos = pattern.find ("(?<",pos)) != NPOS) @@ -170,7 +172,7 @@ pos = tmp_pos; } - buf << pattern.substr(pos) << OSSTREAM_ENDS; + buf << pattern.substr(pos); if (error_state) return retval; @@ -179,10 +181,10 @@ pcre *re; const char *err; int erroffset; - re = pcre_compile(OSSTREAM_C_STR(buf), - (case_insensitive ? PCRE_CASELESS : 0), - &err, &erroffset, NULL); - OSSTREAM_FREEZE (buf); + std::string buf_str = buf.str (); + re = pcre_compile (buf_str.c_str (), + (case_insensitive ? PCRE_CASELESS : 0), + &err, &erroffset, NULL); if (re == NULL) { error("%s: %s at position %d of expression", nm.c_str(),