OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [libstdc++-v3/] [doc/] [xml/] [manual/] [locale.xml] - Blame information for rev 424

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 424 jeremybenn
2
 
3
4
  
5
    
6
      ISO C++
7
    
8
    
9
      locale
10
    
11
  
12
13
 
14
locale
15
 
16
17
Describes the basic locale object, including nested
18
classes id, facet, and the reference-counted implementation object,
19
class _Impl.
20
21
 
22
23
Requirements
24
 
25
26
Class locale is non-templatized and has two distinct types nested
27
inside of it:
28
29
 
30
31
32
33
class facet
34
22.1.1.1.2 Class locale::facet
35
36
37
38
 
39
40
Facets actually implement locale functionality. For instance, a facet
41
called numpunct is the data object that can be used to query for the
42
thousands separator in the locale.
43
44
 
45
46
Literally, a facet is strictly defined:
47
48
 
49
50
  
51
    
52
      Containing the following public data member:
53
    
54
    
55
      static locale::id id;
56
    
57
  
58
 
59
  
60
    
61
      Derived from another facet:
62
    
63
    
64
      class gnu_codecvt: public std::ctype<user-defined-type>
65
    
66
  
67
68
 
69
70
Of interest in this class are the memory management options explicitly
71
specified as an argument to facet's constructor. Each constructor of a
72
facet class takes a std::size_t __refs argument: if __refs == 0, the
73
facet is deleted when the locale containing it is destroyed. If __refs
74
== 1, the facet is not destroyed, even when it is no longer
75
referenced.
76
77
 
78
79
80
81
class id
82
22.1.1.1.3 - Class locale::id
83
84
85
86
 
87
88
Provides an index for looking up specific facets.
89
90
91
 
92
93
Design
94
 
95
96
The major design challenge is fitting an object-orientated and
97
non-global locale design on top of POSIX and other relevant standards,
98
which include the Single Unix (nee X/Open.)
99
100
 
101
102
Because C and earlier versions of POSIX fall down so completely,
103
portability is an issue.
104
105
 
106
107
 
108
109
Implementation
110
 
111
  
112
    Interacting with "C" locales
113
 
114
115
   
116
     
117
       `locale -a` displays available locales.
118
     
119
120
121
af_ZA
122
ar_AE
123
ar_AE.utf8
124
ar_BH
125
ar_BH.utf8
126
ar_DZ
127
ar_DZ.utf8
128
ar_EG
129
ar_EG.utf8
130
ar_IN
131
ar_IQ
132
ar_IQ.utf8
133
ar_JO
134
ar_JO.utf8
135
ar_KW
136
ar_KW.utf8
137
ar_LB
138
ar_LB.utf8
139
ar_LY
140
ar_LY.utf8
141
ar_MA
142
ar_MA.utf8
143
ar_OM
144
ar_OM.utf8
145
ar_QA
146
ar_QA.utf8
147
ar_SA
148
ar_SA.utf8
149
ar_SD
150
ar_SD.utf8
151
ar_SY
152
ar_SY.utf8
153
ar_TN
154
ar_TN.utf8
155
ar_YE
156
ar_YE.utf8
157
be_BY
158
be_BY.utf8
159
bg_BG
160
bg_BG.utf8
161
br_FR
162
bs_BA
163
C
164
ca_ES
165
ca_ES@euro
166
ca_ES.utf8
167
ca_ES.utf8@euro
168
cs_CZ
169
cs_CZ.utf8
170
cy_GB
171
da_DK
172
da_DK.iso885915
173
da_DK.utf8
174
de_AT
175
de_AT@euro
176
de_AT.utf8
177
de_AT.utf8@euro
178
de_BE
179
de_BE@euro
180
de_BE.utf8
181
de_BE.utf8@euro
182
de_CH
183
de_CH.utf8
184
de_DE
185
de_DE@euro
186
de_DE.utf8
187
de_DE.utf8@euro
188
de_LU
189
de_LU@euro
190
de_LU.utf8
191
de_LU.utf8@euro
192
el_GR
193
el_GR.utf8
194
en_AU
195
en_AU.utf8
196
en_BW
197
en_BW.utf8
198
en_CA
199
en_CA.utf8
200
en_DK
201
en_DK.utf8
202
en_GB
203
en_GB.iso885915
204
en_GB.utf8
205
en_HK
206
en_HK.utf8
207
en_IE
208
en_IE@euro
209
en_IE.utf8
210
en_IE.utf8@euro
211
en_IN
212
en_NZ
213
en_NZ.utf8
214
en_PH
215
en_PH.utf8
216
en_SG
217
en_SG.utf8
218
en_US
219
en_US.iso885915
220
en_US.utf8
221
en_ZA
222
en_ZA.utf8
223
en_ZW
224
en_ZW.utf8
225
es_AR
226
es_AR.utf8
227
es_BO
228
es_BO.utf8
229
es_CL
230
es_CL.utf8
231
es_CO
232
es_CO.utf8
233
es_CR
234
es_CR.utf8
235
es_DO
236
es_DO.utf8
237
es_EC
238
es_EC.utf8
239
es_ES
240
es_ES@euro
241
es_ES.utf8
242
es_ES.utf8@euro
243
es_GT
244
es_GT.utf8
245
es_HN
246
es_HN.utf8
247
es_MX
248
es_MX.utf8
249
es_NI
250
es_NI.utf8
251
es_PA
252
es_PA.utf8
253
es_PE
254
es_PE.utf8
255
es_PR
256
es_PR.utf8
257
es_PY
258
es_PY.utf8
259
es_SV
260
es_SV.utf8
261
es_US
262
es_US.utf8
263
es_UY
264
es_UY.utf8
265
es_VE
266
es_VE.utf8
267
et_EE
268
et_EE.utf8
269
eu_ES
270
eu_ES@euro
271
eu_ES.utf8
272
eu_ES.utf8@euro
273
fa_IR
274
fi_FI
275
fi_FI@euro
276
fi_FI.utf8
277
fi_FI.utf8@euro
278
fo_FO
279
fo_FO.utf8
280
fr_BE
281
fr_BE@euro
282
fr_BE.utf8
283
fr_BE.utf8@euro
284
fr_CA
285
fr_CA.utf8
286
fr_CH
287
fr_CH.utf8
288
fr_FR
289
fr_FR@euro
290
fr_FR.utf8
291
fr_FR.utf8@euro
292
fr_LU
293
fr_LU@euro
294
fr_LU.utf8
295
fr_LU.utf8@euro
296
ga_IE
297
ga_IE@euro
298
ga_IE.utf8
299
ga_IE.utf8@euro
300
gl_ES
301
gl_ES@euro
302
gl_ES.utf8
303
gl_ES.utf8@euro
304
gv_GB
305
gv_GB.utf8
306
he_IL
307
he_IL.utf8
308
hi_IN
309
hr_HR
310
hr_HR.utf8
311
hu_HU
312
hu_HU.utf8
313
id_ID
314
id_ID.utf8
315
is_IS
316
is_IS.utf8
317
it_CH
318
it_CH.utf8
319
it_IT
320
it_IT@euro
321
it_IT.utf8
322
it_IT.utf8@euro
323
iw_IL
324
iw_IL.utf8
325
ja_JP.eucjp
326
ja_JP.utf8
327
ka_GE
328
kl_GL
329
kl_GL.utf8
330
ko_KR.euckr
331
ko_KR.utf8
332
kw_GB
333
kw_GB.utf8
334
lt_LT
335
lt_LT.utf8
336
lv_LV
337
lv_LV.utf8
338
mi_NZ
339
mk_MK
340
mk_MK.utf8
341
mr_IN
342
ms_MY
343
ms_MY.utf8
344
mt_MT
345
mt_MT.utf8
346
nl_BE
347
nl_BE@euro
348
nl_BE.utf8
349
nl_BE.utf8@euro
350
nl_NL
351
nl_NL@euro
352
nl_NL.utf8
353
nl_NL.utf8@euro
354
nn_NO
355
nn_NO.utf8
356
no_NO
357
no_NO.utf8
358
oc_FR
359
pl_PL
360
pl_PL.utf8
361
POSIX
362
pt_BR
363
pt_BR.utf8
364
pt_PT
365
pt_PT@euro
366
pt_PT.utf8
367
pt_PT.utf8@euro
368
ro_RO
369
ro_RO.utf8
370
ru_RU
371
ru_RU.koi8r
372
ru_RU.utf8
373
ru_UA
374
ru_UA.utf8
375
se_NO
376
sk_SK
377
sk_SK.utf8
378
sl_SI
379
sl_SI.utf8
380
sq_AL
381
sq_AL.utf8
382
sr_YU
383
sr_YU@cyrillic
384
sr_YU.utf8
385
sr_YU.utf8@cyrillic
386
sv_FI
387
sv_FI@euro
388
sv_FI.utf8
389
sv_FI.utf8@euro
390
sv_SE
391
sv_SE.iso885915
392
sv_SE.utf8
393
ta_IN
394
te_IN
395
tg_TJ
396
th_TH
397
th_TH.utf8
398
tl_PH
399
tr_TR
400
tr_TR.utf8
401
uk_UA
402
uk_UA.utf8
403
ur_PK
404
uz_UZ
405
vi_VN
406
vi_VN.tcvn
407
wa_BE
408
wa_BE@euro
409
yi_US
410
zh_CN
411
zh_CN.gb18030
412
zh_CN.gbk
413
zh_CN.utf8
414
zh_HK
415
zh_HK.utf8
416
zh_TW
417
zh_TW.euctw
418
zh_TW.utf8
419
420
421
422
 
423
   
424
     
425
       `locale` displays environmental variables that
426
       impact how locale("") will be deduced.
427
     
428
429
430
LANG=en_US
431
LC_CTYPE="en_US"
432
LC_NUMERIC="en_US"
433
LC_TIME="en_US"
434
LC_COLLATE="en_US"
435
LC_MONETARY="en_US"
436
LC_MESSAGES="en_US"
437
LC_PAPER="en_US"
438
LC_NAME="en_US"
439
LC_ADDRESS="en_US"
440
LC_TELEPHONE="en_US"
441
LC_MEASUREMENT="en_US"
442
LC_IDENTIFICATION="en_US"
443
LC_ALL=
444
445
446
447
448
 
449
450
From Josuttis, p. 697-698, which says, that "there is only *one*
451
relation (of the C++ locale mechanism) to the C locale mechanism: the
452
global C locale is modified if a named C++ locale object is set as the
453
global locale" (emphasis Paolo), that is:
454
455
 
456
std::locale::global(std::locale(""));
457
 
458
affects the C functions as if the following call was made:
459
 
460
std::setlocale(LC_ALL, "");
461
 
462
463
  On the other hand, there is *no* vice versa, that is, calling
464
  setlocale has *no* whatsoever on the C++ locale mechanism, in
465
  particular on the working of locale(""), which constructs the locale
466
  object from the environment of the running program, that is, in
467
  practice, the set of LC_ALL, LANG, etc. variable of the shell.
468
469
 
470
  
471
472
 
473
474
Future
475
 
476
477
   
478
     
479
       Locale initialization: at what point does _S_classic, _S_global
480
       get initialized? Can named locales assume this initialization
481
       has already taken place?
482
     
483
     
484
 
485
   
486
     
487
       Document how named locales error check when filling data
488
       members. I.e., a fr_FR locale that doesn't have
489
       numpunct::truename(): does it use "true"? Or is it a blank
490
       string? What's the convention?
491
   
492
   
493
 
494
   
495
     
496
       Explain how locale aliasing happens. When does "de_DE" use "de"
497
       information? What is the rule for locales composed of just an
498
       ISO language code (say, "de") and locales with both an ISO
499
       language code and ISO country code (say, "de_DE").
500
     
501
   
502
 
503
   
504
     
505
       What should non-required facet instantiations do?  If the
506
       generic implementation is provided, then how to end-users
507
       provide specializations?
508
   
509
   
510
511
512
 
513
514
Bibliography
515
 
516
  
517
    </code></pre></td>
      </tr>
      <tr valign="middle">
         <td>518</td>
         <td></td>
         <td></td>
         <td class="code"><pre><code>      The GNU C Library</code></pre></td>
      </tr>
      <tr valign="middle">
         <td>519</td>
         <td></td>
         <td></td>
         <td class="code"><pre><code>    
520
    
521
      McGrath
522
      Roland
523
    
524
    
525
      Drepper
526
      Ulrich
527
    
528
    
529
      2007
530
      FSF
531
    
532
    
533
      Chapters 6 Character Set Handling and 7 Locales and
534
      Internationalization
535
    
536
  
537
 
538
  
539
    </code></pre></td>
      </tr>
      <tr valign="middle">
         <td>540</td>
         <td></td>
         <td></td>
         <td class="code"><pre><code>      Correspondence</code></pre></td>
      </tr>
      <tr valign="middle">
         <td>541</td>
         <td></td>
         <td></td>
         <td class="code"><pre><code>    
542
    
543
      Drepper
544
      Ulrich
545
    
546
    
547
      2002
548
      
549
    
550
  
551
 
552
  
553
    </code></pre></td>
      </tr>
      <tr valign="middle">
         <td>554</td>
         <td></td>
         <td></td>
         <td class="code"><pre><code>      ISO/IEC 14882:1998 Programming languages - C++</code></pre></td>
      </tr>
      <tr valign="middle">
         <td>555</td>
         <td></td>
         <td></td>
         <td class="code"><pre><code>    
556
    
557
      1998
558
      ISO
559
    
560
  
561
 
562
  
563
    </code></pre></td>
      </tr>
      <tr valign="middle">
         <td>564</td>
         <td></td>
         <td></td>
         <td class="code"><pre><code>      ISO/IEC 9899:1999 Programming languages - C</code></pre></td>
      </tr>
      <tr valign="middle">
         <td>565</td>
         <td></td>
         <td></td>
         <td class="code"><pre><code>    
566
    
567
      1999
568
      ISO
569
    
570
  
571
 
572
  
573
    
574
      
575
        
576
          System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
577
        
578
      
579
    
580
    
581
      2008
582
      
583
        The Open Group/The Institute of Electrical and Electronics
584
        Engineers, Inc.
585
      
586
    
587
  
588
 
589
  
590
    </code></pre></td>
      </tr>
      <tr valign="middle">
         <td>591</td>
         <td></td>
         <td></td>
         <td class="code"><pre><code>      The C++ Programming Language, Special Edition</code></pre></td>
      </tr>
      <tr valign="middle">
         <td>592</td>
         <td></td>
         <td></td>
         <td class="code"><pre><code>    
593
    
594
      Stroustrup
595
      Bjarne
596
    
597
    
598
      2000
599
      Addison Wesley, Inc.
600
    
601
    Appendix D
602
    
603
      
604
        Addison Wesley
605
      
606
    
607
  
608
 
609
  
610
    </code></pre></td>
      </tr>
      <tr valign="middle">
         <td>611</td>
         <td></td>
         <td></td>
         <td class="code"><pre><code>      Standard C++ IOStreams and Locales</code></pre></td>
      </tr>
      <tr valign="middle">
         <td>612</td>
         <td></td>
         <td></td>
         <td class="code"><pre><code>    
613
    
614
      Advanced Programmer's Guide and Reference
615
    
616
    
617
      Langer
618
      Angelika
619
    
620
    
621
      Kreft
622
      Klaus
623
    
624
    
625
      2000
626
      Addison Wesley Longman, Inc.
627
    
628
    
629
      
630
        Addison Wesley Longman
631
      
632
    
633
  
634
 
635
636
 
637

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.