Skip to content

Commit 6c96daa

Browse files
committed
remove remainder of SCLstring uses
1 parent 8176031 commit 6c96daa

File tree

5 files changed

+36
-94
lines changed

5 files changed

+36
-94
lines changed

src/clstepcore/STEPcomplex.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -733,9 +733,6 @@ STEPcomplex::Replicate()
733733
{
734734
int nameCount = 64;
735735

736-
// Don't use this syntax it makes the sun compiler think it is a cast. DAS
737-
// SCLstring **nameList = new (SCLstring *)[nameCount];
738-
739736
std::string **nameList = new std::string *[nameCount];
740737
STEPcomplex *scomp = this->head;
741738
int i = 0;

src/clstepcore/sdaiApplication_instance.cc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,7 @@ void SCLP23(Application_instance)::AddP21Comment(const char *s, int replace)
124124
{
125125
if(!p21Comment)
126126
{
127-
#ifdef __OSTORE__
128-
p21Comment = new (os_segment::of(this), SCLstring::get_os_typespec())
129-
SCLstring;
130-
#else
131127
p21Comment = new std::string;
132-
#endif
133128
}
134129
else
135130
{
@@ -151,13 +146,7 @@ SCLP23(Application_instance)::AddP21Comment(std::string &s, int replace)
151146
{
152147
if(!p21Comment)
153148
{
154-
#ifdef __OSTORE__
155-
p21Comment = new (os_segment::of(this),
156-
SCLstring::get_os_typespec())
157-
SCLstring;
158-
#else
159149
p21Comment = new std::string;
160-
#endif
161150
}
162151
else
163152
p21Comment->clear();

src/clstepcore/sdaiBinary.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ class SCLP23_NAME(Binary) : public std::string
4545
: std::string (str,max) { }
4646

4747
//Josh L, 3/28/95
48-
// SCLP23_NAME(Binary) (SCLstring& s) : SCLstring (s) { }
49-
// SCLP23_NAME(Binary) (SCLP23_NAME(Binary)& s) : SCLstring (s) { }
5048
SCLP23_NAME(Binary) (const std::string& s) : std::string (s) { }
5149

5250

src/clutils/errordesc.cc

Lines changed: 31 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ostream * ErrorDescriptor::_out = 0;
2121
void
2222
ErrorDescriptor::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

3838
const 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 *
177177
ErrorDescriptor::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
186186
ErrorDescriptor::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

198193
void
199194
ErrorDescriptor::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

211201
void
212202
ErrorDescriptor::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

224209
void
225210
ErrorDescriptor::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

238218
const char *
239219
ErrorDescriptor::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
248228
ErrorDescriptor::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

261235
void
262236
ErrorDescriptor::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

274243
void
275244
ErrorDescriptor::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

287251
void
288252
ErrorDescriptor::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
}

src/clutils/errordesc.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ enum DebugLevel {
6464
** the error is a detailed error message + a severity level
6565
** also keeps a user message separately
6666
** detailed message gets sent to ostream
67-
** uses SCLstring class to keep the user messages
67+
** uses std::string class to keep the user messages
6868
** keeps severity of error
6969
** created with or without error
7070
** Status:
@@ -79,8 +79,8 @@ class ErrorDescriptor {
7979
static DebugLevel _debug_level;
8080
static ostream* _out; // note this will not be persistent
8181

82-
SCLstring *_userMsg;
83-
SCLstring *_detailMsg;
82+
std::string *_userMsg;
83+
std::string *_detailMsg;
8484
public:
8585

8686
ErrorDescriptor (Severity s = SEVERITY_NULL,
@@ -97,8 +97,8 @@ class ErrorDescriptor {
9797

9898
// return the enum value of _severity
9999
Severity severity() const { return _severity; }
100-
// return _severity as a const char * in the SCLstring provided
101-
const char * severity(SCLstring &s) const;
100+
// return _severity as a const char * in the std::string provided
101+
const char * severity(std::string &s) const;
102102
Severity severity(Severity s) { return (_severity = s); }
103103
Severity GetCorrSeverity(const char *s);
104104
Severity GreaterSeverity(Severity s)
@@ -132,7 +132,6 @@ class ErrorDescriptor {
132132
static os_typespec* get_os_typespec();
133133
#endif
134134

135-
// void operator = (const char* y) { SCLstring::operator = (y); }
136135

137136
/*
138137
// Enforcement _enforcement_level;

0 commit comments

Comments
 (0)