summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.cpp
diff options
context:
space:
mode:
authorjohn_c <john_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-05-08 23:00:05 +0000
committerjohn_c <john_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-05-08 23:00:05 +0000
commitd1160e68b1301a8b0e120ba8da56bb2e7d4fb49e (patch)
treecf04398acb7ad9fb45311eb105d60975028bbc03 /TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.cpp
parent1c3dd540264435be21072a3a69a8a8e969bd2b1a (diff)
downloadATCD-d1160e68b1301a8b0e120ba8da56bb2e7d4fb49e.tar.gz
Fri May 5 14:33:29 UTC 2006 Ciju John <john_c@ociweb.com>oci_wchar_refactor_post_1_5_1_branch
Diffstat (limited to 'TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.cpp')
-rw-r--r--TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.cpp b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.cpp
index fd898bddc31..287201307d5 100644
--- a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.cpp
+++ b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.cpp
@@ -6,6 +6,7 @@
#include "orbsvcs/Notify/Service.h"
#include "ace/OS_NS_stdio.h"
#include "ace/OS_NS_unistd.h"
+#include "ace/Argv_Type_Converter.h"
ACE_RCSID (Notify_Logging_Service,
Notify_Logging_Service,
@@ -14,8 +15,6 @@ ACE_RCSID (Notify_Logging_Service,
Notify_Logging_Service::Notify_Logging_Service (void)
: service_name_ (NOTIFY_KEY),
- ior_file_name_ (0),
- pid_file_name_ (0),
bind_to_naming_service_ (1),
nthreads_ (0)
{
@@ -28,7 +27,7 @@ Notify_Logging_Service::~Notify_Logging_Service (void)
}
int
-Notify_Logging_Service::init_ORB (int& argc, char *argv []
+Notify_Logging_Service::init_ORB (int& argc, char *argv[]
ACE_ENV_ARG_DECL)
{
this->orb_ = CORBA::ORB_init (argc,
@@ -71,9 +70,9 @@ Notify_Logging_Service::init_ORB (int& argc, char *argv []
}
int
-Notify_Logging_Service::parse_args (int argc, char *argv[])
+Notify_Logging_Service::parse_args (int argc, ACE_TCHAR *argv[])
{
- ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("n:o:p:t::x"));
+ ACE_Get_Arg_Opt<ACE_TCHAR> get_opt (argc, argv, ACE_TEXT("n:o:p:t::x"));
int opt;
while ((opt = get_opt ()) != EOF)
@@ -81,15 +80,15 @@ Notify_Logging_Service::parse_args (int argc, char *argv[])
switch (opt)
{
case 'n':
- service_name_ = get_opt.opt_arg();
+ service_name_.set (ACE_TEXT_TO_CHAR_IN (get_opt.opt_arg()));
break;
case 'o':
- ior_file_name_ = get_opt.opt_arg();
+ ior_file_name_.set (ACE_TEXT_TO_CHAR_IN (get_opt.opt_arg()));
break;
case 'p':
- pid_file_name_ = get_opt.opt_arg();
+ pid_file_name_.set (ACE_TEXT_TO_CHAR_IN (get_opt.opt_arg()));
break;
case 't':
@@ -118,15 +117,17 @@ Notify_Logging_Service::parse_args (int argc, char *argv[])
}
int
-Notify_Logging_Service::init (int argc, char *argv[]
+Notify_Logging_Service::init (int argc, ACE_TCHAR *argv[]
ACE_ENV_ARG_DECL)
{
+ ACE_Argv_Type_Converter convert (argc, argv);
+
// initalize the ORB.
- if (this->init_ORB (argc, argv
+ if (this->init_ORB (convert.get_argc(), convert.get_ASCII_argv()
ACE_ENV_ARG_PARAMETER) != 0)
return -1;
- if (this->parse_args (argc, argv) == -1)
+ if (this->parse_args (convert.get_argc(), convert.get_TCHAR_argv()) == -1)
return -1;
this->notify_service_->init_service (this->orb_.in () ACE_ENV_ARG_PARAMETER);
@@ -167,14 +168,14 @@ Notify_Logging_Service::init (int argc, char *argv[]
ACE_CHECK_RETURN (-1);
}
- if (ior_file_name_ != 0)
+ if (ior_file_name_.length() != 0)
{
- FILE* iorf = ACE_OS::fopen (ior_file_name_, ACE_TEXT("w"));
+ FILE* iorf = ACE_OS::fopen (ior_file_name_.fast_rep(), ACE_TEXT("w"));
if (iorf == 0)
{
ACE_ERROR_RETURN ((LM_ERROR,
"Cannot open output file for writing IOR: %s",
- ior_file_name_),
+ ior_file_name_.c_str()),
-1);
}
@@ -182,9 +183,9 @@ Notify_Logging_Service::init (int argc, char *argv[]
ACE_OS::fclose (iorf);
}
- if (pid_file_name_ != 0)
+ if (pid_file_name_.length() != 0)
{
- FILE* pidf = ACE_OS::fopen (pid_file_name_, ACE_TEXT("w"));
+ FILE* pidf = ACE_OS::fopen (pid_file_name_.fast_rep(), ACE_TEXT("w"));
if (pidf != 0)
{
ACE_OS::fprintf (pidf,
@@ -205,7 +206,7 @@ Notify_Logging_Service::init (int argc, char *argv[]
CosNaming::Name name (1);
name.length (1);
- name[0].id = CORBA::string_dup (this->service_name_);
+ name[0].id = CORBA::string_dup (this->service_name_.fast_rep());
ACE_CHECK_RETURN (-1);
this->naming_->rebind (name,
@@ -292,7 +293,7 @@ Notify_Logging_Service::shutdown (ACE_ENV_SINGLE_ARG_DECL)
{
CosNaming::Name name (1);
name.length (1);
- name[0].id = CORBA::string_dup (this->service_name_);
+ name[0].id = CORBA::string_dup (this->service_name_.fast_rep());
ACE_CHECK;
this->naming_->unbind (name