28 #define _CRT_SECURE_NO_DEPRECATE
54 Warn(
WARN_BUG,
"MapErrorMsg::SetWarnLevel(): Illegal error level!",
"");
67 newtime = localtime(&aclock);
72 fprintf(stderr,
"MapErrorMsg::Warn(): Unable to open file"
73 " for error messages: %s\n",
m_warnfile.c_str());
77 fprintf(EFile,
"%s Level %d *****\n%s %s\n",
78 asctime(newtime), a_level, a_msg1.c_str(), a_msg2.c_str());
89 newtime = localtime(&aclock);
94 fprintf(stderr,
"MapErrorMsg::Warn(): Unable to open file"
95 " for error messages: %s\n",
m_warnfile.c_str());
99 fprintf(EFile,
"%s Level %d *****\n%s %d\n",
100 asctime(newtime), a_level, a_msg1.c_str(), a_msg2);
111 newtime=localtime( &aclock );
116 fprintf(stderr,
"MapErrorMsg::Warn(): Unable to open file"
117 " for error messages: %s\n",
m_warnfile.c_str() );
121 fprintf( EFile,
"%s *****\n%s %s\n",
122 asctime(newtime), a_msg1.c_str(), a_msg2.c_str() );
133 newtime=localtime( &aclock );
138 fprintf(stderr,
"MapErrorMsg::Warn(): Unable to open file"
139 " for error messages: %s\n",
m_warnfile.c_str() );
143 fprintf( EFile,
"%s *****\n%s %g\n",
144 asctime(newtime), a_msg1.c_str(), a_num );
155 fprintf(stderr,
"MapErrorMsg::Warn(): Unable to open file"
156 " for error messages: %s\n",
m_warnfile.c_str());
159 fprintf(EFile,
"%s%s", a_add1.c_str(), a_add2.c_str());
168 EFile =
new ofstream(
m_warnfile.c_str(), ios::app);
169 if (!EFile->is_open()) {
170 fprintf(stderr,
"MapErrorMsg::Warn(): Unable to open file"
171 " for error messages: %s\n",
m_warnfile.c_str());
174 (*EFile) << a_add1.c_str() << a_num << endl;
179 int random(
int a_range )
185 return (
int)(rand()%a_range);