00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file UTF16_BOM_Factory.h 00006 * 00007 * $Id: UTF16_BOM_Factory.h 84281 2009-01-30 15:01:17Z wotte $ 00008 * 00009 * Loader for an instance of the UTF16_BOM_Translator. 00010 * 00011 * 00012 * @author Phil Mesnier <mesnier_p@ociweb.com> 00013 */ 00014 //============================================================================= 00015 00016 00017 #ifndef UTF16_BOM_FACTORY_H 00018 #define UTF16_BOM_FACTORY_H 00019 00020 #include /**/ "ace/pre.h" 00021 #include "ace/Service_Config.h" 00022 #include "tao/Codeset/Codeset_Translator_Factory.h" 00023 00024 #include "tao/Codeset/UTF16_BOM_Translator.h" 00025 #include "tao/Codeset/codeset_export.h" 00026 00027 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00028 00029 class TAO_Codeset_Export TAO_UTF16_BOM_Factory 00030 : public TAO_Codeset_Translator_Factory 00031 { 00032 public: 00033 TAO_UTF16_BOM_Factory (); 00034 virtual ~TAO_UTF16_BOM_Factory (); 00035 virtual int init (int argc, ACE_TCHAR *argv[]); 00036 00037 /// ncs returns the translator's native codeset ID. 00038 CONV_FRAME::CodeSetId ncs () const; 00039 /// tcs returns the translator's transmission codeset ID. 00040 CONV_FRAME::CodeSetId tcs () const; 00041 00042 /// Assign the translator to the input CDR. The inherited assign_i is used 00043 /// to assign either a char or wchar translator, depending on the base type 00044 /// of NCS_TO_TCS. A null input CDR is permitted, in which case assign is a 00045 /// no-op. 00046 virtual void assign (TAO_InputCDR *) const; 00047 /// Assign the translator to the output CDR. The inherited assign_i is used 00048 /// to assign either a char or wchar translator, depending on the base type 00049 /// of NCS_TO_TCS. A null output CDR is permitted, in which case assign is a 00050 /// no-op. 00051 virtual void assign (TAO_OutputCDR *) const; 00052 00053 private: 00054 void create_translator () const; 00055 int parse_one_arg (int argc, ACE_TCHAR *argv[]); 00056 00057 private: 00058 TAO_UTF16_BOM_Translator *translator_; 00059 bool forceBE_; // force big endian wchar, warray, & wstring 00060 }; 00061 00062 ACE_STATIC_SVC_DECLARE_EXPORT (TAO_Codeset, TAO_UTF16_BOM_Factory) 00063 ACE_FACTORY_DECLARE (TAO_Codeset, TAO_UTF16_BOM_Factory) 00064 TAO_END_VERSIONED_NAMESPACE_DECL 00065 00066 00067 #include /**/ "ace/post.h" 00068 #endif /* UTF16_BOM_FACTORY_H */