ReactOS 0.4.15-dev-7931-gfd331f1
facets_byname.cpp File Reference
#include "stlport_prefix.h"
#include <hash_map>
#include <vector>
#include <locale>
#include <istream>
#include <algorithm>
#include <functional>
#include "c_locale.h"
#include "locale_impl.h"
#include "acquire_release.h"
Include dependency graph for facets_byname.cpp:

Go to the source code of this file.

Classes

struct  _Ctype_byname_w_is_mask
 

Functions

static _STLP_MOVE_TO_PRIV_NAMESPACE void _Init_monetary_formats (money_base::pattern &pos_format, money_base::pattern &neg_format, _Locale_monetary *monetary)
 
static void _Init_monetary_formats_int (money_base::pattern &pos_format, money_base::pattern &neg_format, _Locale_monetary *monetary)
 
wstring __do_widen (string const &str)
 

Function Documentation

◆ __do_widen()

wstring __do_widen ( string const str)
inline

Definition at line 986 of file facets_byname.cpp.

986 {
987#if defined (_STLP_NO_MEMBER_TEMPLATES) || defined (_STLP_MSVC)
988 wstring::_Reserve_t __Reserve;
989 size_t __size = str.size();
990 wstring result(__Reserve, __size);
991 copy(str.begin(), str.end(), result.begin());
992#else
993 wstring result(str.begin(), str.end());
994#endif
995 return result;
996}
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
GLuint64EXT * result
Definition: glext.h:11304
const WCHAR * str

◆ _Init_monetary_formats()

static _STLP_MOVE_TO_PRIV_NAMESPACE void _Init_monetary_formats ( money_base::pattern pos_format,
money_base::pattern neg_format,
_Locale_monetary monetary 
)
static

Definition at line 513 of file facets_byname.cpp.

515 {
516 switch (_Locale_p_sign_posn(monetary)) {
517 case 0: // Parentheses surround the quantity and currency symbol
518 case 1: // The sign string precedes the quantity and currency symbol
519 pos_format.field[0] = (char) money_base::sign;
520 if (_Locale_p_cs_precedes(monetary)) {
521 // 1 if currency symbol precedes a positive value
522 pos_format.field[1] = (char) money_base::symbol;
523 if (_Locale_p_sep_by_space(monetary)) {
524 // a space separates currency symbol from a positive value.
525 pos_format.field[2] = (char) money_base::space;
526 pos_format.field[3] = (char) money_base::value;
527 } else {
528 // a space not separates currency symbol from a positive value.
529 pos_format.field[2] = (char) money_base::value;
530 pos_format.field[3] = (char) money_base::none;
531 }
532 } else {
533 // 0 if currency symbol succeeds a positive value
534 pos_format.field[1] = (char) money_base::value;
535 if (_Locale_p_sep_by_space(monetary)) {
536 // a space separates currency symbol from a positive value.
537 pos_format.field[2] = (char) money_base::space;
538 pos_format.field[3] = (char) money_base::symbol;
539 } else {
540 // a space not separates currency symbol from a positive value.
541 pos_format.field[2] = (char) money_base::symbol;
542 pos_format.field[3] = (char) money_base::none;
543 }
544 }
545 break;
546 case 2: // The sign string succeeds the quantity and currency symbol.
547 if (_Locale_p_cs_precedes(monetary)) {
548 // 1 if currency symbol precedes a positive value
549 pos_format.field[0] = (char) money_base::symbol;
550 if (_Locale_p_sep_by_space(monetary)) {
551 // a space separates currency symbol from a positive value.
552 pos_format.field[1] = (char) money_base::space;
553 pos_format.field[2] = (char) money_base::value;
554 pos_format.field[3] = (char) money_base::sign;
555 } else {
556 // a space not separates currency symbol from a positive value.
557 pos_format.field[1] = (char) money_base::value;
558 pos_format.field[2] = (char) money_base::sign;
559 pos_format.field[3] = (char) money_base::none;
560 }
561 } else {
562 // 0 if currency symbol succeeds a positive value
563 pos_format.field[0] = (char) money_base::value;
564 if (_Locale_p_sep_by_space(monetary)) {
565 // a space separates currency symbol from a positive value.
566 pos_format.field[1] = (char) money_base::space;
567 pos_format.field[2] = (char) money_base::symbol;
568 pos_format.field[3] = (char) money_base::sign;
569 } else {
570 // a space not separates currency symbol from a positive value.
571 pos_format.field[1] = (char) money_base::symbol;
572 pos_format.field[2] = (char) money_base::sign;
573 pos_format.field[3] = (char) money_base::none;
574 }
575 }
576 break;
577 case 3: // The sign string immediately precedes the currency symbol.
578 if (_Locale_p_cs_precedes(monetary)) {
579 // 1 if currency symbol precedes a positive value
580 pos_format.field[0] = (char) money_base::sign;
581 pos_format.field[1] = (char) money_base::symbol;
582 if (_Locale_p_sep_by_space(monetary)) {
583 // a space separates currency symbol from a positive value.
584 pos_format.field[2] = (char) money_base::space;
585 pos_format.field[3] = (char) money_base::value;
586 } else {
587 // a space not separates currency symbol from a positive value.
588 pos_format.field[2] = (char) money_base::value;
589 pos_format.field[3] = (char) money_base::none;
590 }
591 } else {
592 // 0 if currency symbol succeeds a positive value
593 pos_format.field[0] = (char) money_base::value;
594 pos_format.field[1] = (char) money_base::sign;
595 pos_format.field[2] = (char) money_base::symbol;
596 pos_format.field[3] = (char) money_base::none;
597 }
598 break;
599 case 4: // The sign string immediately succeeds the currency symbol.
600 if (_Locale_p_cs_precedes(monetary)) {
601 // 1 if currency symbol precedes a positive value
602 pos_format.field[0] = (char) money_base::symbol;
603 pos_format.field[1] = (char) money_base::sign;
604 pos_format.field[2] = (char) money_base::value;
605 pos_format.field[3] = (char) money_base::none;
606 } else {
607 // 0 if currency symbol succeeds a positive value
608 pos_format.field[0] = (char) money_base::value;
609 if (_Locale_p_sep_by_space(monetary)) {
610 // a space separates currency symbol from a positive value.
611 pos_format.field[1] = (char) money_base::space;
612 pos_format.field[2] = (char) money_base::symbol;
613 pos_format.field[3] = (char) money_base::sign;
614 } else {
615 // a space not separates currency symbol from a positive value.
616 pos_format.field[1] = (char) money_base::symbol;
617 pos_format.field[2] = (char) money_base::sign;
618 pos_format.field[3] = (char) money_base::none;
619 }
620 }
621 break;
622 default: // Default C++ Standard format
623 pos_format.field[0] = (char) money_base::symbol;
624 pos_format.field[1] = (char) money_base::sign;
625 pos_format.field[2] = (char) money_base::none;
626 pos_format.field[3] = (char) money_base::value;
627 break;
628 }
629
630 switch (_Locale_n_sign_posn(monetary)) {
631 case 0: // Parentheses surround the quantity and currency symbol
632 case 1: // The sign string precedes the quantity and currency symbol
633 neg_format.field[0] = (char) money_base::sign;
634 if (_Locale_n_cs_precedes(monetary)) {
635 // 1 if currency symbol precedes a negative value
636 neg_format.field[1] = (char) money_base::symbol;
637 if (_Locale_n_sep_by_space(monetary)) {
638 // a space separates currency symbol from a negative value.
639 neg_format.field[2] = (char) money_base::space;
640 neg_format.field[3] = (char) money_base::value;
641 } else {
642 // a space not separates currency symbol from a negative value.
643 neg_format.field[2] = (char) money_base::value;
644 neg_format.field[3] = (char) money_base::none;
645 }
646 } else {
647 // 0 if currency symbol succeeds a negative value
648 neg_format.field[1] = (char) money_base::value;
649 if (_Locale_n_sep_by_space(monetary)) {
650 // a space separates currency symbol from a negative value.
651 neg_format.field[2] = (char) money_base::space;
652 neg_format.field[3] = (char) money_base::symbol;
653 } else {
654 // a space not separates currency symbol from a negative value.
655 neg_format.field[2] = (char) money_base::symbol;
656 neg_format.field[3] = (char) money_base::none;
657 }
658 }
659 break;
660 case 2: // The sign string succeeds the quantity and currency symbol.
661 if (_Locale_n_cs_precedes(monetary)) {
662 // 1 if currency symbol precedes a negative value
663 neg_format.field[0] = (char) money_base::symbol;
664 if (_Locale_n_sep_by_space(monetary)) {
665 // a space separates currency symbol from a negative value.
666 neg_format.field[1] = (char) money_base::space;
667 neg_format.field[2] = (char) money_base::value;
668 neg_format.field[3] = (char) money_base::sign;
669 } else {
670 // a space not separates currency symbol from a negative value.
671 neg_format.field[1] = (char) money_base::value;
672 neg_format.field[2] = (char) money_base::sign;
673 neg_format.field[3] = (char) money_base::none;
674 }
675 } else {
676 // 0 if currency symbol succeeds a negative value
677 neg_format.field[0] = (char) money_base::value;
678 if (_Locale_n_sep_by_space(monetary)) {
679 // a space separates currency symbol from a negative value.
680 neg_format.field[1] = (char) money_base::space;
681 neg_format.field[2] = (char) money_base::symbol;
682 neg_format.field[3] = (char) money_base::sign;
683 } else {
684 // a space not separates currency symbol from a negative value.
685 neg_format.field[1] = (char) money_base::symbol;
686 neg_format.field[2] = (char) money_base::sign;
687 neg_format.field[3] = (char) money_base::none;
688 }
689 }
690 break;
691 case 3: // The sign string immediately precedes the currency symbol.
692 if (_Locale_n_cs_precedes(monetary)) {
693 // 1 if currency symbol precedes a negative value
694 neg_format.field[0] = (char) money_base::sign;
695 neg_format.field[1] = (char) money_base::symbol;
696 if (_Locale_n_sep_by_space(monetary)) {
697 // a space separates currency symbol from a negative value.
698 neg_format.field[2] = (char) money_base::space;
699 neg_format.field[3] = (char) money_base::value;
700 } else {
701 // a space not separates currency symbol from a negative value.
702 neg_format.field[2] = (char) money_base::value;
703 neg_format.field[3] = (char) money_base::none;
704 }
705 } else {
706 // 0 if currency symbol succeeds a negative value
707 neg_format.field[0] = (char) money_base::value;
708 neg_format.field[1] = (char) money_base::sign;
709 neg_format.field[2] = (char) money_base::symbol;
710 neg_format.field[3] = (char) money_base::none;
711 }
712 break;
713 case 4: // The sign string immediately succeeds the currency symbol.
714 if (_Locale_n_cs_precedes(monetary)) {
715 // 1 if currency symbol precedes a negative value
716 neg_format.field[0] = (char) money_base::symbol;
717 neg_format.field[1] = (char) money_base::sign;
718 neg_format.field[2] = (char) money_base::none;
719 neg_format.field[3] = (char) money_base::value;
720 } else {
721 // 0 if currency symbol succeeds a negative value
722 neg_format.field[0] = (char) money_base::value;
723 if (_Locale_n_sep_by_space(monetary)) {
724 // a space separates currency symbol from a negative value.
725 neg_format.field[1] = (char) money_base::space;
726 neg_format.field[2] = (char) money_base::symbol;
727 neg_format.field[3] = (char) money_base::sign;
728 } else {
729 // a space not separates currency symbol from a negative value.
730 neg_format.field[1] = (char) money_base::symbol;
731 neg_format.field[2] = (char) money_base::sign;
732 neg_format.field[3] = (char) money_base::none;
733 }
734 }
735 break;
736 default: // Default C++ Standard format
737 neg_format.field[0] = (char) money_base::symbol;
738 neg_format.field[1] = (char) money_base::sign;
739 neg_format.field[2] = (char) money_base::none;
740 neg_format.field[3] = (char) money_base::value;
741 break;
742 }
743}
unsigned char
Definition: typeof.h:29
int _Locale_n_sign_posn(struct _Locale_monetary *)
int _Locale_p_sep_by_space(struct _Locale_monetary *)
int _Locale_p_cs_precedes(struct _Locale_monetary *)
int _Locale_n_sep_by_space(struct _Locale_monetary *)
int _Locale_p_sign_posn(struct _Locale_monetary *)
int _Locale_n_cs_precedes(struct _Locale_monetary *)

Referenced by moneypunct_byname< char, false >::moneypunct_byname(), and moneypunct_byname< wchar_t, false >::moneypunct_byname().

◆ _Init_monetary_formats_int()

static void _Init_monetary_formats_int ( money_base::pattern pos_format,
money_base::pattern neg_format,
_Locale_monetary monetary 
)
static

Definition at line 777 of file facets_byname.cpp.

780{
781
782 switch (_Locale_p_sign_posn(monetary)) {
783 case 0: // Parentheses surround the quantity and currency symbol
784 case 1: // The sign string precedes the quantity and currency symbol
785 pos_format.field[0] = (char) money_base::symbol;
786 pos_format.field[1] = (char) money_base::sign;
787 pos_format.field[2] = (char) money_base::value;
788 pos_format.field[3] = (char) money_base::none;
789 break;
790 case 2: // The sign string succeeds the quantity and currency symbol.
791 pos_format.field[0] = (char) money_base::symbol;
792 pos_format.field[1] = (char) money_base::value;
793 pos_format.field[2] = (char) money_base::sign;
794 pos_format.field[3] = (char) money_base::none;
795 break;
796 case 3: // The sign string immediately precedes the currency symbol.
797 case 4: // The sign string immediately succeeds the currency symbol.
798 pos_format.field[0] = (char) money_base::symbol;
799 if (_Locale_p_cs_precedes(monetary)) {
800 // 1 if currency symbol precedes a positive value
801 pos_format.field[1] = (char) money_base::sign;
802 pos_format.field[2] = (char) money_base::value;
803 } else {
804 // 0 if currency symbol succeeds a positive value
805 pos_format.field[1] = (char) money_base::value;
806 pos_format.field[2] = (char) money_base::sign;
807 }
808 pos_format.field[3] = (char) money_base::none;
809 break;
810 default: // Default C++ Standard format
811 pos_format.field[0] = (char) money_base::symbol;
812 pos_format.field[1] = (char) money_base::sign;
813 pos_format.field[2] = (char) money_base::none;
814 pos_format.field[3] = (char) money_base::value;
815 break;
816 }
817
818
819 switch (_Locale_n_sign_posn(monetary)) {
820 case 0: // Parentheses surround the quantity and currency symbol
821 case 1: // The sign string precedes the quantity and currency symbol
822 neg_format.field[0] = (char) money_base::symbol;
823 neg_format.field[1] = (char) money_base::sign;
824 neg_format.field[2] = (char) money_base::value;
825 neg_format.field[3] = (char) money_base::none;
826 break;
827 case 2: // The sign string succeeds the quantity and currency symbol.
828 neg_format.field[0] = (char) money_base::symbol;
829 neg_format.field[1] = (char) money_base::value;
830 neg_format.field[2] = (char) money_base::sign;
831 neg_format.field[3] = (char) money_base::none;
832 break;
833 case 3: // The sign string immediately precedes the currency symbol.
834 case 4: // The sign string immediately succeeds the currency symbol.
835 neg_format.field[0] = (char) money_base::symbol;
836 if (_Locale_n_cs_precedes(monetary)) {
837 // 1 if currency symbol precedes a negative value
838 neg_format.field[1] = (char) money_base::sign;
839 neg_format.field[2] = (char) money_base::value;
840 } else {
841 // 0 if currency symbol succeeds a negative value
842 neg_format.field[1] = (char) money_base::value;
843 neg_format.field[2] = (char) money_base::sign;
844 }
845 neg_format.field[3] = (char) money_base::none;
846 break;
847 default: // Default C++ Standard format
848 neg_format.field[0] = (char) money_base::symbol;
849 neg_format.field[1] = (char) money_base::sign;
850 neg_format.field[2] = (char) money_base::none;
851 neg_format.field[3] = (char) money_base::value;
852 break;
853 }
854}

Referenced by moneypunct_byname< char, true >::moneypunct_byname(), and moneypunct_byname< wchar_t, true >::moneypunct_byname().