imgtools/imglib/filesystem/source/messageimplementation.cpp
changeset 590 360bd6b35136
parent 0 044383f39525
equal deleted inserted replaced
588:c7c26511138f 590:360bd6b35136
    22 
    22 
    23 
    23 
    24 #include "messageimplementation.h"
    24 #include "messageimplementation.h"
    25 #include "errorhandler.h"
    25 #include "errorhandler.h"
    26 
    26 
    27 using std::endl;
       
    28 using std::cout;
       
    29 typedef std::string String;
       
    30 
    27 
    31 char *errorMssgPrefix="FileSystem : Error:";
    28 char *errorMssgPrefix="FileSystem : Error:";
    32 char *warnMssgPrefix="FileSystem : Warning:";
    29 char *warnMssgPrefix="FileSystem : Warning:";
    33 char *infoMssgPrefix="FileSystem : Information:";
    30 char *infoMssgPrefix="FileSystem : Information:";
    34 char *Space=" ";
    31 char *Space=" ";
   157 @param aMessageType - The type of the message, whether it is Error or Warning or Information.
   154 @param aMessageType - The type of the message, whether it is Error or Warning or Information.
   158 @param aMsgIndex - The index of the information and the corresponding arguments.
   155 @param aMsgIndex - The index of the information and the corresponding arguments.
   159 */
   156 */
   160 void MessageImplementation::ReportMessage(int aMessageType, int aMsgIndex,...)
   157 void MessageImplementation::ReportMessage(int aMessageType, int aMsgIndex,...)
   161 {
   158 {
   162 	String reportMessage;
   159 	string reportMessage;
   163 	char* ptr;
   160 	char* ptr;
   164 
   161 
   165 	va_list ap;
   162 	va_list ap;
   166 	va_start(ap,aMsgIndex);
   163 	va_start(ap,aMsgIndex);
   167 	
   164 	
   237 
   234 
   238 	for(i=0;i<MAX;i++)
   235 	for(i=0;i<MAX;i++)
   239 	{
   236 	{
   240 		errStr = new char[strlen(MessageArray[i].message) + 1];
   237 		errStr = new char[strlen(MessageArray[i].message) + 1];
   241 		strcpy(errStr, MessageArray[i].message);
   238 		strcpy(errStr, MessageArray[i].message);
   242 		iMessage.insert(std::pair<int,char*>(MessageArray[i].index,errStr));
   239 		iMessage.insert(pair<int,char*>(MessageArray[i].index,errStr));
   243 	}
   240 	}
   244 }
   241 }