Public Member Functions | Private Member Functions | Private Attributes

TAO_UTF16_BOM_Factory Class Reference

#include <UTF16_BOM_Factory.h>

Inheritance diagram for TAO_UTF16_BOM_Factory:
Inheritance graph
[legend]
Collaboration diagram for TAO_UTF16_BOM_Factory:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TAO_UTF16_BOM_Factory ()
virtual ~TAO_UTF16_BOM_Factory ()
virtual int init (int argc, ACE_TCHAR *argv[])
CONV_FRAME::CodeSetId ncs () const
 ncs returns the translator's native codeset ID.
CONV_FRAME::CodeSetId tcs () const
 tcs returns the translator's transmission codeset ID.
virtual void assign (TAO_InputCDR *) const
 Assign the translator to the input CDR. The inherited assign_i is used /// to assign either a char or wchar translator, depending on the base type /// of NCS_TO_TCS. A null input CDR is permitted, in which case assign is a /// no-op.
virtual void assign (TAO_OutputCDR *) const
 Assign the translator to the output CDR. The inherited assign_i is used /// to assign either a char or wchar translator, depending on the base type /// of NCS_TO_TCS. A null output CDR is permitted, in which case assign is a /// no-op.

Private Member Functions

void create_translator () const
int parse_one_arg (int argc, ACE_TCHAR *argv[])

Private Attributes

TAO_UTF16_BOM_Translatortranslator_
bool forceBE_

Detailed Description

Definition at line 29 of file UTF16_BOM_Factory.h.


Constructor & Destructor Documentation

TAO_UTF16_BOM_Factory::TAO_UTF16_BOM_Factory (  ) 
TAO_UTF16_BOM_Factory::~TAO_UTF16_BOM_Factory (  )  [virtual]

Definition at line 42 of file UTF16_BOM_Factory.cpp.

{
  delete this->translator_;
}


Member Function Documentation

void TAO_UTF16_BOM_Factory::assign ( TAO_InputCDR cdr  )  const [virtual]

Assign the translator to the input CDR. The inherited assign_i is used /// to assign either a char or wchar translator, depending on the base type /// of NCS_TO_TCS. A null input CDR is permitted, in which case assign is a /// no-op.

Definition at line 101 of file UTF16_BOM_Factory.cpp.

{
  if (cdr)
    {
      create_translator ();
      this->assign_i (cdr, this->translator_);
    }
}

void TAO_UTF16_BOM_Factory::assign ( TAO_OutputCDR cdr  )  const [virtual]

Assign the translator to the output CDR. The inherited assign_i is used /// to assign either a char or wchar translator, depending on the base type /// of NCS_TO_TCS. A null output CDR is permitted, in which case assign is a /// no-op.

Definition at line 113 of file UTF16_BOM_Factory.cpp.

{
  if (cdr)
    {
      create_translator ();
      this->assign_i (cdr, this->translator_);
    }
}

void TAO_UTF16_BOM_Factory::create_translator (  )  const [private]

Definition at line 123 of file UTF16_BOM_Factory.cpp.

{
  if (this->translator_ == 0)
  {
    TAO_UTF16_BOM_Factory * pthis = const_cast<TAO_UTF16_BOM_Factory *> (this);
    ACE_NEW (pthis->translator_, TAO_UTF16_BOM_Translator (this->forceBE_));
    if (this->translator_ == 0)
    {
      if (TAO_debug_level)
        ACE_ERROR ((LM_ERROR,
                    ACE_TEXT ("TAO (%P|%t) - UTF16_BOM_Factory: ")
                    ACE_TEXT ("Cannot create translator\n")
        ));
    }
  }
}

int TAO_UTF16_BOM_Factory::init ( int  argc,
ACE_TCHAR argv[] 
) [virtual]

Reimplemented from TAO_Codeset_Translator_Factory.

Definition at line 48 of file UTF16_BOM_Factory.cpp.

{
  TAO_Codeset_Translator_Factory::init (argc, argv);

  for (int narg = 0; narg < argc;)
  {
    int consumed = parse_one_arg (argc - narg, &argv[narg]);
    if (consumed > 0)
    {
      narg += consumed;
    }
    else
    {
      ACE_ERROR ((LM_ERROR,
        ACE_TEXT ("(%P|%t)TAO_UTF16_BOM_Factory parameter error: %s\n")
        ACE_TEXT ("Usage: TAO_UTF16_BOM_Factory \"-forceBE\"\n")
        , argv[narg]
        ));
      return -1;
    }
  }
  return 0;
}

CONV_FRAME::CodeSetId TAO_UTF16_BOM_Factory::ncs ( void   )  const

ncs returns the translator's native codeset ID.

Definition at line 85 of file UTF16_BOM_Factory.cpp.

{
  create_translator();
  return this->translator_->ncs();
}

int TAO_UTF16_BOM_Factory::parse_one_arg ( int  argc,
ACE_TCHAR argv[] 
) [private]

Definition at line 73 of file UTF16_BOM_Factory.cpp.

{
  int consumed = 0;
  if ((argc > 0) && (ACE_OS::strcasecmp (argv[0], ACE_TEXT("-forcebe")) == 0))
  {
    this->forceBE_ = true;
    consumed = 1;
  }
  return consumed;
}

CONV_FRAME::CodeSetId TAO_UTF16_BOM_Factory::tcs (  )  const

tcs returns the translator's transmission codeset ID.

Definition at line 92 of file UTF16_BOM_Factory.cpp.

{
  create_translator();
  return this->translator_->tcs();
}


Member Data Documentation

Definition at line 59 of file UTF16_BOM_Factory.h.

Definition at line 58 of file UTF16_BOM_Factory.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines