Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

150 lines
5.1 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /**********************************************************************/
  5. /*
  6. INTLPROF.HXX
  7. Header file for the international profile class
  8. FILE HISTORY:
  9. terryk 29-Aug-91 Created
  10. terryk 13-Sep-91 Code review changes. Attend: beng
  11. davidbul o-simop
  12. terryk 07-Oct-91 Add QueryDurationStr function
  13. terryk 14-Oct-91 Add cSec field to QueryDurationStr
  14. */
  15. #ifndef _INTLPROF_HXX_
  16. #define _INTLPROF_HXX_
  17. /*************************************************************************
  18. NAME: INTL_PROFILE
  19. SYNOPSIS: Get the WIN.INI's international section information
  20. INTERFACE:
  21. INTL_PROFILE() - constructor. It will also get the latest info.
  22. Refresh() - get the latest info in win.ini.
  23. QueryTimeSeparator() - get the time separator
  24. QueryAMStr() - get the AM string
  25. QueryPMStr() - get the PM string
  26. Is24Hour() - Is it 24 hours format?
  27. IsHourLZero() - Does the hour field have a leading zero?
  28. QueryTimeString() - get the time string in current win.ini format
  29. QueryDateSeparator() - get the date separator
  30. IsYrCentury() - Is year field 4 digits or 2 digits?
  31. IsMonthLZero() - Does month have a leading zero?
  32. IsDayLZero() - Does Day have a leading zero?
  33. QueryYearPos() - get the year position in XX/XX/XX format.
  34. ( return 1-3 which indicates the position )
  35. QueryMonthPos() - get the month position in XX/XX/XX format
  36. ( return 1-3 which indicates the position )
  37. QueryDayPos() - get the day position in XX/XX/XX format
  38. ( return 1-3 which indicates the position )
  39. QueryLongDateString() - get the specified day in long format
  40. QueryShortDateString() - get the specified day in short format
  41. QueryDurationStr() - return the following string
  42. X day if X is less than 2
  43. X days if X is bigger than 2
  44. where X is the input parameter
  45. USES: NLS_STR
  46. CAVEATS:
  47. The user need to include <ctime.hxx> as well.
  48. NOTES:
  49. HISTORY:
  50. terryk 29-Aug-91 Created
  51. beng 07-Mar-1992 Unicode fixes; rewrites
  52. **************************************************************************/
  53. DLL_CLASS INTL_PROFILE : public BASE
  54. {
  55. private:
  56. NLS_STR _nlsLongDate;
  57. NLS_STR _nlsShortDate;
  58. NLS_STR _nlsTimeSep;
  59. NLS_STR _nlsDateSep;
  60. NLS_STR _nlsAMStr;
  61. NLS_STR _nlsPMStr;
  62. BOOL _f24Hour;
  63. BOOL _fTimePrefix; // used only for DBCS
  64. BOOL _fHourLZero;
  65. BOOL _fYrCentury;
  66. BOOL _fMonthLZero;
  67. BOOL _fDayLZero;
  68. INT _nYearPos;
  69. INT _nMonthPos;
  70. INT _nDayPos;
  71. NLS_STR _nlsWDay[7];
  72. NLS_STR _nlsShortWDay[7];
  73. NLS_STR _nlsMonth[12];
  74. NLS_STR _nlsShortMonth[12];
  75. APIERR ScanLongDate( NLS_STR * pnlsResults ) const;
  76. public:
  77. INTL_PROFILE();
  78. APIERR Refresh(); // get the international section information
  79. // TIME routines
  80. APIERR QueryTimeSeparator( NLS_STR *nlsSep ) const;
  81. APIERR QueryAMStr( NLS_STR *nlsAM ) const;
  82. APIERR QueryPMStr( NLS_STR *nlsPM ) const;
  83. BOOL Is24Hour() const
  84. { return _f24Hour; }
  85. BOOL IsTimePrefix() const
  86. { return _fTimePrefix; }
  87. BOOL IsHourLZero() const
  88. { return _fHourLZero; }
  89. // format the time object to the format specified in win.ini
  90. APIERR QueryTimeString( const WIN_TIME & winTime, NLS_STR *nlsTime ) const;
  91. // DATE routines
  92. APIERR QueryDateSeparator( NLS_STR *nlsSep ) const;
  93. // TRUE if Year field is display as Century Year or just 2 digits year
  94. BOOL IsYrCentury() const
  95. { return _fYrCentury; }
  96. // TRUE if month field need a leading zero
  97. BOOL IsMonthLZero() const
  98. { return _fMonthLZero; }
  99. // TRUE if day field need a leading zero
  100. BOOL IsDayLZero() const
  101. { return _fDayLZero; }
  102. // Query Year Position, return a number between 1 - 3
  103. INT QueryYearPos() const
  104. { return _nYearPos; }
  105. // Query Month Position, return a number between 1 - 3
  106. INT QueryMonthPos() const
  107. { return _nMonthPos; }
  108. // Query Day Position, return a number between 1 - 3
  109. INT QueryDayPos() const
  110. { return _nDayPos; }
  111. // format the time object to the format specified in win.ini
  112. APIERR QueryLongDateString( const WIN_TIME & winTime,
  113. NLS_STR *nlsDate ) const;
  114. APIERR QueryShortDateString( const WIN_TIME & winTime,
  115. NLS_STR *nlsDate ) const;
  116. APIERR QueryDurationStr( INT cDay, INT cHour, INT nMin, INT cSec,
  117. NLS_STR *pnlsStr ) const;
  118. };
  119. #endif // _INTLPROF_HXX_