|
From: Conrado P. <con...@us...> - 2007-08-27 16:43:25
|
Update of /cvsroot/smartwin/SmartWin/tests/SmartSOAPWsdlParser In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17501/SmartSOAPWsdlParser Modified Files: Main.cpp Log Message: Unicode command line support Index: Main.cpp =================================================================== RCS file: /cvsroot/smartwin/SmartWin/tests/SmartSOAPWsdlParser/Main.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Main.cpp 10 Jun 2007 04:01:24 -0000 1.5 +++ Main.cpp 26 Aug 2007 22:21:05 -0000 1.6 @@ -16,20 +16,20 @@ int SmartWinMain( Application & app ) { const CommandLine & com = app.getCommandLine(); - const std::vector< std::string > params = com.getParams(); + const std::vector< SmartUtil::tstring > params = com.getParams(); bool hasCommandLineParams = false; - std::string wsdl; - std::string output; + SmartUtil::tstring wsdl; + SmartUtil::tstring output; - for ( std::vector< std::string >::const_iterator idx = params.begin(); + for ( std::vector< SmartUtil::tstring >::const_iterator idx = params.begin(); idx != params.end(); ++idx ) { hasCommandLineParams = true; - if ( * idx == "-wsdl" && idx != params.end() && ( idx + 1 ) != params.end() ) + if ( * idx == _T("-wsdl") && idx != params.end() && ( idx + 1 ) != params.end() ) wsdl = * ( idx + 1 ); - else if ( * idx == "-ouput" && idx != params.end() && ( idx + 1 ) != params.end() ) + else if ( * idx == _T("-ouput") && idx != params.end() && ( idx + 1 ) != params.end() ) output = * ( idx + 1 ); } @@ -37,40 +37,40 @@ { // Code file boost::tuples::tuple< SmartUtil::tstring, SmartUtil::tstring > retVal = - WsdlParser::instance().fetchWsdlFromUrl( SmartUtil::Ascii2CurrentBuild::doConvert( wsdl, SmartUtil::ConversionCodepage::ANSI ) ); - std::string tmpOuput = AsciiGuaranteed::doConvert( retVal.get< 1 >(), ConversionCodepage::ANSI ); + WsdlParser::instance().fetchWsdlFromUrl( wsdl ); + SmartUtil::tstring tmpOuput = retVal.get< 1 >(); - for ( std::string::iterator idx = tmpOuput.begin(); + for ( SmartUtil::tstring::iterator idx = tmpOuput.begin(); idx != tmpOuput.end(); ++idx ) { - if ( * idx == '\r' ) + if ( * idx == _T('\r') ) { - tmpOuput.replace( idx, idx + 1, "" ); + tmpOuput.replace( idx, idx + 1, _T("") ); } } - std::ofstream code( ( output + ".h" ).c_str() ); + SmartUtil::tofstream code( ( output + _T(".h") ).c_str() ); code << tmpOuput; // Wsdl file - tmpOuput = AsciiGuaranteed::doConvert( retVal.get< 0 >(), ConversionCodepage::ANSI ); - for ( std::string::iterator idx = tmpOuput.begin(); + tmpOuput = retVal.get< 0 >(); + for ( SmartUtil::tstring::iterator idx = tmpOuput.begin(); idx != tmpOuput.end(); ++idx ) { - if ( * idx == '\r' ) + if ( * idx == _T('\r') ) { - tmpOuput.replace( idx, idx + 1, "" ); + tmpOuput.replace( idx, idx + 1, _T("") ); } } - std::ofstream wsdlFile( ( output + ".wsdl" ).c_str() ); + SmartUtil::tofstream wsdlFile( ( output + _T(".wsdl") ).c_str() ); wsdlFile << tmpOuput; return EXIT_SUCCESS; } else { MainWindow * main = new MainWindow(); - main->init( SmartUtil::Ascii2CurrentBuild::doConvert( wsdl, SmartUtil::ConversionCodepage::ANSI ) ); + main->init( wsdl ); return app.run(); } } |