Skip to content

Commit 2daddbe

Browse files
committed
Use sed to replace all chars() with c_str()
1 parent 1cd9335 commit 2daddbe

14 files changed

Lines changed: 38 additions & 38 deletions

File tree

src/cleditor/STEPfile.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ STEPfile::ReadData1(istream& in)
761761
tmpbuf.set_null();
762762
SkipInstance(in,tmpbuf);
763763
cout << "ERROR: trying to recover from invalid data. skipping: "
764-
<< tmpbuf.chars() << endl;
764+
<< tmpbuf.c_str() << endl;
765765
ReadTokenSeparator(in);
766766
}
767767

@@ -842,7 +842,7 @@ STEPfile::ReadData1(istream& in)
842842
tmpbuf.set_null();
843843
SkipInstance(in,tmpbuf);
844844
cout << "ERROR: trying to recover from invalid data. skipping: "
845-
<< tmpbuf.chars() << endl;
845+
<< tmpbuf.c_str() << endl;
846846
ReadTokenSeparator(in);
847847
}
848848
if( c == ENTITY_NAME_DELIM )
@@ -1284,7 +1284,7 @@ STEPfile::ReadData2 (istream& in)
12841284
tmpbuf.set_null();
12851285
SkipInstance(in,tmpbuf);
12861286
cout << "ERROR: trying to recover from invalid data. skipping: "
1287-
<< tmpbuf.chars() << endl;
1287+
<< tmpbuf.c_str() << endl;
12881288
ReadTokenSeparator(in);
12891289
}
12901290

@@ -2007,7 +2007,7 @@ ReadEntityError(char c, int i, istream& in)
20072007
STEPwrite (tmp); // STEPwrite writes to a static buffer inside function
20082008
sprintf(errStr,
20092009
" The invalid instance to this point looks like :\n%s\n",
2010-
tmp.chars() );
2010+
tmp.c_str() );
20112011
_error.AppendToDetailMsg(errStr);
20122012

20132013
_error.AppendToDetailMsg(" data lost looking for end of entity:");
@@ -2043,7 +2043,7 @@ ReadEntityError(char c, int i, istream& in)
20432043
}
20442044
}
20452045
}
2046-
_error.AppendToDetailMsg( tmp.chars() );
2046+
_error.AppendToDetailMsg( tmp.c_str() );
20472047
sprintf (errStr, "\nfinished reading #%d\n", STEPfile_id);
20482048
_error.AppendToDetailMsg(errStr);
20492049
return;

src/cleditor/STEPfile.inline.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ char *STEPfile::schemaName( char *schName )
351351
if ( n == NULL ) return NULL;
352352
n->STEPwrite(tmp);
353353
if ( *tmp.c_str() == '\0' || *tmp.c_str() == '$' ) return NULL;
354-
// tmp.chars() returns the string we want plus a beginning and ending
354+
// tmp.c_str() returns the string we want plus a beginning and ending
355355
// quote mark ('). We remove these below.
356356
strncpy( schName, tmp.c_str()+1, BUFSIZ-1 );
357357
// "+1" to remove beginning '.

src/clstepcore/ExpDict.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ Schema::GenerateUseRefExpress(ostream& out) const
522522
if(count > 0)
523523
{
524524

525-
// out << " REFERENCE FROM " << (*(is->explicit_items_()))[0]->foreign_schema_().chars() << endl;
525+
// out << " REFERENCE FROM " << (*(is->explicit_items_()))[0]->foreign_schema_().c_str() << endl;
526526
out << endl << " REFERENCE FROM "
527527
<< StrToLower(is->foreign_schema_id_().c_str(),tmp) << endl;
528528
out << " (";

src/clstepcore/STEPaggregate.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ STEPaggregate::ReadValue(istream &in, ErrorDescriptor *err,
206206
}
207207
// BUG could overwrite the error message buffer
208208
sprintf(errmsg, "ERROR aggr. elem. followed by \'%s\' garbage.\n",
209-
tmp.chars());
209+
tmp.c_str());
210210
err->AppendToDetailMsg(errmsg);
211211
err->AppendToUserMsg(errmsg);
212212
err->GreaterSeverity(SEVERITY_WARNING);
@@ -663,7 +663,7 @@ EntityAggregate::ReadValue(istream &in, ErrorDescriptor *err,
663663
}
664664
// BUG could overwrite the error message buffer
665665
sprintf(errmsg, "ERROR aggr. elem. followed by \'%s\' garbage.\n",
666-
tmp.chars());
666+
tmp.c_str());
667667
err->AppendToDetailMsg(errmsg);
668668
err->AppendToUserMsg(errmsg);
669669
err->GreaterSeverity(SEVERITY_WARNING);

src/clstepcore/STEPattribute.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ STEPattribute::asStr (std::string& str, const char *currSch) const
466466
// see technical corrigendum for Part 21
467467
if (!writeRedefined && (aDesc->AttrType() == AttrType_Redefining) ) {
468468
str = "*";
469-
return str.chars();
469+
return str.c_str();
470470
}
471471
*/
472472
// The attribute has been redefined by the attribute pointed
@@ -498,14 +498,14 @@ STEPattribute::asStr (std::string& str, const char *currSch) const
498498
else
499499
{
500500
(*(ptr.c))->STEPwrite_reference (str);
501-
// strncpy(attrVal, str.chars(), str.Length()+1);
501+
// strncpy(attrVal, str.c_str(), str.Length()+1);
502502
}
503503
break;
504504

505505
case BINARY_TYPE:
506506
if( !( (ptr.b)->empty() ) )
507507
(ptr.b) -> STEPwrite (str);
508-
// strncpy(attrVal, str.chars(), str.Length()+1);
508+
// strncpy(attrVal, str.c_str(), str.Length()+1);
509509
break;
510510

511511
case STRING_TYPE:
@@ -529,7 +529,7 @@ STEPattribute::asStr (std::string& str, const char *currSch) const
529529
case SELECT_TYPE:
530530
ptr.sh -> STEPwrite ( str, currSch );
531531
return const_cast<char *>(str.c_str());
532-
// strncpy (attrVal, tmp.chars(), BUFSIZ);
532+
// strncpy (attrVal, tmp.c_str(), BUFSIZ);
533533

534534
case REFERENCE_TYPE:
535535
case GENERIC_TYPE:

src/clstepcore/STEPcomplex.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,8 @@ STEPcomplex::STEPread(int id, int addFileId, class InstMgr * instance_set,
415415
else // c == '('
416416
in.putback(c);
417417

418-
cout << s.chars() << endl;
419-
BuildAttrs( s.chars() );
418+
cout << s.c_str() << endl;
419+
BuildAttrs( s.c_str() );
420420
SCLP23(Application_instance)::STEPread(id, addFileId, instance_set,
421421
in, currSch);
422422

@@ -447,11 +447,11 @@ STEPcomplex::STEPread(int id, int addFileId, class InstMgr * instance_set,
447447
else // c == '('
448448
in.putback(c);
449449

450-
cout << s.chars() << endl; // diagnostics DAS
450+
cout << s.c_str() << endl; // diagnostics DAS
451451

452452
STEPcomplex *stepc = new STEPcomplex( _registry );
453453
AppendEntity(stepc);
454-
stepc->BuildAttrs( s.chars() );
454+
stepc->BuildAttrs( s.c_str() );
455455
stepc->SCLP23(Application_instance)::STEPread(id, addFileId,
456456
instance_set, in,
457457
currSch);

src/clstepcore/Select.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Select {
1010
virtual ~Select();
1111

1212
virtual char * Underlying_typeName const
13-
{ return _underlying_typename.chars(); }
13+
{ return _underlying_typename.c_str(); }
1414

1515
// const Named_type_ptr Underlying_type() const;
1616

src/clstepcore/read_func.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ WriteReal(SCLP23(Real) val, ostream &out)
256256
else
257257
s = rbuf;
258258

259-
out << (char *)(s.chars());
259+
out << (char *)(s.c_str());
260260
#endif
261261
}
262262

@@ -787,7 +787,7 @@ FindStartOfInstance(istream& in, std::string& inst)
787787
inst.append (tmp);
788788

789789
// PushPastString(in, tmp, &errs);
790-
// inst.Append( tmp->chars() );
790+
// inst.Append( tmp->c_str() );
791791
break;
792792

793793
case '\0': // problem in input ?
@@ -826,7 +826,7 @@ SkipInstance (istream& in, std::string& inst)
826826
inst.append (tmp);
827827

828828
// PushPastString(in, tmp, &errs);
829-
// inst.Append( tmp->chars() );
829+
// inst.Append( tmp->c_str() );
830830
break;
831831

832832
case '\0': // problem in input ?

src/clstepcore/sdaiApplication_instance.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ SCLP23(Application_instance)::STEPread_error(char c, int i, istream& in)
606606
}
607607
}
608608
}
609-
_error.AppendToDetailMsg( tmp.chars() );
609+
_error.AppendToDetailMsg( tmp.c_str() );
610610
#endif
611611
sprintf (errStr, "\nfinished reading #%d\n", STEPfile_id);
612612
_error.AppendToDetailMsg(errStr);

src/clstepcore/sdaiEnum.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ SCLP23(Enum)::asStr (std::string &s) const {
712712
{
713713
// s = elements[v];
714714
return const_cast<char *>((s = element_at (v)).c_str());
715-
// return s.chars();
715+
// return s.c_str();
716716
}
717717
else return "";
718718
}

0 commit comments

Comments
 (0)