00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 ACE_INLINE
00018 int
00019 ACE_Codeset_Registry::locale_to_registry(const ACE_CString &locale,
00020 ACE_CDR::ULong &codeset_id,
00021 ACE_CDR::UShort *num_sets,
00022 ACE_CDR::UShort **char_sets)
00023 {
00024 #if defined (ACE_HAS_DCE_CODESET_REGISTRY)
00025 error_status_t result;
00026 dce_cs_loc_to_rgy (locale.c_str(),
00027 &codeset_id,
00028 num_sets,
00029 char_sets,
00030 &result);
00031 return (result == dce_cs_c_ok) ? 1 : 0;
00032 #else
00033 return ACE_Codeset_Registry::locale_to_registry_i (locale,
00034 codeset_id,
00035 num_sets,
00036 char_sets);
00037 #endif
00038 }
00039
00040
00041
00042 ACE_INLINE
00043 int
00044 ACE_Codeset_Registry::registry_to_locale(ACE_CDR::ULong codeset_id,
00045 ACE_CString &locale,
00046 ACE_CDR::UShort *num_sets,
00047 ACE_CDR::UShort **char_sets)
00048 {
00049 #if defined (ACE_HAS_DCE_CODESET_REGISTRY)
00050 error_status_t result;
00051 char *buffer;
00052 dce_cs_rgy_to_loc (codeset_id,
00053 &buffer,
00054 num_sets,
00055 char_sets,
00056 &result);
00057 locale.set(buffer);
00058 free (buffer);
00059 return (result == dce_cs_c_ok) ? 1 : 0;
00060 #else
00061 return ACE_Codeset_Registry::registry_to_locale_i (codeset_id,
00062 locale,
00063 num_sets,
00064 char_sets);
00065 #endif
00066 }
00067
00068
00069
00070 ACE_INLINE
00071 int
00072 ACE_Codeset_Registry::is_compatible (ACE_CDR::ULong codeset_id,
00073 ACE_CDR::ULong other)
00074 {
00075 #if defined (ACE_HAS_DCE_CODESET_REGISTRY)
00076 error_status_t result;
00077 rpc_cs_char_set_compat_check(codeset_id,other,&result);
00078 return (result == rpc_s_ok) ? 1 : 0;
00079 #else
00080 return ACE_Codeset_Registry::is_compatible_i (codeset_id,other);
00081 #endif
00082 }
00083
00084
00085
00086 ACE_INLINE
00087 ACE_CDR::Short
00088 ACE_Codeset_Registry::get_max_bytes (ACE_CDR::ULong codeset_id)
00089 {
00090 #if defined (ACE_HAS_DCE_CODESET_REGISTRY)
00091 error_status_t result;
00092 short max_bytes;
00093 rpc_rgy_get_max_bytes(codeset_id,&max_bytes,&result);
00094 return (result == rpc_s_ok) ? (short)max_bytes : 0;
00095 #else
00096 return ACE_Codeset_Registry::get_max_bytes_i (codeset_id);
00097 #endif
00098 }