You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Farid Zaripov <Fa...@epam.com> on 2007/08/03 19:19:56 UTC

[PATCH] rw_create_catalog()

  Attached is a patch, moving generate_catalog() function from 
22.locale.messages.cpp into rwtest library.

  ChangeLog:
  * rw_locale.h (rw_create_catalog): New function to create message catalog.
  * locale.cpp: Ditto.
  * 22.locale.messages.cpp: Removed generate_catalog(), used 
rw_create_catalog().

Farid.


Re: [PATCH] rw_create_catalog()

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:sebor@roguewave.com] 
>> Sent: Monday, August 06, 2007 5:37 PM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: Re: [PATCH] rw_create_catalog()
>>
>> Since we're moving the function into the driver I think it 
>> might be useful to generalize it so as not to assume a fixed 
>> number of sets or even messages in each set.
>>
>> Here's an idea. How about changing the signature to:
>>
>>      _TEST_EXPORT int
>>      rw_gencat (const char *catname, const char* catalog);
>>
>> with catalog being a newline separated list of strings, each 
>> of which representing a single message, and with a blank line 
>> separating one set from another.
[...]
>> What do you think about it, Farid?
> 
>   Yes, it's reasonable thing. But prevents to have '\n' characters in
> message text.
> Maybe will be better to use \0 instead of \n?

Good point! I agree, '\0' is better.

Martin

RE: [PATCH] rw_create_catalog()

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Monday, August 06, 2007 5:37 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: [PATCH] rw_create_catalog()
> 
> Since we're moving the function into the driver I think it 
> might be useful to generalize it so as not to assume a fixed 
> number of sets or even messages in each set.
> 
> Here's an idea. How about changing the signature to:
> 
>      _TEST_EXPORT int
>      rw_gencat (const char *catname, const char* catalog);
> 
> with catalog being a newline separated list of strings, each 
> of which representing a single message, and with a blank line 
> separating one set from another.
> 
>      static const char* const
>      messages = {
>          "First set, first message\n"
>          "First set, second message\n"
>          // ...
>          "First set, fifth message\n"
>          "\n"
>          "Second set, first message\n"
>          // ...
>          "Second set, fifth message\n"
>          "\n"
>          //...
> };
> 
> I realize the messages test would need to change but the 
> changes shouldn't be too difficult.
> 
> What do you think about it, Farid?

  Yes, it's reasonable thing. But prevents to have '\n' characters in
message text.
Maybe will be better to use \0 instead of \n?

Farid.

Re: [PATCH] rw_create_catalog()

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>  Attached is a patch, moving generate_catalog() function from 
> 22.locale.messages.cpp into rwtest library.

Since we're moving the function into the driver I think it might
be useful to generalize it so as not to assume a fixed number of
sets or even messages in each set.

Here's an idea. How about changing the signature to:

     _TEST_EXPORT int
     rw_gencat (const char *catname, const char* catalog);

with catalog being a newline separated list of strings, each
of which representing a single message, and with a blank line
separating one set from another.

     static const char* const
     messages = {
         "First set, first message\n"
         "First set, second message\n"
         // ...
         "First set, fifth message\n"
         "\n"
         "Second set, first message\n"
         // ...
         "Second set, fifth message\n"
         "\n"
         //...
};

I realize the messages test would need to change but the changes
shouldn't be too difficult.

What do you think about it, Farid?

Martin

> 
>  ChangeLog:
>  * rw_locale.h (rw_create_catalog): New function to create message catalog.
>  * locale.cpp: Ditto.
>  * 22.locale.messages.cpp: Removed generate_catalog(), used 
> rw_create_catalog().
> 
> Farid.
>