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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libstdc++-v3/] [doc/] [xml/] [manual/] [locale.xml] - Blame information for rev 745

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

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

powered by: WebSVN 2.1.0

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