@@ -21,7 +21,7 @@ ostream * ErrorDescriptor::_out = 0;
2121void
2222ErrorDescriptor::PrintContents (ostream &out) const
2323{
24- SCLstring s;
24+ std::string s;
2525 out << " Severity: " << severity (s) << endl;
2626 if (_userMsg)
2727 {
@@ -36,58 +36,58 @@ ErrorDescriptor::PrintContents(ostream &out) const
3636}
3737
3838const char *
39- ErrorDescriptor::severity (SCLstring &s) const
39+ ErrorDescriptor::severity (std::string &s) const
4040{
41- s.set_null ();
41+ s.clear ();
4242 switch (severity ())
4343 {
4444 case SEVERITY_NULL :
4545 {
46- s = " SEVERITY_NULL" ;
46+ s. assign ( " SEVERITY_NULL" ) ;
4747 break ;
4848 }
4949 case SEVERITY_USERMSG :
5050 {
51- s = " SEVERITY_USERMSG" ;
51+ s. assign ( " SEVERITY_USERMSG" ) ;
5252 break ;
5353 }
5454 case SEVERITY_INCOMPLETE :
5555 {
56- s = " SEVERITY_INCOMPLETE" ;
56+ s. assign ( " SEVERITY_INCOMPLETE" ) ;
5757 break ;
5858 }
5959 case SEVERITY_WARNING :
6060 {
61- s = " SEVERITY_WARNING" ;
61+ s. assign ( " SEVERITY_WARNING" ) ;
6262 break ;
6363 }
6464 case SEVERITY_INPUT_ERROR :
6565 {
66- s = " SEVERITY_INPUT_ERROR" ;
66+ s. assign ( " SEVERITY_INPUT_ERROR" ) ;
6767 break ;
6868 }
6969 case SEVERITY_BUG :
7070 {
71- s = " SEVERITY_BUG" ;
71+ s. assign ( " SEVERITY_BUG" ) ;
7272 break ;
7373 }
7474 case SEVERITY_EXIT :
7575 {
76- s = " SEVERITY_EXIT" ;
76+ s. assign ( " SEVERITY_EXIT" ) ;
7777 break ;
7878 }
7979 case SEVERITY_DUMP :
8080 {
81- s = " SEVERITY_DUMP" ;
81+ s. assign ( " SEVERITY_DUMP" ) ;
8282 break ;
8383 }
8484 case SEVERITY_MAX :
8585 {
86- s = " SEVERITY_MAX" ;
86+ s. assign ( " SEVERITY_MAX" ) ;
8787 break ;
8888 }
8989 }
90- return s.chars ();
90+ return s.c_str ();
9191}
9292
9393
@@ -177,7 +177,7 @@ const char *
177177ErrorDescriptor::UserMsg () const
178178{
179179 if (_userMsg)
180- return _userMsg->chars ();
180+ return _userMsg->c_str ();
181181 else
182182 return " " ;
183183}
@@ -186,60 +186,40 @@ void
186186ErrorDescriptor::UserMsg ( const char * msg)
187187{
188188 if (!_userMsg)
189- #ifdef __OSTORE__
190- _userMsg = new (os_database::of (this ),
191- SCLstring::get_os_typespec ()) SCLstring;
192- #else
193- _userMsg = new SCLstring;
194- #endif
195- *_userMsg = msg;
189+ _userMsg = new std::string;
190+ _userMsg->assign (msg);
196191}
197192
198193void
199194ErrorDescriptor::PrependToUserMsg ( const char * msg)
200195{
201196 if (!_userMsg)
202- #ifdef __OSTORE__
203- _userMsg = new (os_database::of (this ),
204- SCLstring::get_os_typespec ()) SCLstring;
205- #else
206- _userMsg = new SCLstring;
207- #endif
208- _userMsg -> Prepend (msg);
197+ _userMsg = new std::string;
198+ _userMsg->insert (0 , msg);
209199}
210200
211201void
212202ErrorDescriptor::AppendToUserMsg ( const char c)
213203{
214204 if (!_userMsg)
215- #ifdef __OSTORE__
216- _userMsg = new (os_database::of (this ),
217- SCLstring::get_os_typespec ()) SCLstring;
218- #else
219- _userMsg = new SCLstring;
220- #endif
221- _userMsg -> Append (c);
205+ _userMsg = new std::string;
206+ _userMsg->append (&c);
222207}
223208
224209void
225210ErrorDescriptor::AppendToUserMsg ( const char * msg)
226211{
227212 if (!_userMsg)
228- #ifdef __OSTORE__
229- _userMsg = new (os_database::of (this ),
230- SCLstring::get_os_typespec ()) SCLstring;
231- #else
232- _userMsg = new SCLstring;
233- #endif
234- _userMsg -> Append (msg);
213+ _userMsg = new std::string;
214+ _userMsg->append (msg);
235215}
236216
237217
238218const char *
239219ErrorDescriptor::DetailMsg () const
240220{
241221 if (_detailMsg)
242- return _detailMsg->chars ();
222+ return _detailMsg->c_str ();
243223 else
244224 return " " ;
245225}
@@ -248,51 +228,30 @@ void
248228ErrorDescriptor::DetailMsg ( const char * msg)
249229{
250230 if (!_detailMsg)
251- #ifdef __OSTORE__
252- _detailMsg = new (os_database::of (this ),
253- SCLstring::get_os_typespec ()) SCLstring;
254- #else
255- _detailMsg = new SCLstring;
256- #endif
257- *_detailMsg = msg;
258- // cerr << "D " << _detailMsg->chars() << '\n';
231+ _detailMsg = new std::string;
232+ _detailMsg->assign (msg);
259233}
260234
261235void
262236ErrorDescriptor::PrependToDetailMsg (const char * msg)
263237{
264238 if (!_detailMsg)
265- #ifdef __OSTORE__
266- _detailMsg = new (os_database::of (this ),
267- SCLstring::get_os_typespec ()) SCLstring;
268- #else
269- _detailMsg = new SCLstring;
270- #endif
271- _detailMsg -> Prepend (msg);
239+ _detailMsg = new std::string;
240+ _detailMsg->insert (0 , msg);
272241}
273242
274243void
275244ErrorDescriptor::AppendToDetailMsg ( const char c)
276245{
277246 if (!_detailMsg)
278- #ifdef __OSTORE__
279- _detailMsg = new (os_database::of (this ),
280- SCLstring::get_os_typespec ()) SCLstring;
281- #else
282- _detailMsg = new SCLstring;
283- #endif
284- _detailMsg -> Append (c);
247+ _detailMsg = new std::string;
248+ _detailMsg->append (&c);
285249}
286250
287251void
288252ErrorDescriptor::AppendToDetailMsg (const char * msg)
289253{
290254 if (!_detailMsg)
291- #ifdef __OSTORE__
292- _detailMsg = new (os_database::of (this ),
293- SCLstring::get_os_typespec ()) SCLstring;
294- #else
295- _detailMsg = new SCLstring;
296- #endif
297- _detailMsg -> Append (msg);
255+ _detailMsg = new std::string;
256+ _detailMsg->append (msg);
298257}
0 commit comments