From: <bni...@us...> - 2006-12-05 00:09:51
|
Revision: 414 http://svn.sourceforge.net/omc/?rev=414&view=rev Author: bnicholes Date: 2006-12-04 16:09:31 -0800 (Mon, 04 Dec 2006) Log Message: ----------- replace endl with \r\n to fix the output formatting on a telnet session Modified Paths: -------------- clp/trunk/src/omcclp.cpp clp/trunk/src/omcclpcmdalias.cpp clp/trunk/src/omcclpcmdcreate.cpp clp/trunk/src/omcclpcmddelete.cpp clp/trunk/src/omcclpcmdhelp.cpp clp/trunk/src/omcclpcmdmapping.cpp clp/trunk/src/omcclpcmdreset.cpp clp/trunk/src/omcclpcmdshow.cpp clp/trunk/src/omcclpcmdstart.cpp clp/trunk/src/omcclpcmdstop.cpp clp/trunk/src/omcclpcommand.cpp clp/trunk/src/omcclpcommandline.cpp clp/trunk/src/omcclpcommandstatus.cpp clp/trunk/src/omcclpcommon.cpp clp/trunk/src/omcclpcommon.h clp/trunk/src/omcclpconf.cpp clp/trunk/src/omcclpd.cpp clp/trunk/src/omcclpprint.cpp clp/trunk/src/omcclpprint.h clp/trunk/src/omcclpprogram.cpp clp/trunk/src/omcclptargetpath.cpp Modified: clp/trunk/src/omcclp.cpp =================================================================== --- clp/trunk/src/omcclp.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclp.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -82,11 +82,11 @@ void usage() { cerr << PROG_NAME << " " << PROG_VERSION - << " Server Management Command Line Protocol" << endl; - cerr << "Copyright (C) 2006 by Novell Inc." << endl; - cerr << "Usage: " << PROG_NAME << " [OPTIONS]" << endl; + << " Server Management Command Line Protocol" << CLPENDL; + cerr << "Copyright (C) 2006 by Novell Inc." << CLPENDL; + cerr << "Usage: " << PROG_NAME << " [OPTIONS]" << CLPENDL; - cout << endl << CmdLineParser::getUsage(g_options) << endl; + cout << CLPENDL << CmdLineParser::getUsage(g_options) << CLPENDL; } void printCmdLineParserExceptionMessage(CmdLineParserException& e) @@ -94,19 +94,19 @@ switch (e.getErrorCode()) { case CmdLineParser::E_INVALID_OPTION: - cerr << "unknown option: " << e.getMessage() << endl; + cerr << "unknown option: " << e.getMessage() << CLPENDL; break; case CmdLineParser::E_MISSING_ARGUMENT: - cerr << "missing argument for option: " << e.getMessage() << endl; + cerr << "missing argument for option: " << e.getMessage() << CLPENDL; break; case CmdLineParser::E_INVALID_NON_OPTION_ARG: - cerr << "invalid non-option argument: " << e.getMessage() << endl; + cerr << "invalid non-option argument: " << e.getMessage() << CLPENDL; break; case CmdLineParser::E_MISSING_OPTION: - cerr << "missing required option: " << e.getMessage() << endl; + cerr << "missing required option: " << e.getMessage() << CLPENDL; break; default: - cerr << "failed parsing command line options: " << e << endl; + cerr << "failed parsing command line options: " << e << CLPENDL; break; } } @@ -162,17 +162,17 @@ } catch (Exception& e) { - cerr << "* EXCEPTION CAUGHT IN clp server startup!" << endl; - cerr << Format("* %1", e) << endl; + cerr << "* EXCEPTION CAUGHT IN clp server startup!" << CLPENDL; + cerr << Format("* %1", e) << CLPENDL; } catch (std::exception& e) { - cerr << "* EXCEPTION CAUGHT IN clp server startup!" << endl; - cerr << Format("* Message: %1", e.what()) << endl; + cerr << "* EXCEPTION CAUGHT IN clp server startup!" << CLPENDL; + cerr << Format("* Message: %1", e.what()) << CLPENDL; } catch (...) { - cerr << "* UNKNOWN EXCEPTION CAUGHT IN clpd MAIN!" << endl; + cerr << "* UNKNOWN EXCEPTION CAUGHT IN clpd MAIN!" << CLPENDL; } if (initialized) @@ -224,7 +224,7 @@ } else { - cerr << "Exiting CLP server thread" << endl; + cerr << "Exiting CLP server thread" << CLPENDL; m_condition.notifyAll(); return -1; } @@ -261,7 +261,7 @@ // it can be referenced by other objects. gclp = &clp; - cout << "hello world" << endl; + cout << "hello world" << CLPENDL; /* Initialize the readline library */ init_rl(); @@ -287,16 +287,16 @@ } catch (AssertionException& a) { - cerr << "Caught Assertion: " << a << endl; + cerr << "Caught Assertion: " << a << CLPENDL; ret = 1; } catch (Exception& e) { - cerr << e << endl; + cerr << e << CLPENDL; ret = 1; } - //cerr << "Exit recieved. Client returning" << endl; + //cerr << "Exit recieved. Client returning" << CLPENDL; /* Signal a shutdown */ sigPipe->writeInt(0); return ret; @@ -360,7 +360,7 @@ OMCCLPServerThread clpsvrt(cond, lock); int cc, c; - cout << "hello world" << endl; + cout << "hello world" << CLPENDL; try { @@ -454,23 +454,23 @@ } catch (AssertionException& a) { - cerr << "Caught Assertion: " << a << endl; + cerr << "Caught Assertion: " << a << CLPENDL; } catch (CIMException& e) { - cerr << "ERROR: CIMException:" << e.getMessage() << endl; + cerr << "ERROR: CIMException:" << e.getMessage() << CLPENDL; } catch (Exception& e) { - cerr << "ERROR: Exception:" << e.getMessage() << endl; + cerr << "ERROR: Exception:" << e.getMessage() << CLPENDL; } catch (std::exception& e) { - cerr << "ERROR: sdtException:" << e.what() << endl; + cerr << "ERROR: sdtException:" << e.what() << CLPENDL; } catch (...) { - cerr << "ERROR: UnknownException." << endl; + cerr << "ERROR: UnknownException." << CLPENDL; } return 1; Modified: clp/trunk/src/omcclpcmdalias.cpp =================================================================== --- clp/trunk/src/omcclpcmdalias.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpcmdalias.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -157,7 +157,7 @@ for (size_t i = 0; (i < m_aliasDisplayList.size()); ++i) { - clpout << m_aliasDisplayList[i] << endl; + clpout << m_aliasDisplayList[i] << CLPENDL; } } if (optArg == OUTPUT_DISPLAY_KEYWORD) Modified: clp/trunk/src/omcclpcmdcreate.cpp =================================================================== --- clp/trunk/src/omcclpcmdcreate.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpcmdcreate.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -129,7 +129,7 @@ } catch ( CIMException& ce ) { - cerr << ce << endl; + cerr << ce << CLPENDL; getCmdStatusRef()->setStatus(COMMAND_EXECUTION_FAILED); getCmdStatusRef()->setProcessingError (INVALID_TARGET); return false; @@ -177,7 +177,7 @@ } catch ( CIMException& ce ) { - cerr << ce << endl; + cerr << ce << CLPENDL; getCmdStatusRef()->setStatus(COMMAND_EXECUTION_FAILED); getCmdStatusRef()->setProcessingError (INVALID_TARGET); return false; Modified: clp/trunk/src/omcclpcmddelete.cpp =================================================================== --- clp/trunk/src/omcclpcmddelete.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpcmddelete.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -116,14 +116,14 @@ } catch (const CIMException& ce) { - cerr << ce << endl; + cerr << ce << CLPENDL; getCmdStatusRef()->setStatus(COMMAND_EXECUTION_FAILED); getCmdStatusRef()->setProcessingError (INVALID_TARGET); getCmdStatusRef()->setCIMStatus(CIM_ERR_METHOD_NOT_FOUND); } catch (Exception& e) { - cerr << e << endl; + cerr << e << CLPENDL; } } else @@ -219,7 +219,7 @@ for (int x=0; x < m_deleteInfoArray.size(); x++) { clpout << m_deleteInfoArray[x]->getUFiP() << " "; - clpout << m_deleteInfoArray[x]->getErrorMessage() << endl; + clpout << m_deleteInfoArray[x]->getErrorMessage() << CLPENDL; } } } @@ -230,7 +230,7 @@ for (int x=0; x < m_deleteInfoArray.size(); x++) { clpout << m_deleteInfoArray[x]->getUFiP() << " "; - clpout << m_deleteInfoArray[x]->getErrorMessage() << endl; + clpout << m_deleteInfoArray[x]->getErrorMessage() << CLPENDL; } clpout << "endoutput\n"; } @@ -248,10 +248,10 @@ clpout << "<ufit ufct=\"" << UFcT; clpout << "\" instance=\"" << x << "\"> "; - clpout << UFcT << ufis << "</ufit>" << endl; - clpout << "<ufip>" << UFiP << "</ufip>" << endl; + clpout << UFcT << ufis << "</ufit>" << CLPENDL; + clpout << "<ufip>" << UFiP << "</ufip>" << CLPENDL; clpout << "<result>" << m_deleteInfoArray[x]->getErrorMessage() << "</result>"; - clpout << endl; + clpout << CLPENDL; } clpout << "</instance>\n"; clpout << "</target>\n"; Modified: clp/trunk/src/omcclpcmdhelp.cpp =================================================================== --- clp/trunk/src/omcclpcmdhelp.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpcmdhelp.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -96,29 +96,29 @@ for (size_t i = 0; (i < topics.size()); ++i) { String topicHelp = conf->GetIniSetting(String("help-Commands"), topics[i]); - clpout << topicHelp << endl; + clpout << topicHelp << CLPENDL; } } if (optArg == OUTPUT_DISPLAY_KEYWORD) { - clpout << "command=help" << endl; + clpout << "command=help" << CLPENDL; for (size_t i = 0; (i < topics.size()); ++i) { String topicHelp = conf->GetIniSetting(String("help-Commands"), topics[i]); - clpout << "help=" << topicHelp << endl; + clpout << "help=" << topicHelp << CLPENDL; } - clpout << "endoutput" << endl; + clpout << "endoutput" << CLPENDL; } if (optArg == OUTPUT_DISPLAY_CLPXML) { - clpout << "<help>" << endl; + clpout << "<help>" << CLPENDL; for (size_t i = 0; (i < topics.size()); ++i) { String topicHelp = conf->GetIniSetting(String("help-Commands"), topics[i]); - clpout << "<text>" << topicHelp << "</text>" << endl; + clpout << "<text>" << topicHelp << "</text>" << CLPENDL; } - clpout << "</help>" << endl; - clpout << "</response>" << endl; + clpout << "</help>" << CLPENDL; + clpout << "</response>" << CLPENDL; } } Modified: clp/trunk/src/omcclpcmdmapping.cpp =================================================================== --- clp/trunk/src/omcclpcmdmapping.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpcmdmapping.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -65,13 +65,13 @@ } catch (const CIMException& ce) { - cerr << ce << endl; + cerr << ce << CLPENDL; m_returnValue = CIMValue(2u); m_errorMsg = String(ce.getDescription()); } catch (Exception& e) { - cerr << e << endl; + cerr << e << CLPENDL; } return m_returnValue; @@ -174,7 +174,7 @@ } catch (const CIMException& ce) { - cerr << ce << endl; + cerr << ce << CLPENDL; /*XXX Need to specify a real error value here */ m_returnValue = CIMValue(2u); } @@ -213,13 +213,13 @@ } catch (const CIMException& ce) { - cerr << ce << endl; + cerr << ce << CLPENDL; m_returnValue = CIMValue((UInt32)-1); m_errorMsg = String(ce.getDescription()); } catch (Exception& e) { - cerr << e << endl; + cerr << e << CLPENDL; } return m_returnValue; @@ -368,14 +368,14 @@ } catch (const CIMException& ce) { - cerr << ce << endl; + cerr << ce << CLPENDL; m_returnValue = CIMValue((UInt32)-1); m_errorMsg = String("Invalid parameter for method ") + paramName; ret = false; } catch (Exception& e) { - cerr << e << endl; + cerr << e << CLPENDL; ret = false; } return ret; @@ -410,14 +410,14 @@ } catch (const CIMException& ce) { - cerr << ce << endl; + cerr << ce << CLPENDL; m_returnValue = CIMValue((UInt32)-1); m_errorMsg = String("Invalid method invocation string"); ret = false; } catch (Exception& e) { - cerr << e << endl; + cerr << e << CLPENDL; ret = false; } Modified: clp/trunk/src/omcclpcmdreset.cpp =================================================================== --- clp/trunk/src/omcclpcmdreset.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpcmdreset.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -118,14 +118,14 @@ { getCmdStatusRef()->setStatus(COMMAND_EXECUTION_FAILED); getCmdStatusRef()->setCIMStatus (CIM_ERR_UNEXPECTED_RESPONSE); - cerr << "reset command general error: " << ce << endl; + cerr << "reset command general error: " << ce << CLPENDL; return false; } catch (Exception& e) { getCmdStatusRef()->setStatus(COMMAND_EXECUTION_FAILED); getCmdStatusRef()->setCIMStatus (CIM_ERR_UNEXPECTED_RESPONSE); - cerr << "reset command general error: " << e << endl; + cerr << "reset command general error: " << e << CLPENDL; return false; } } Modified: clp/trunk/src/omcclpcmdshow.cpp =================================================================== --- clp/trunk/src/omcclpcmdshow.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpcmdshow.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -76,11 +76,11 @@ } catch (const CIMException& ce) { - cerr << ce << endl; + cerr << ce << CLPENDL; } catch (Exception& e) { - cerr << e << endl; + cerr << e << CLPENDL; } /* If a specific traversal level was specified on the command line @@ -210,11 +210,11 @@ } catch (const CIMException& ce) { - cerr << ce << endl; + cerr << ce << CLPENDL; } catch (Exception& e) { - cerr << e << endl; + cerr << e << CLPENDL; } /* If a specific traversal level was specified on the command line @@ -475,7 +475,7 @@ } catch (const Exception& e) { - clpout << e.getMessage() << endl; + clpout << e.getMessage() << CLPENDL; } handler->outputTail(clpSession->clpout()); delete handler; Modified: clp/trunk/src/omcclpcmdstart.cpp =================================================================== --- clp/trunk/src/omcclpcmdstart.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpcmdstart.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -118,14 +118,14 @@ { getCmdStatusRef()->setStatus(COMMAND_EXECUTION_FAILED); getCmdStatusRef()->setCIMStatus (CIM_ERR_UNEXPECTED_RESPONSE); - cerr << "start command general error: " << ce << endl; + cerr << "start command general error: " << ce << CLPENDL; return false; } catch (Exception& e) { getCmdStatusRef()->setStatus(COMMAND_EXECUTION_FAILED); getCmdStatusRef()->setCIMStatus (CIM_ERR_UNEXPECTED_RESPONSE); - cerr << "start command general error: " << e << endl; + cerr << "start command general error: " << e << CLPENDL; return false; } } Modified: clp/trunk/src/omcclpcmdstop.cpp =================================================================== --- clp/trunk/src/omcclpcmdstop.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpcmdstop.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -120,14 +120,14 @@ { getCmdStatusRef()->setStatus(COMMAND_EXECUTION_FAILED); getCmdStatusRef()->setCIMStatus (CIM_ERR_UNEXPECTED_RESPONSE); - cerr << "stop command general error: " << ce << endl; + cerr << "stop command general error: " << ce << CLPENDL; return false; } catch (Exception& e) { getCmdStatusRef()->setStatus(COMMAND_EXECUTION_FAILED); getCmdStatusRef()->setCIMStatus (CIM_ERR_UNEXPECTED_RESPONSE); - cerr << "stop command general error: " << e << endl; + cerr << "stop command general error: " << e << CLPENDL; return false; } } Modified: clp/trunk/src/omcclpcommand.cpp =================================================================== --- clp/trunk/src/omcclpcommand.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpcommand.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -335,11 +335,11 @@ } catch (const CIMException& ce) { - cerr << ce << endl; + cerr << ce << CLPENDL; } catch (Exception& e) { - cerr << e << endl; + cerr << e << CLPENDL; } catch (...) { @@ -382,11 +382,11 @@ } catch (const CIMException& ce) { - cerr << ce << endl; + cerr << ce << CLPENDL; } catch (Exception& e) { - cerr << e << endl; + cerr << e << CLPENDL; } catch (...) { @@ -550,7 +550,7 @@ /* If there was a general message or message error, then display it */ if (getCmdStatusRef()->getMessageData()->getMessageID() != 0) { - clpout << getCmdStatusRef()->getMessageData()->getMessage() << endl; + clpout << getCmdStatusRef()->getMessageData()->getMessage() << CLPENDL; } break; case OUTPUT_DISPLAY_KEYWORD: Modified: clp/trunk/src/omcclpcommandline.cpp =================================================================== --- clp/trunk/src/omcclpcommandline.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpcommandline.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -52,7 +52,7 @@ */ static void display_message (const char *msg) { - cout << endl << msg << endl; + cout << CLPENDL << msg << CLPENDL; rl_on_new_line(); } Modified: clp/trunk/src/omcclpcommandstatus.cpp =================================================================== --- clp/trunk/src/omcclpcommandstatus.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpcommandstatus.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -299,13 +299,13 @@ switch (displayArg) { case OUTPUT_DISPLAY_TEXT: - str_msg += "\n"; + str_msg += "\r\n"; break; case OUTPUT_DISPLAY_KEYWORD: - str_msg = "status=" + str_msg + "\n"; + str_msg = "status=" + str_msg + "\r\n"; break; case OUTPUT_DISPLAY_CLPXML: - str_msg = "<status>" + str_msg + "</status>" + "\n"; + str_msg = "<status>" + str_msg + "</status>" + "\r\n"; break; } @@ -343,13 +343,13 @@ switch (displayArg) { case OUTPUT_DISPLAY_TEXT: - str_msg += "\n"; + str_msg += "\r\n"; break; case OUTPUT_DISPLAY_KEYWORD: - str_msg = "status_tag=" + str_msg + "\n"; + str_msg = "status_tag=" + str_msg + "\r\n"; break; case OUTPUT_DISPLAY_CLPXML: - str_msg = "<status_tag>" + str_msg + "</status_tag>" + "\n"; + str_msg = "<status_tag>" + str_msg + "</status_tag>" + "\r\n"; break; } @@ -380,13 +380,13 @@ switch (displayArg) { case OUTPUT_DISPLAY_TEXT: - str_msg += "\n"; + str_msg += "\r\n"; break; case OUTPUT_DISPLAY_KEYWORD: - str_msg = "error=" + str_msg + "\n"; + str_msg = "error=" + str_msg + "\r\n"; break; case OUTPUT_DISPLAY_CLPXML: - str_msg = "<error>" + str_msg + "</error>" + "\n"; + str_msg = "<error>" + str_msg + "</error>" + "\r\n"; break; } @@ -419,13 +419,13 @@ switch (displayArg) { case OUTPUT_DISPLAY_TEXT: - str_msg += "\n"; + str_msg += "\r\n"; break; case OUTPUT_DISPLAY_KEYWORD: - str_msg = "error_tag=" + str_msg + "\n"; + str_msg = "error_tag=" + str_msg + "\r\n"; break; case OUTPUT_DISPLAY_CLPXML: - str_msg = "<error_tag>" + str_msg + "</error_tag>" + "\n"; + str_msg = "<error_tag>" + str_msg + "</error_tag>" + "\r\n"; break; } @@ -473,13 +473,13 @@ switch (displayArg) { case OUTPUT_DISPLAY_TEXT: - str_msg += "\n"; + str_msg += "\r\n"; break; case OUTPUT_DISPLAY_KEYWORD: - str_msg = "errtype=" + str_msg + "\n"; + str_msg = "errtype=" + str_msg + "\r\n"; break; case OUTPUT_DISPLAY_CLPXML: - str_msg = "<errtype>" + str_msg + "</errtype>" + "\n"; + str_msg = "<errtype>" + str_msg + "</errtype>" + "\r\n"; break; } @@ -512,13 +512,13 @@ switch (displayArg) { case OUTPUT_DISPLAY_TEXT: - str_msg += "\n"; + str_msg += "\r\n"; break; case OUTPUT_DISPLAY_KEYWORD: - str_msg = "errtype_desc=" + str_msg + "\n"; + str_msg = "errtype_desc=" + str_msg + "\r\n"; break; case OUTPUT_DISPLAY_CLPXML: - str_msg = "<errtype_desc>" + str_msg + "</errtype_desc>" + "\n"; + str_msg = "<errtype_desc>" + str_msg + "</errtype_desc>" + "\r\n"; break; } @@ -552,10 +552,10 @@ str_msg += "\n"; break; case OUTPUT_DISPLAY_KEYWORD: - str_msg = "cimstat=" + str_msg + "\n"; + str_msg = "cimstat=" + str_msg + "\r\n"; break; case OUTPUT_DISPLAY_CLPXML: - str_msg = "<cimstat>" + str_msg + "</cimstat>" + "\n"; + str_msg = "<cimstat>" + str_msg + "</cimstat>" + "\r\n"; break; } @@ -588,13 +588,13 @@ switch (displayArg) { case OUTPUT_DISPLAY_TEXT: - str_msg += "\n"; + str_msg += "\r\n"; break; case OUTPUT_DISPLAY_KEYWORD: - str_msg = "cimstat_desc=" + str_msg + "\n"; + str_msg = "cimstat_desc=" + str_msg + "\r\n"; break; case OUTPUT_DISPLAY_CLPXML: - str_msg = "<cimstat_desc>" + str_msg + "</cimstat_desc>" + "\n"; + str_msg = "<cimstat_desc>" + str_msg + "</cimstat_desc>" + "\r\n"; break; } @@ -625,13 +625,13 @@ switch (displayArg) { case OUTPUT_DISPLAY_TEXT: - str_msg += "\n"; + str_msg += "\r\n"; break; case OUTPUT_DISPLAY_KEYWORD: - str_msg = "severity=" + str_msg + "\n"; + str_msg = "severity=" + str_msg + "\r\n"; break; case OUTPUT_DISPLAY_CLPXML: - str_msg = "<severity>" + str_msg + "</severity>" + "\n"; + str_msg = "<severity>" + str_msg + "</severity>" + "\r\n"; break; } @@ -664,13 +664,13 @@ switch (displayArg) { case OUTPUT_DISPLAY_TEXT: - str_msg += "\n"; + str_msg += "\r\n"; break; case OUTPUT_DISPLAY_KEYWORD: - str_msg = "severity_desc=" + str_msg + "\n"; + str_msg = "severity_desc=" + str_msg + "\r\n"; break; case OUTPUT_DISPLAY_CLPXML: - str_msg = "<severity_desc>" + str_msg + "</severity_desc>" + "\n"; + str_msg = "<severity_desc>" + str_msg + "</severity_desc>" + "\r\n"; break; } @@ -701,13 +701,13 @@ switch (displayArg) { case OUTPUT_DISPLAY_TEXT: - str_msg += "\n"; + str_msg += "\r\n"; break; case OUTPUT_DISPLAY_KEYWORD: - str_msg = "probcause=" + str_msg + "\n"; + str_msg = "probcause=" + str_msg + "\r\n"; break; case OUTPUT_DISPLAY_CLPXML: - str_msg = "<probcause>" + str_msg + "</probcause>" + "\n"; + str_msg = "<probcause>" + str_msg + "</probcause>" + "\r\n"; break; } @@ -740,13 +740,13 @@ switch (displayArg) { case OUTPUT_DISPLAY_TEXT: - str_msg += "\n"; + str_msg += "\r\n"; break; case OUTPUT_DISPLAY_KEYWORD: - str_msg = "probcause_desc=" + str_msg + "\n"; + str_msg = "probcause_desc=" + str_msg + "\r\n"; break; case OUTPUT_DISPLAY_CLPXML: - str_msg = "<probcause_desc>" + str_msg + "</probcause_desc>" + "\n"; + str_msg = "<probcause_desc>" + str_msg + "</probcause_desc>" + "\r\n"; break; } Modified: clp/trunk/src/omcclpcommon.cpp =================================================================== --- clp/trunk/src/omcclpcommon.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpcommon.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -309,14 +309,14 @@ catch (const CIMException& ce) { #ifdef DEBUG1 - cerr << ce << endl; + cerr << ce << CLPENDL; #endif result = false; } catch (Exception& e) { #ifdef DEBUG1 - cerr << e << endl; + cerr << e << CLPENDL; #endif result = false; } @@ -474,7 +474,7 @@ CIMObjectPath cop = enu.nextElement(); #ifdef DEBUG1 - cout << ufit << " " << getUFiSFromObjectPath(cop) << endl; + cout << ufit << " " << getUFiSFromObjectPath(cop) << CLPENDL; #endif /* Match the specifed UFiS with the derived UFiS from the @@ -717,9 +717,9 @@ try { #ifdef DEBUG1 - cout << endl << baseCop.toString(); - cout << endl << assocCT; - cout << endl << subUFcT; + cout << CLPENDL << baseCop.toString(); + cout << CLPENDL << assocCT; + cout << CLPENDL << subUFcT; #endif /* Enumerate through all of the selected CIMObjects looking for the one that matches the specified UFiS */ @@ -765,7 +765,7 @@ } catch (Exception& e) { - cerr << e << endl; + cerr << e << CLPENDL; } } } @@ -917,9 +917,9 @@ try { #ifdef DEBUG1 - cout << endl << baseCop.toString(); - cout << endl << assocCT; - cout << endl << subUFcT; + cout << CLPENDL << baseCop.toString(); + cout << CLPENDL << assocCT; + cout << CLPENDL << subUFcT; #endif /* Enumerate through all of the selected CIMObjects looking for the one that matches the specified UFiS */ @@ -952,11 +952,11 @@ } catch (const CIMException& ce) { - cerr << ce << endl; + cerr << ce << CLPENDL; } catch (Exception& e) { - cerr << e << endl; + cerr << e << CLPENDL; } } } Modified: clp/trunk/src/omcclpcommon.h =================================================================== --- clp/trunk/src/omcclpcommon.h 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpcommon.h 2006-12-05 00:09:31 UTC (rev 414) @@ -46,20 +46,22 @@ using std::cerr; using std::cin; using std::cout; -using std::endl; +//using std::endl; extern void* addrgram__set_scan_string( const char *yy_str ); extern int addrgram_doparse (void *omcclp); #define DISPLAY_ARRAY1(disparray,meth) \ for (int aaa=0; aaa<disparray.size(); aaa++) { \ - cout << disparray[aaa].meth() << endl; } + cout << disparray[aaa].meth() << CLPENDL; } #define STRIP_QUOTES(s) \ if (s.startsWith('"') && s.endsWith('"')) { \ s = s.substring(1); \ s = s.substring(0,s.length()-1); } +#define CLPENDL "\r\n" + namespace OMCCLP { class OMCCLPProgram; Modified: clp/trunk/src/omcclpconf.cpp =================================================================== --- clp/trunk/src/omcclpconf.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpconf.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -25,6 +25,7 @@ #include "omcclpconf.h" +#include "omcclpcommon.h" namespace OMCCLP { @@ -90,7 +91,7 @@ { if (m_filename.empty()) { - cout << "No configuration file specified" << endl; + cout << "No configuration file specified" << CLPENDL; return; } Modified: clp/trunk/src/omcclpd.cpp =================================================================== --- clp/trunk/src/omcclpd.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpd.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -72,8 +72,8 @@ /*XXX will be enabled with job tracking exists if (!createCLPJobInfo(m_cimClient)) { - cerr << "Could not create a CLP job instance" << endl; - cerr << "Running without CLP job data" << endl; + cerr << "Could not create a CLP job instance" << CLPENDL; + cerr << "Running without CLP job data" << CLPENDL; } */ @@ -95,11 +95,11 @@ } catch (const CIMException& ce) { - cerr << "execute general error: " << ce << endl; + cerr << "execute general error: " << ce << CLPENDL; } catch (Exception& e) { - cerr << "execute general error: " << e << endl; + cerr << "execute general error: " << e << CLPENDL; } try @@ -109,12 +109,12 @@ catch (const CIMException& ce) { rnclpCommand->display(); - cerr << "display general error: " << ce << endl; + cerr << "display general error: " << ce << CLPENDL; } catch (Exception& e) { rnclpCommand->display(); - cerr << "display general error: " << e << endl; + cerr << "display general error: " << e << CLPENDL; } } else Modified: clp/trunk/src/omcclpprint.cpp =================================================================== --- clp/trunk/src/omcclpprint.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpprint.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -413,7 +413,7 @@ { for (size_t i = 0; i < verbs.size(); ++i) { - clpout << outputIndent() << verbs[i] << endl; + clpout << outputIndent() << verbs[i] << CLPENDL; } } @@ -424,7 +424,7 @@ { OMCCLPProgram* clpSession = m_showCmd->getCLPSession(); String cpName = cpa.getName(); - clpout << outputIndent() << "Role = " << cpName << endl; + clpout << outputIndent() << "Role = " << cpName << CLPENDL; CIMValue cv = cpa.getValue();; if (cv && cv.getType() == CIMDataType::REFERENCE) @@ -438,8 +438,8 @@ String UFcT = getUFcTFromCIMObjectPath (clpSession, ov); increaseIndent(); - clpout << outputIndent() << "UFiT: " << UFcT << UFiS << endl; - clpout << outputIndent() << "UFiP: " << UFiP << endl; + clpout << outputIndent() << "UFiT: " << UFcT << UFiS << CLPENDL; + clpout << outputIndent() << "UFiP: " << UFiP << CLPENDL; decreaseIndent(); } } @@ -452,7 +452,7 @@ { String UFiP = copi->getTargetPathRef()->getUFiP(); StringArray sa = UFiP.tokenize("/"); - clpout << outputIndent() << safeBack(sa) << endl; + clpout << outputIndent() << safeBack(sa) << CLPENDL; } /** @@ -460,11 +460,11 @@ */ void InstanceKeywordPrinter::outputProperty(std::ostream& clpout, const CIMObjectPath& cop, CIMProperty& prop) { - clpout << "begingroup=property" << endl; - clpout << "property_name=" << prop.getName()<< endl; + clpout << "begingroup=property" << CLPENDL; + clpout << "property_name=" << prop.getName()<< CLPENDL; // TODO this should get the value and type output that data - clpout << "property_value=" << prop.toString() << endl; - clpout << "endgroup" << endl; + clpout << "property_value=" << prop.toString() << CLPENDL; + clpout << "endgroup" << CLPENDL; } /** @@ -475,7 +475,7 @@ { for (size_t i = 0; i < verbs.size(); ++i) { - clpout << "verb=" << verbs[i] << endl; + clpout << "verb=" << verbs[i] << CLPENDL; } } @@ -486,8 +486,8 @@ { OMCCLPProgram* clpSession = m_showCmd->getCLPSession(); String cpName = cpa.getName(); - clpout << "begingroup=reference" << endl; - clpout << "role=" << cpName << endl; + clpout << "begingroup=reference" << CLPENDL; + clpout << "role=" << cpName << CLPENDL; CIMValue cv = cpa.getValue();; if (cv && cv.getType() == CIMDataType::REFERENCE) @@ -500,13 +500,13 @@ Int32 UFiS = getUFiSFromObjectPath (ov); String UFcT = getUFcTFromCIMObjectPath (clpSession, ov); - clpout << "begingroup=instance" << endl; - clpout << "ufit=" << UFcT << UFiS << endl; - clpout << "ufip=" << UFiP << endl; - clpout << "endgroup" << endl; + clpout << "begingroup=instance" << CLPENDL; + clpout << "ufit=" << UFcT << UFiS << CLPENDL; + clpout << "ufip=" << UFiP << CLPENDL; + clpout << "endgroup" << CLPENDL; } } - clpout << "endgroup" << endl; + clpout << "endgroup" << CLPENDL; } /** @@ -514,7 +514,7 @@ */ void InstanceKeywordPrinter::outputTarget(std::ostream& clpout, const OMCCLPCimObjectPathInfoRef& copi) { - clpout << "ufip=" << copi->getTargetPathRef()->getUFiP() << endl; + clpout << "ufip=" << copi->getTargetPathRef()->getUFiP() << CLPENDL; } /** @@ -537,12 +537,12 @@ */ void InstanceXMLPrinter::outputStandardVerbs(std::ostream& clpout, StringArray verbs) { - clpout << "<standardverbs>" << endl; + clpout << "<standardverbs>" << CLPENDL; for (size_t i = 0; i < verbs.size(); ++i) { clpout << verbs[i] << " "; } - clpout << endl << "</standardverbs>"; + clpout << CLPENDL << "</standardverbs>"; } /** @@ -552,8 +552,8 @@ { OMCCLPProgram* clpSession = m_showCmd->getCLPSession(); String cpName = cpa.getName(); - clpout << "<reference>" << endl; - clpout << "<role>" << cpName << "</role>" << endl; + clpout << "<reference>" << CLPENDL; + clpout << "<role>" << cpName << "</role>" << CLPENDL; CIMValue cv = cpa.getValue();; if (cv && cv.getType() == CIMDataType::REFERENCE) @@ -566,15 +566,15 @@ Int32 UFiS = getUFiSFromObjectPath (ov); String UFcT = getUFcTFromCIMObjectPath (clpSession, ov); - clpout << "<instance>" << endl; + clpout << "<instance>" << CLPENDL; clpout << "<ufit ufct=\"" << UFcT << "\" instance=\"" << UFiS << "\">" << - UFcT << UFiS << "</ufit>" << endl; - clpout << "<ufip>" << UFiP << "</ufip>" << endl; - clpout << "</instance>" << endl; + UFcT << UFiS << "</ufit>" << CLPENDL; + clpout << "<ufip>" << UFiP << "</ufip>" << CLPENDL; + clpout << "</instance>" << CLPENDL; } } - clpout << "</reference>" << endl; + clpout << "</reference>" << CLPENDL; } /** @@ -582,7 +582,7 @@ */ void InstanceXMLPrinter::outputTarget(std::ostream& clpout, const OMCCLPCimObjectPathInfoRef& copi) { - clpout << "<ufip>" << copi->getTargetPathRef()->getUFiP() << "</ufip>" << endl; + clpout << "<ufip>" << copi->getTargetPathRef()->getUFiP() << "</ufip>" << CLPENDL; } Modified: clp/trunk/src/omcclpprint.h =================================================================== --- clp/trunk/src/omcclpprint.h 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpprint.h 2006-12-05 00:09:31 UTC (rev 414) @@ -54,38 +54,38 @@ void virtual outputInstanceHead(std::ostream& clpout){} void virtual outputUFiP(std::ostream& clpout, const String& ufip) { - clpout << outputIndent() << "UFiP:" << endl; + clpout << outputIndent() << "UFiP:" << CLPENDL; increaseIndent(); - clpout << outputIndent() << ufip << endl; + clpout << outputIndent() << ufip << CLPENDL; decreaseIndent(); } void virtual outputUFcT(std::ostream& clpout, String ufct){} void virtual outputTargetHead(std::ostream& clpout){ - clpout << outputIndent() << "Targets:" << endl; + clpout << outputIndent() << "Targets:" << CLPENDL; } void virtual outputTarget(std::ostream& clpout, const OMCCLPCimObjectPathInfoRef& t); void virtual outputTargetTail(std::ostream& clpout){} void virtual outputPropertiesHead(std::ostream& clpout) { - clpout << outputIndent() << "Properties:" << endl; + clpout << outputIndent() << "Properties:" << CLPENDL; } void virtual outputProperty(std::ostream& clpout, const CIMInstance& ci, CIMProperty& prop) { String cpName = prop.getName(); - clpout << outputIndent() << cpName << " = " << getPropertyValue(ci, cpName) << endl; + clpout << outputIndent() << cpName << " = " << getPropertyValue(ci, cpName) << CLPENDL; } void virtual outputPropertiesTail(std::ostream& clpout){} void virtual outputAssociationsHead(std::ostream& clpout){ - clpout << outputIndent() << "Associations:" << endl; + clpout << outputIndent() << "Associations:" << CLPENDL; } void virtual outputAssociationHead(std::ostream& clpout, CIMInstance cia){ /*XXX This should print out the user friend name not a CIM class name */ - clpout << outputIndent() << "Association = " << cia.getName() << endl; + clpout << outputIndent() << "Association = " << cia.getName() << CLPENDL; } void virtual outputAssociation(std::ostream& clpout, CIMProperty cpa); void virtual outputAssociationTail(std::ostream& clpout){} void virtual outputAssociationsTail(std::ostream& clpout){} void virtual outputVerbsHead(std::ostream& clpout) { - clpout << outputIndent() << "Verbs:" << endl; + clpout << outputIndent() << "Verbs:" << CLPENDL; } void virtual outputStandardVerbs(std::ostream& clpout, StringArray verbs); void virtual outputOEMVerbs(std::ostream& clpout, StringArray verbs){} @@ -134,36 +134,36 @@ virtual ~InstanceKeywordPrinter() {}; void outputHead(std::ostream& clpout) {} - void outputTail(std::ostream& clpout) {clpout << "endoutput" << endl;} - void outputInstanceHead(std::ostream& clpout){clpout << "begingroup=instance" << endl;} + void outputTail(std::ostream& clpout) {clpout << "endoutput" << CLPENDL;} + void outputInstanceHead(std::ostream& clpout){clpout << "begingroup=instance" << CLPENDL;} void outputUFiP(std::ostream& clpout, const String& ufip) { - clpout << "ufip=" << ufip << endl; + clpout << "ufip=" << ufip << CLPENDL; } - void outputUFcT(std::ostream& clpout, String ufct) {clpout << "ufip=" << ufct << endl;} - void outputTargetHead(std::ostream& clpout){clpout << "begingroup=targets" << endl;} + void outputUFcT(std::ostream& clpout, String ufct) {clpout << "ufip=" << ufct << CLPENDL;} + void outputTargetHead(std::ostream& clpout){clpout << "begingroup=targets" << CLPENDL;} void outputTarget(std::ostream& clpout, const OMCCLPCimObjectPathInfoRef& t); - void outputTargetTail(std::ostream& clpout){clpout << "endgroup" << endl;} + void outputTargetTail(std::ostream& clpout){clpout << "endgroup" << CLPENDL;} void outputPropertiesHead(std::ostream& clpout) {} // TODO what should the type be for propValue? void outputProperty(std::ostream& clpout, const CIMObjectPath& cop, CIMProperty& prop); void outputPropertiesTail(std::ostream& clpout){} - void outputAssociationsHead(std::ostream& clpout) {clpout << "begingroup=associations" << endl;} + void outputAssociationsHead(std::ostream& clpout) {clpout << "begingroup=associations" << CLPENDL;} void outputAssociationHead(std::ostream& clpout, CIMInstance cia){ - clpout << "begingroup=association" << endl; - clpout << "name=" << cia.getName() << endl; + clpout << "begingroup=association" << CLPENDL; + clpout << "name=" << cia.getName() << CLPENDL; } void outputAssociation(std::ostream& clpout, CIMProperty cpa); - void outputAssociationTail(std::ostream& clpout){clpout << "endgroup" << endl;} - void outputAssociationsTail(std::ostream& clpout){clpout << "endgroup" << endl;} + void outputAssociationTail(std::ostream& clpout){clpout << "endgroup" << CLPENDL;} + void outputAssociationsTail(std::ostream& clpout){clpout << "endgroup" << CLPENDL;} void outputVerbsHead(std::ostream& clpout) { - clpout << "begingroup=verbs" << endl; + clpout << "begingroup=verbs" << CLPENDL; } void outputStandardVerbs(std::ostream& clpout, StringArray verbs); void outputOEMVerbs(std::ostream& clpout, StringArray verbs){} void outputVerbsTail(std::ostream& clpout) { - clpout << "endgroup" << endl; + clpout << "endgroup" << CLPENDL; } - void outputInstanceTail(std::ostream& clpout){clpout << "endgroup" << endl;} + void outputInstanceTail(std::ostream& clpout){clpout << "endgroup" << CLPENDL;} }; class InstanceXMLPrinter : public InstancePrinter { @@ -173,26 +173,26 @@ virtual ~InstanceXMLPrinter() {}; void outputHead(std::ostream& clpout) {} - void outputTail(std::ostream& clpout) {clpout << "</show></response>" << endl;} + void outputTail(std::ostream& clpout) {clpout << "</show></response>" << CLPENDL;} void outputInstanceHead(std::ostream& clpout){clpout << "<instance>";} void outputUFiP(std::ostream& clpout, const String& ufip){ - clpout << "<ufip>" << ufip <<"</ufip>" << endl; + clpout << "<ufip>" << ufip <<"</ufip>" << CLPENDL; } - void outputUFcT(std::ostream& clpout, String ufct) {clpout << "<ufip>" << ufct <<"</ufip>" << endl;} - void outputTargetHead(std::ostream& clpout){clpout << "<targets>" << endl;} + void outputUFcT(std::ostream& clpout, String ufct) {clpout << "<ufip>" << ufct <<"</ufip>" << CLPENDL;} + void outputTargetHead(std::ostream& clpout){clpout << "<targets>" << CLPENDL;} void outputTarget(std::ostream& clpout, const OMCCLPCimObjectPathInfoRef& t); - void outputTargetTail(std::ostream& clpout){clpout << "</targets>" << endl;} + void outputTargetTail(std::ostream& clpout){clpout << "</targets>" << CLPENDL;} void outputPropertiesHead(std::ostream& clpout) {clpout << "<properties>";} void outputProperty(std::ostream& clpout, const CIMObjectPath& cop, CIMProperty& prop); - void outputPropertiesTail(std::ostream& clpout){clpout <<"</properties>" << endl;} + void outputPropertiesTail(std::ostream& clpout){clpout <<"</properties>" << CLPENDL;} void outputAssociationsHead(std::ostream& clpout) {clpout << "<associations>";} void outputAssociationHead(std::ostream& clpout, CIMInstance cia) { clpout << "<association>"; - clpout << "<ufct>" << cia.getName() << "</ufct>" << endl; + clpout << "<ufct>" << cia.getName() << "</ufct>" << CLPENDL; } void outputAssociation(std::ostream& clpout, CIMProperty cpa); - void outputAssociationTail(std::ostream& clpout) {clpout << "</association>" << endl;} - void outputAssociationsTail(std::ostream& clpout) {clpout << "</associations>" << endl;} + void outputAssociationTail(std::ostream& clpout) {clpout << "</association>" << CLPENDL;} + void outputAssociationsTail(std::ostream& clpout) {clpout << "</associations>" << CLPENDL;} void outputVerbsHead(std::ostream& clpout) { clpout << "<verbs>"; } @@ -201,7 +201,7 @@ void outputVerbsTail(std::ostream& clpout) { clpout << "</verbs>"; } - void outputInstanceTail(std::ostream& clpout){clpout << "</instance>" << endl;} + void outputInstanceTail(std::ostream& clpout){clpout << "</instance>" << CLPENDL;} }; } Modified: clp/trunk/src/omcclpprogram.cpp =================================================================== --- clp/trunk/src/omcclpprogram.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclpprogram.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -47,7 +47,7 @@ bool getCredentials(const String& realm, String& name, String& passwd, const String& details) { - cout << "Authentication required for " << realm << endl; + cout << "Authentication required for " << realm << CLPENDL; cout << "Enter the user name: "; name = String::getLine(cin); passwd = GetPass::getPass("Enter the password for " + @@ -58,7 +58,7 @@ static void display_message (const char *msg) { - cout << endl << msg << endl; + cout << CLPENDL << msg << CLPENDL; } namespace OMCCLP { @@ -113,7 +113,7 @@ #ifdef OMCCLPDAEMON OW_LOG_DEBUG(m_logger, msg); #else - cout << msg << endl; + cout << msg << CLPENDL; #endif } @@ -122,7 +122,7 @@ #ifdef OMCCLPDAEMON OW_LOG_INFO(m_logger, msg); #else - cout << msg << endl; + cout << msg << CLPENDL; #endif } @@ -245,7 +245,7 @@ //#else // display_message (se.c_str()); //#endif -cout << se << endl; +cout << se << CLPENDL; } catch (Exception& e) { @@ -254,7 +254,7 @@ //#else // display_message (e.getMessage()); //#endif -cout << e << endl; +cout << e << CLPENDL; } return false; } Modified: clp/trunk/src/omcclptargetpath.cpp =================================================================== --- clp/trunk/src/omcclptargetpath.cpp 2006-12-04 23:15:57 UTC (rev 413) +++ clp/trunk/src/omcclptargetpath.cpp 2006-12-05 00:09:31 UTC (rev 414) @@ -421,9 +421,9 @@ try { #ifdef DEBUG1 - cout << endl << baseCop.toString(); - cout << endl << assocCT; - cout << endl << subUFcT; + cout << CLPENDL << baseCop.toString(); + cout << CLPENDL << assocCT; + cout << CLPENDL << subUFcT; #endif /* Enumerate through all of the selected CIMObjects looking for the one @@ -477,7 +477,7 @@ } catch (Exception& e) { - cerr << e << endl; + cerr << e << CLPENDL; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |