00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef ACE_CODESET_REGISTRY_H
00025 #define ACE_CODESET_REGISTRY_H
00026
00027 #include "ace/pre.h"
00028 #include "ace/SString.h"
00029 #include "ace/CDR_Base.h"
00030
00031 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00032 # pragma once
00033 #endif
00034
00035 #if defined (ACE_HAS_DCE_CODESET_REGISTRY)
00036 #include <dce/rpc.h>
00037 #endif
00038
00039 class ACE_Export ACE_Codeset_Registry
00040 {
00041 public:
00042
00043
00044
00045 static int locale_to_registry (const ACE_CString &locale,
00046 ACE_CDR::ULong &codeset_id,
00047 ACE_CDR::UShort * = 0,
00048 ACE_CDR::UShort ** = 0);
00049
00050
00051
00052 static int registry_to_locale (ACE_CDR::ULong codeset_id,
00053 ACE_CString &locale,
00054 ACE_CDR::UShort * = 0,
00055 ACE_CDR::UShort ** = 0);
00056
00057
00058
00059 static int is_compatible (ACE_CDR::ULong codeset_id,
00060 ACE_CDR::ULong other);
00061
00062
00063
00064 static ACE_CDR::Short get_max_bytes (ACE_CDR::ULong codeset_id);
00065
00066 enum {max_charsets_ = 5};
00067 protected:
00068 typedef struct {
00069 const char * desc_;
00070 const char * loc_name_;
00071 ACE_CDR::ULong codeset_id_;
00072 ACE_CDR::UShort num_sets_;
00073 ACE_CDR::UShort char_sets_[max_charsets_];
00074 ACE_CDR::UShort max_bytes_;
00075 } registry_entry;
00076
00077 private:
00078 static size_t num_registry_entries_;
00079 static registry_entry registry_db_[];
00080
00081 static int locale_to_registry_i (const ACE_CString &locale,
00082 ACE_CDR::ULong &codeset_id,
00083 ACE_CDR::UShort * = 0,
00084 ACE_CDR::UShort ** = 0);
00085 static int registry_to_locale_i (ACE_CDR::ULong codeset_id,
00086 ACE_CString &locale,
00087 ACE_CDR::UShort * = 0,
00088 ACE_CDR::UShort ** = 0);
00089 static int is_compatible_i (ACE_CDR::ULong codeset_id,
00090 ACE_CDR::ULong other);
00091 static ACE_CDR::Short get_max_bytes_i (ACE_CDR::ULong codeset_id);
00092 };
00093
00094 #if defined (__ACE_INLINE__)
00095 #include "ace/Codeset_Registry.inl"
00096 #endif
00097
00098 #include "ace/post.h"
00099 #endif