stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Pevtsov" <Ant...@moscow.vdiweb.com>
Subject RE: RE: svn commit: r387687 - in /incubator/stdcxx/trunk/tests: include/rw_char.h self/0.char.cpp src/char.cpp
Date Wed, 22 Mar 2006 16:38:26 GMT
Oops, I've mixed eos and eof in my question. The correct version here:

1. Current UserChar version uses pair 0, 0 as eos(). At the same time
rw_widen sets .f = 0 and .c = <given char>. This results in the possible
output problems with strings containing the '\0' symbol. It may be
interpreted as UserChars::eos and the length in rw_match may be
calculated incorrectly. 
Maybe, we'll use the pair -1, 0 for eos, or change rw_widen to
initialize .f with any non-zero value? 

Thanks,
Anton Pevtsov

-----Original Message-----
From: Anton Pevtsov [mailto:AntonP@moscow.vdiweb.com] 
Sent: Wednesday, March 22, 2006 18:13
To: stdcxx-dev@incubator.apache.org
Subject: RE: svn commit: r387687 - in /incubator/stdcxx/trunk/tests:
include/rw_char.h self/0.char.cpp src/char.cpp


Martin, I've tried to use new directive in the copy test, but faced with
problems:

1. Current UserChar version uses pair 0, 0 as eof(). At the same time
rw_widen sets f = 0 and c = <given char>. This results in the output
problems with strings containig the '\0' symbol. It is interpreted as
UserChars::eof and the length in rw_match is calculated incorrectly.
Maybe, we'll use the pair -1, 0 for eof, or change rw_widen to
initialize .f with any non-zero value? 2. Suppose we want to display a
string without eof symbol at the end. 
I think it is necessary to provide the string length in this case (it is
impossible to calculate it because we know nothing about the symbol past
the end of the given array). 
What directive can be used for this purpose? I tried '.' and '#' with
%{/Gs} but with no luck. 
It would be nice to have ability to specify element size, number of
"characters" in the array and the array as three parameters used with
one formatting directive.

Thanks,
Anton Pevtsov


-----Original Message-----
From: Martin Sebor [mailto:sebor@roguewave.com] 
Sent: Wednesday, March 22, 2006 05:20
To: stdcxx-dev@incubator.apache.org
Subject: Re: svn commit: r387687 - in /incubator/stdcxx/trunk/tests:
include/rw_char.h self/0.char.cpp src/char.cpp


Anton, this change adds support for the %{/Gs} directive for Generic
strings. Check out the test for usage. Let me know how it works out for
you or if you have any suggestions for changes or enhancements.

Martin

sebor@apache.org wrote:
> Author: sebor
> Date: Tue Mar 21 17:58:27 2006
> New Revision: 387687
> 
> URL: http://svn.apache.org/viewcvs?rev=387687&view=rev
> Log:
> 2006-03-21  Martin Sebor  <sebor@roguewave.com>
> 
> 	* rw_char.h (UserCharFmatInit, _rw_user_char_fmat_init):
Initializer
> 	type and object to install a "user-defined" formatting callback
for
> 	arrays of generic characters including UserChar.
> 	* src/char.cpp (_rw_fmtstring, _rw_fmtstringv): "User-defined"
> 	formatting callback for arrays of generic characters including
> 	UserChar.
> 	* test/0.char.cpp (test_formatting): Exercised the above.
> 
> Modified:
>     incubator/stdcxx/trunk/tests/include/rw_char.h
>     incubator/stdcxx/trunk/tests/self/0.char.cpp
>     incubator/stdcxx/trunk/tests/src/char.cpp

Mime
View raw message