Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to replace Rogue Wave tools.h++

262 views
Skip to first unread message

Alwyn Teh

unread,
Feb 7, 2022, 7:50:23 AM2/7/22
to
Hi,

Please see the following post:
https://groups.google.com/g/comp.lang.tcl/c/r0-8i4vKd9Q

I want to replace Rogue Wave tools.h++ used in an old C++ Unix program with the latest standard libraries. How do I go about doing this?

The classes and header files used are:
63 RWCString
35 RWCollectableString
8 RWHashDictionaryIterator
7 RWHashDictionary
4 RWOrdered
4 RWCRegexp
3 RWSortedVector
3 RWCTokenizer
2 RWOrderedIterator
2 RWHashDictionary
1 RWSortedVectorIterator
1 RWSet
1 RWRegexp
1 RWCollectable
1 RWBitVec

13 <rw/cstring.h>
7 <rw/hashdict.h>
5 <rw/regexp.h>
5 <rw/ordcltn.h>
4 <rw/collect.h>
3 <rw/collstr.h>
2 <rw/rwset.h>
2 <rw/ctoken.h>
1 <rw/tooldefs.h>
1 <rw/sortvec.h>
1 <rw/bitvec.h>
1 <rw/bintree.h>

Thanks.

Alf P. Steinbach

unread,
Feb 7, 2022, 9:11:02 AM2/7/22
to
On 7 Feb 2022 13:49, Alwyn Teh wrote:
> Hi,
>
> Please see the following post:
> https://groups.google.com/g/comp.lang.tcl/c/r0-8i4vKd9Q
>
> I want to replace Rogue Wave tools.h++ used in an old C++ Unix program with the latest standard libraries. How do I go about doing this?
>

I'm unfamiliar with that library, but judging from the names:


> The classes and header files used are:
> 63 RWCString

`std::string`


> 35 RWCollectableString

`std::string`


> 8 RWHashDictionaryIterator

std::unordered_map::iterator


> 7 RWHashDictionary

std::unordered_map (or std::unordered_set)


> 4 RWOrdered

Possibly std::map or std::set


> 4 RWCRegexp

Oh, the now deprecated `std::regexp`. Problem that it doesn't handle
UTF-8 very well.


> 3 RWSortedVector

Nothing like it. Possibly `std::multiset`.


> 3 RWCTokenizer

`std::istringstream`, but better make your own because the streams are
inefficient (due to silly design with locale support and inversion of
layers of abstraction) and complex.


> 2 RWOrderedIterator

n/a


> 2 RWHashDictionary

std::unordered_map or std::unordered_set


> 1 RWSortedVectorIterator

-

> 1 RWSet

std::set


> 1 RWRegexp

Unclear what's the difference with RWCRegexp?


> 1 RWCollectable

Nothing like it, sounds like a Jave-esque `Object`.


> 1 RWBitVec

`std::vector<bool>` (dynamic) or `std::bitset` (fixed size)


> > 13 <rw/cstring.h>
> 7 <rw/hashdict.h>
> 5 <rw/regexp.h>
> 5 <rw/ordcltn.h>
> 4 <rw/collect.h>
> 3 <rw/collstr.h>
> 2 <rw/rwset.h>
> 2 <rw/ctoken.h>
> 1 <rw/tooldefs.h>
> 1 <rw/sortvec.h>
> 1 <rw/bitvec.h>
> 1 <rw/bintree.h>
>
> Thanks.

You're welcome.

See <url: https://en.cppreference.com/w/> for details and general info.


- Alf

Juha Nieminen

unread,
Feb 8, 2022, 2:11:26 AM2/8/22
to
Alf P. Steinbach <alf.p.s...@gmail.com> wrote:
> Oh, the now deprecated `std::regexp`. Problem that it doesn't handle
> UTF-8 very well.

I'm not aware of there being, or there having ever been, a std::regexp.

If you mean std::regex, I can't find any reference to it being deprecated.
Could you elaborate?

Ralf Goertz

unread,
Feb 8, 2022, 2:56:38 AM2/8/22
to
Am Tue, 8 Feb 2022 07:10:43 -0000 (UTC)
schrieb Juha Nieminen <nos...@thanks.invalid>:

> Alf P. Steinbach <alf.p.s...@gmail.com> wrote:
> > Oh, the now deprecated `std::regexp`. Problem that it doesn't
> > handle UTF-8 very well.
>
> I'm not aware of there being, or there having ever been, a
> std::regexp.

He might have fallen into the same trap I often fall into: it's called
“regexp” in sql.

Jorgen Grahn

unread,
Feb 13, 2022, 4:42:08 AM2/13/22
to
On Mon, 2022-02-07, Alwyn Teh wrote:
> Hi,
>
> Please see the following post:
> https://groups.google.com/g/comp.lang.tcl/c/r0-8i4vKd9Q
>
> I want to replace Rogue Wave tools.h++ used in an old C++ Unix
> program with the latest standard libraries. How do I go about doing
> this?
>
> The classes and header files used are:
> 63 RWCString
> 35 RWCollectableString
> 8 RWHashDictionaryIterator
> 7 RWHashDictionary
> 4 RWOrdered
> 4 RWCRegexp
> 3 RWSortedVector
> 3 RWCTokenizer
> 2 RWOrderedIterator
> 2 RWHashDictionary
> 1 RWSortedVectorIterator
> 1 RWSet
> 1 RWRegexp
> 1 RWCollectable
> 1 RWBitVec

Like Alf noted there are standard types for most of those things now
(and for the past 25 years). But they're probably going to work a lot
differently from the tools.h++ APIs. So you're going to have to
rewrite it piece by piece.

Maybe you can write wrapper classes for some of the things. Maybe
someone already has, but in that case those wrappers may have been
unmaintained for decades. Possibly, a class library like Qt is more
like tools.h++ than the standard library is.

Unfortunately tools.h++ was before my time (I only heard about it back
in the 1990s) so I'm not familiar with its interface.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .

Alf P. Steinbach

unread,
Feb 13, 2022, 10:31:00 AM2/13/22
to
It looks like they didn't move forward with the deprecation even though
there was agreement about it.

cppreference.com does not show deprecation.

Only source I found: <url: https://github.com/sg16-unicode/sg16/issues/57>

"In Prague, during the SG16 discussion of P1844R1 - Enhancement of
regex, we had consensus to move forward with a proposal to deprecate
std::regex due to performance and ABI concerns." - Tom Honermann


- Alf

daniel...@gmail.com

unread,
Feb 13, 2022, 12:38:47 PM2/13/22
to
It was discussed at the 2020-02 ISO Committee meeting in Prague,

"We declined to forward a paper to enhance std::regex to better support Unicode
due to severe ABI restrictions; the std::regex design exposes many internal details
of the implementation to the ABI and implementers indicated that they cannot
make any significant changes. Given the current state of std::regex is such that
we cannot fix either its interface or its well-known performance issues, a number
of volunteers agreed to bring a paper to deprecate std::regex at a future meeting."

https://www.reddit.com/r/cpp/comments/f47x4o/202002_prague_iso_c_committee_trip_report_c20_is/

Daniel
0 new messages