Commit cd99adbe authored by Vitaly Lipatov's avatar Vitaly Lipatov

restore comments and strings (was broken since initial commit in git)

parent 8fa15ce5
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
/*! \file /*! \file
* \brief ????? ?????? ? ????????????? * \brief
* \author Vitaly Lipatov, Pavel Vainerman * \author Vitaly Lipatov, Pavel Vainerman
* \date $Date: 2008/09/16 19:02:46 $ * \date $Date: 2008/09/16 19:02:46 $
* \version $Id: Configuration.cc,v 1.41 2008/09/16 19:02:46 vpashka Exp $ * \version $Id: Configuration.cc,v 1.41 2008/09/16 19:02:46 vpashka Exp $
...@@ -51,8 +51,8 @@ static const string UniSetDefaultPort = "2809"; ...@@ -51,8 +51,8 @@ static const string UniSetDefaultPort = "2809";
static ostream& print_help( ostream& os, int width, const string cmd, static ostream& print_help( ostream& os, int width, const string cmd,
const string help, const string tab="" ) const string help, const string tab="" )
{ {
// ????? ?? ??????? ????????? ????????? ?????? //
// ??????? ???? stream... // stream...
ostringstream info; ostringstream info;
info.setf(ios::left, ios::adjustfield); info.setf(ios::left, ios::adjustfield);
info << tab << setw(width) << cmd << " - " << help; info << tab << setw(width) << cmd << " - " << help;
...@@ -62,18 +62,18 @@ static ostream& print_help( ostream& os, int width, const string cmd, ...@@ -62,18 +62,18 @@ static ostream& print_help( ostream& os, int width, const string cmd,
ostream& UniSetTypes::Configuration::help(ostream& os) ostream& UniSetTypes::Configuration::help(ostream& os)
{ {
os << "\n UniSet Configure command: " << endl; os << "\n UniSet Configure command: " << endl;
print_help(os,20,"--confile","?????? ???? ?? ????? ????????????\n"); print_help(os,20,"--confile"," \n");
os << "\n Debug command:\n"; os << "\n Debug command:\n";
print_help(os,25," [debname]","??? DebugStream ????????? ? ???????????????? ?????\n"); print_help(os,25," [debname]"," DebugStream \n");
print_help(os,25,"--[debname]-no-debug","?????????? ?????\n"); print_help(os,25,"--[debname]-no-debug"," \n");
print_help(os,25,"--[debname]-log-in-file","??????????????? ???? ? ????\n"); print_help(os,25,"--[debname]-log-in-file"," \n");
print_help(os,25,"--[debname]-add-levels","???????? ??????? ?????? ?????\n"); print_help(os,25,"--[debname]-add-levels"," \n");
print_help(os,25,"--[debname]-del-levels","??????? ??????? ?????? ?????\n"); print_help(os,25,"--[debname]-del-levels"," \n");
print_help(os,25,"--uniport num","???????????? ???????? ???? (??????????????? 'defaultport' ???????? ? ????. ????? ? ??????? <nodes>)\n"); print_help(os,25,"--uniport num"," ( 'defaultport' . <nodes>)\n");
print_help(os,25,"--localIOR {1,0}","???????????? ????????? ????? ??? ????????? IOR (?.?. ?? ???????????? omniNames). ?????????????? ???????? ? ???????????????? ?????.\n"); print_help(os,25,"--localIOR {1,0}"," IOR (.. omniNames). .\n");
print_help(os,25,"--transientIOR {1,0}","???????????? ???????????? IOR(?? ??????????). ?????????????? ???????? ? ???????????????? ?????. Default=1\n"); print_help(os,25,"--transientIOR {1,0}"," IOR( ). . Default=1\n");
return os << "\n?????? ?????????????:\t myUniSetProgram " return os << "\n :\t myUniSetProgram "
<< "--unideb-add-levels level1,info,system,warn --unideb-log-in-file myprogrpam.log\n\n"; << "--unideb-add-levels level1,info,system,warn --unideb-log-in-file myprogrpam.log\n\n";
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
...@@ -254,7 +254,7 @@ void Configuration::initConfiguration( int argc, char** argv ) ...@@ -254,7 +254,7 @@ void Configuration::initConfiguration( int argc, char** argv )
} }
} }
// ??????????? ?????????? ???? //
initDebug(unideb, "UniSetDebug"); initDebug(unideb, "UniSetDebug");
// cerr << "*************** initConfiguration: oind: " << pt.getCurrent() << " msec " << endl; // cerr << "*************** initConfiguration: oind: " << pt.getCurrent() << " msec " << endl;
...@@ -295,19 +295,19 @@ void Configuration::initConfiguration( int argc, char** argv ) ...@@ -295,19 +295,19 @@ void Configuration::initConfiguration( int argc, char** argv )
// cerr << "*************** initConfiguration: parameters...: " << pt.getCurrent() << " msec " << endl; // cerr << "*************** initConfiguration: parameters...: " << pt.getCurrent() << " msec " << endl;
// pt.reset(); // pt.reset();
// ????????? ?????? ????? //
createNodesList(); createNodesList();
// --------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------
// ????????? ????? ????????? ? argv // argv
// ??? ???????? ?????????? orb ?? ?????? ????? // orb
// ??????? ?? configure.xml // configure.xml
// +N --> -ORBIniRef NodeName= // +N --> -ORBIniRef NodeName=
// +2 --> -ORBIniRef NameService= // +2 --> -ORBIniRef NameService=
_argc = argc+2*lnodes.size()+2; _argc = argc+2*lnodes.size()+2;
_argv = new char*[_argc]; _argv = new char*[_argc];
// ?????????? ?????? ????????? //
int i=0; int i=0;
for( ;i<argc; i++ ) for( ;i<argc; i++ )
{ {
...@@ -315,7 +315,7 @@ void Configuration::initConfiguration( int argc, char** argv ) ...@@ -315,7 +315,7 @@ void Configuration::initConfiguration( int argc, char** argv )
strcpy(_argv[i],argv[i]); strcpy(_argv[i],argv[i]);
} }
// ????????? ????? //
for( UniSetTypes::ListOfNode::iterator it=lnodes.begin(); it!=lnodes.end(); ++it ) for( UniSetTypes::ListOfNode::iterator it=lnodes.begin(); it!=lnodes.end(); ++it )
{ {
_argv[i] = "-ORBInitRef"; _argv[i] = "-ORBInitRef";
...@@ -327,7 +327,7 @@ void Configuration::initConfiguration( int argc, char** argv ) ...@@ -327,7 +327,7 @@ void Configuration::initConfiguration( int argc, char** argv )
strcpy(_argv[i+1],param.str().c_str()); strcpy(_argv[i+1],param.str().c_str());
if( unideb.debugging(Debug::INFO) ) if( unideb.debugging(Debug::INFO) )
unideb[Debug::INFO] << "(Configuration): ?????? ???????? " << param.str() << endl; unideb[Debug::INFO] << "(Configuration): " << param.str() << endl;
i+=2; i+=2;
assert( i < _argc ); assert( i < _argc );
} }
...@@ -336,7 +336,7 @@ void Configuration::initConfiguration( int argc, char** argv ) ...@@ -336,7 +336,7 @@ void Configuration::initConfiguration( int argc, char** argv )
xmlNode* nsnode = getNode("NameService"); xmlNode* nsnode = getNode("NameService");
if( !nsnode ) if( !nsnode )
{ {
unideb[Debug::WARN] << "(Configuration): ?? ????? ??????? 'NameService' \n"; unideb[Debug::WARN] << "(Configuration): 'NameService' \n";
_argv[i] = ""; _argv[i] = "";
_argv[i+1] = ""; _argv[i+1] = "";
} }
...@@ -344,8 +344,8 @@ void Configuration::initConfiguration( int argc, char** argv ) ...@@ -344,8 +344,8 @@ void Configuration::initConfiguration( int argc, char** argv )
{ {
_argv[i] = "-ORBInitRef"; _argv[i] = "-ORBInitRef";
_argv[i+1] = ""; // ?????? ????????????? ?????? ??????? (?.?. ????? ?????????? getArgParam) _argv[i+1] = ""; // (.. getArgParam)
string defPort( getPort() ); // ????? ?????????? getArgParam! ?????????? ?? _argv string defPort( getPort() ); // getArgParam! _argv
if( defPort == UniSetDefaultPort ) if( defPort == UniSetDefaultPort )
defPort = getProp(nsnode,"port"); defPort = getProp(nsnode,"port");
...@@ -355,12 +355,12 @@ void Configuration::initConfiguration( int argc, char** argv ) ...@@ -355,12 +355,12 @@ void Configuration::initConfiguration( int argc, char** argv )
ostringstream param; ostringstream param;
param <<"NameService=corbaname::" << getProp(nsnode,"host") << ":" << defPort; param <<"NameService=corbaname::" << getProp(nsnode,"host") << ":" << defPort;
// ?????? ???? ???????? ????? ??? ?????? //
_argv[i+1] = new char[param.str().size()+1]; // +1 - \0 _argv[i+1] = new char[param.str().size()+1]; // +1 - \0
// ?????? ??????????? //
strcpy(_argv[i+1],param.str().c_str()); strcpy(_argv[i+1],param.str().c_str());
if( unideb.debugging(Debug::INFO) ) if( unideb.debugging(Debug::INFO) )
unideb[Debug::INFO] << "(Configuration): ?????? ???????? " << param.str() << endl; unideb[Debug::INFO] << "(Configuration): " << param.str() << endl;
} }
// ------------- CORBA INIT ------------- // ------------- CORBA INIT -------------
...@@ -596,28 +596,28 @@ void Configuration::createNodesList() ...@@ -596,28 +596,28 @@ void Configuration::createNodesList()
xmlNode* omapnode = unixml.findNode(unixml.getFirstNode(), "ObjectsMap"); xmlNode* omapnode = unixml.findNode(unixml.getFirstNode(), "ObjectsMap");
if( !omapnode ) if( !omapnode )
{ {
unideb[Debug::CRIT] << "(Configuration): ?? ????? ??????? ObjectsMap..."<< endl; unideb[Debug::CRIT] << "(Configuration): ObjectsMap..."<< endl;
throw Exception("configiuration: ?? ????? ??????? ObjectsMap"); throw Exception("configiuration: ObjectsMap");
} }
xmlNode* node = unixml.findNode(omapnode, "nodes"); xmlNode* node = unixml.findNode(omapnode, "nodes");
if(!node) if(!node)
{ {
unideb[Debug::CRIT] << "(Configuration): ?? ????? ??????? ObjectsMap/nodes..."<< endl; unideb[Debug::CRIT] << "(Configuration): ObjectsMap/nodes..."<< endl;
throw Exception("configiuration: ?? ????? ??????? ObjectsMap/nodes"); throw Exception("configiuration: ObjectsMap/nodes");
} }
UniXML_iterator it(node); UniXML_iterator it(node);
it.goChildren(); it.goChildren();
// ?????????? ???? //
string defPort(getPort()); string defPort(getPort());
if( defPort == UniSetDefaultPort ) if( defPort == UniSetDefaultPort )
defPort = unixml.getProp(node,"port"); defPort = unixml.getProp(node,"port");
// ????? ?????. // .
if( defPort.empty() ) if( defPort.empty() )
defPort = UniSetDefaultPort; defPort = UniSetDefaultPort;
...@@ -627,8 +627,8 @@ void Configuration::createNodesList() ...@@ -627,8 +627,8 @@ void Configuration::createNodesList()
string sname(getProp(it,"name")); string sname(getProp(it,"name"));
if(sname.empty()) if(sname.empty())
{ {
unideb[Debug::CRIT] << "Configuration(createNodesList): ?? ?????? ??? ???? "<< endl; unideb[Debug::CRIT] << "Configuration(createNodesList): "<< endl;
throw Exception("Configuration(createNodesList: ? ?????? ????? ?? ?????? ???!"); throw Exception("Configuration(createNodesList: !");
// continue; // continue;
} }
...@@ -638,12 +638,12 @@ void Configuration::createNodesList() ...@@ -638,12 +638,12 @@ void Configuration::createNodesList()
nodename = oind->mkFullNodeName(nodename,nodename); nodename = oind->mkFullNodeName(nodename,nodename);
NodeInfo ninf; NodeInfo ninf;
// unideb[Debug::INFO] << "Configuration(createNodesList): ?????? ???? " << nodename << endl; // unideb[Debug::INFO] << "Configuration(createNodesList): " << nodename << endl;
ninf.id = oind->getIdByName(nodename); ninf.id = oind->getIdByName(nodename);
if( ninf.id == DefaultObjectId ) if( ninf.id == DefaultObjectId )
{ {
unideb[Debug::CRIT] << "Configuration(createNodesList): node '" << nodename << "' ?? ?????? ????????????? ObjectsMap!!!" << endl; unideb[Debug::CRIT] << "Configuration(createNodesList): node '" << nodename << "' ObjectsMap!!!" << endl;
throw Exception("Configuration(createNodesList): node "+nodename+" ?? ?????? ????????????? ObjectsMap!!!"); throw Exception("Configuration(createNodesList): node "+nodename+" ObjectsMap!!!");
// continue; // continue;
} }
...@@ -663,8 +663,8 @@ void Configuration::createNodesList() ...@@ -663,8 +663,8 @@ void Configuration::createNodesList()
ninf.infserver = oind->getIdByName(iname); ninf.infserver = oind->getIdByName(iname);
if( ninf.infserver == DefaultObjectId ) if( ninf.infserver == DefaultObjectId )
{ {
unideb[Debug::CRIT] << "Configuration(createNodesList): InfoServre '" << iname << "' ?? ?????? ????????????? ObjectsMap!!!" << endl; unideb[Debug::CRIT] << "Configuration(createNodesList): InfoServre '" << iname << "' ObjectsMap!!!" << endl;
throw Exception("Configuration(createNodesList: InfoServer "+iname+" ?? ?????? ????????????? ObjectsMap!!!"); throw Exception("Configuration(createNodesList: InfoServer "+iname+" ObjectsMap!!!");
} }
} }
...@@ -694,12 +694,12 @@ void Configuration::createNodesList() ...@@ -694,12 +694,12 @@ void Configuration::createNodesList()
initNode(ninf, it); initNode(ninf, it);
if( unideb.debugging(Debug::INFO) ) if( unideb.debugging(Debug::INFO) )
unideb[Debug::INFO] << "Configuration(createNodesList): ????????? ? ?????? ???? name: " << nodename << " id=" << ninf.id << endl; unideb[Debug::INFO] << "Configuration(createNodesList): name: " << nodename << " id=" << ninf.id << endl;
lnodes.push_back(ninf); lnodes.push_back(ninf);
} }
if( unideb.debugging(Debug::INFO) ) if( unideb.debugging(Debug::INFO) )
unideb[Debug::INFO] << "Configuration(createNodesList): ???? ???? ?????? " << lnodes.size() << endl; unideb[Debug::INFO] << "Configuration(createNodesList): " << lnodes.size() << endl;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
void Configuration::initNode( UniSetTypes::NodeInfo& ninfo, UniXML_iterator& it ) void Configuration::initNode( UniSetTypes::NodeInfo& ninfo, UniXML_iterator& it )
...@@ -723,7 +723,7 @@ xmlNode* Configuration::initDebug( DebugStream& deb, const string& _debname ) ...@@ -723,7 +723,7 @@ xmlNode* Configuration::initDebug( DebugStream& deb, const string& _debname )
{ {
if( _debname.empty() ) if( _debname.empty() )
{ {
deb << "(Configuration)(initDebug): INIT DEBUG FAILED!!! ?? ?????? ??????? ????\n"; deb << "(Configuration)(initDebug): INIT DEBUG FAILED!!! \n";
return 0; return 0;
} }
...@@ -732,8 +732,8 @@ xmlNode* Configuration::initDebug( DebugStream& deb, const string& _debname ) ...@@ -732,8 +732,8 @@ xmlNode* Configuration::initDebug( DebugStream& deb, const string& _debname )
xmlNode* dnode = conf->getNode(_debname); xmlNode* dnode = conf->getNode(_debname);
if( !dnode ) if( !dnode )
{ {
deb << "(Configuration)(initDebug): WARNING! ?? ????? ??????? " << _debname << endl; deb << "(Configuration)(initDebug): WARNING! " << _debname << endl;
// ????? ???????, ??? ?????? ???????? ?????? DebugStream // , DebugStream
} }
else else
{ {
...@@ -751,7 +751,7 @@ xmlNode* Configuration::initDebug( DebugStream& deb, const string& _debname ) ...@@ -751,7 +751,7 @@ xmlNode* Configuration::initDebug( DebugStream& deb, const string& _debname )
} }
} }
// ??????? ????????? ????? //
if( dnode ) if( dnode )
{ {
string conf_debug_levels(getProp(dnode,"levels")); string conf_debug_levels(getProp(dnode,"levels"));
...@@ -765,12 +765,12 @@ xmlNode* Configuration::initDebug( DebugStream& deb, const string& _debname ) ...@@ -765,12 +765,12 @@ xmlNode* Configuration::initDebug( DebugStream& deb, const string& _debname )
deb.logFile(debug_file.c_str()); deb.logFile(debug_file.c_str());
} }
// ?????? ??????? ????????? ?????? //
string log_in("--"+debname+"-log-in-file"); string log_in("--"+debname+"-log-in-file");
string add_level("--"+debname+"-add-levels"); string add_level("--"+debname+"-add-levels");
string del_level("--"+debname+"-del-levels"); string del_level("--"+debname+"-del-levels");
// ??????? ????????? ?????? //
for (int i=1; i<_argc; i++) for (int i=1; i<_argc; i++)
{ {
if( !strcmp(_argv[i],log_in.c_str()) ) // "--debug-log_in_file" if( !strcmp(_argv[i],log_in.c_str()) ) // "--debug-log_in_file"
...@@ -801,12 +801,12 @@ xmlNode* Configuration::initDebug( DebugStream& deb, const string& _debname ) ...@@ -801,12 +801,12 @@ xmlNode* Configuration::initDebug( DebugStream& deb, const string& _debname )
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
void Configuration::initRepSections() void Configuration::initRepSections()
{ {
// ?????????? ??? ??????? ????????? ??????????? // ֣
xmlNode* node( unixml.findNode(unixml.getFirstNode(),"RootSection") ); xmlNode* node( unixml.findNode(unixml.getFirstNode(),"RootSection") );
if( node==0 ) if( node==0 )
{ {
ostringstream msg; ostringstream msg;
msg << "Configuration(initRepSections): ?? ????? ???????? RootSection ? ????. ????? " << fileConfName; msg << "Configuration(initRepSections): RootSection . " << fileConfName;
unideb[Debug::CRIT] << msg.str() << endl; unideb[Debug::CRIT] << msg.str() << endl;
throw SystemError(msg.str()); throw SystemError(msg.str());
} }
...@@ -824,12 +824,11 @@ string Configuration::getRepSectionName( const string sec, xmlNode* secnode ) ...@@ -824,12 +824,11 @@ string Configuration::getRepSectionName( const string sec, xmlNode* secnode )
if( node==0 ) if( node==0 )
{ {
ostringstream msg; ostringstream msg;
msg << "Configuration(initRepSections): ?? ????? ?????? " << sec << " ? ????. ????? " << fileConfName; msg << "Configuration(initRepSections): " << sec << " . " << fileConfName;
unideb[Debug::CRIT] << msg.str() << endl; unideb[Debug::CRIT] << msg.str() << endl;
throw SystemError(msg.str()); throw SystemError(msg.str());
} }
// ?????? ?????????????? ?????????? ??????????
secnode = node; secnode = node;
string ret(unixml.getProp(node,"section")); string ret(unixml.getProp(node,"section"));
...@@ -847,8 +846,8 @@ void Configuration::setConfFileName( const string fn ) ...@@ -847,8 +846,8 @@ void Configuration::setConfFileName( const string fn )
return; return;
} }
// ??????????? ????????????????? ????? //
// ? ??????? ???????? ?????????? //
string tmp( getArgParam("--confile") ); string tmp( getArgParam("--confile") );
if( !tmp.empty() ) if( !tmp.empty() )
...@@ -863,10 +862,10 @@ void Configuration::setConfFileName( const string fn ) ...@@ -863,10 +862,10 @@ void Configuration::setConfFileName( const string fn )
if( fileConfName.empty() ) if( fileConfName.empty() )
{ {
ostringstream msg; ostringstream msg;
msg << "\n\n***** CRIT: ?? ????? ???????????????? ????. \n" msg << "\n\n***** CRIT: . \n"
<< " ??????? ???? --confile\n" << " --confile\n"
<< " ??? ?????????? ?????????? ????????? UNISET_CONFILE\n\n"; << " UNISET_CONFILE\n\n";
// << " ??? ?????????? ???? ? /etc/uniset-configure.xml \n\n"; // << " /etc/uniset-configure.xml \n\n";
unideb[Debug::CRIT] << msg.str(); unideb[Debug::CRIT] << msg.str();
throw SystemError(msg.str()); throw SystemError(msg.str());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment