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