Issue Details (XML | Word | Printable)

Key: STDCXX-459
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Farid Zaripov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

time_get::date_order() should return actually date order taken from locale

Created: 25/Jun/07 03:16 PM   Updated: 14/May/08 04:47 PM
Return to search
Component/s: 22. Localization
Affects Version/s: 4.1.2, 4.1.3, 4.1.4
Fix Version/s: 4.3.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works stdcxx-459.patch 2007-11-29 07:30 PM Farid Zaripov 5 kB
Environment: All
Issue Links:
Dependants
 
Duplicate
 

Patch Info: Patch Available


 Description  « Hide
The current implementation of the time_get::date_order() always returns no_order. It should return date order used by a locale facet (http://www.mail-archive.com/stdcxx-dev@incubator.apache.org/msg03734.html).

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Farid Zaripov added a comment - 29/Nov/07 03:55 PM
The proposed patch attached.

Farid Zaripov added a comment - 29/Nov/07 03:58 PM
Another option might be extend the struct _rw_time_t with d_order_off field and determine the dateorder value (or two values for narrow and wide characters) in __rw::_rw_get_timepunct().

Farid Zaripov added a comment - 29/Nov/07 07:30 PM
The updated patch is attached.

Farid Zaripov added a comment - 29/Nov/07 07:39 PM
ChangeLog:

STDCXX-459

  • include/loc/time_get.h (_rw_get_timepunct): Removed unnecessary declaration of the function.
    (do_date_order): Function outlined and moved from here...
  • include/loc/_time_get.cc (do_date_order):... to here. Used __rw_get_dateorder() to obtain the dateorder value.
    (__rw_get_dateorder): Added declaration of the new function.
    (__rw_get_timepunct): Removed unnecessary _RWSTD_EXPORT attribute.
  • src/time_get.cpp (__rw_get_dateorder): Added new function to obtain the dateorder value.
  • src/time_put.cpp (__rw_get_timepunct): Removed unnecessary _RWSTD_EXPORT attribute.

Martin Sebor added a comment - 14/Dec/07 04:17 PM
The patch looks good to me in general but I have a few compatibility concerns with it:

1. It removes RWSTD_EXPORT from __rw::_rw_get_timepunct(). Is this forward binary compatible on Windows?

2. It adds a new function, _rw::_rw_get_dateorder(). Is this forward binary compatible?

3. It outlines the virtual member function time_get::do_date_order(). Is this binary compatible?


Farid Zaripov added a comment - 18/Dec/07 07:45 PM
1. This change is not necessary (and even more, it's incorrect, because __rw_get_timepunct() should be exported if the user instantiates the std::time_get<user_char, user_iterator>).

2. The __rw_get_dateorder() should also be _RWSTD_EXPORT to be accessible from std::time_get<user_char, user_iterator>. And this change is not a forward binary compatible.

3. I think yes. The outlining doesn't add's the new symbol in the library. The only what may change - it's a return value from the date_order(). But since the all possible returning values are valid (the user of the library shouldn't rely on the always returned no_order from date_order()) this change is safe.


Farid Zaripov added a comment - 18/Dec/07 07:48 PM
Scheduled for 4.3.