// separate from the main geometric and semantic data
// #########################################################################
// .... Creation and basic access to atomic file data ....
-typedef TCollection_HAsciiString String;
-static char txtmes[200]; // more convenient than redeclaring everywhere
-static Standard_Boolean initstr = Standard_False;
#define Maxlst 64
-// static TCollection_AsciiString subl[Maxlst]; // Maxlst : minimum 10
-static Standard_Integer acceptvoid = 0;
+static const Standard_Integer acceptvoid = 0;
// ---------- Fonctions Utilitaires ----------
thenbhead = nbheader;
// themults.Init(0);
thecheck = new Interface_Check;
- if (initstr)
- return;
- // for (Standard_Integer i = 0; i < Maxlst; i ++) {
- // Sprintf(textnum,"$%d",i+1);
- // subl[i].AssignCat(textnum);
- // }
- initstr = Standard_True;
}
//=================================================================================================
if (n == 0) /*stat =*/
NamedForComplex(name, num0, n, ach); // on a rembobine
// Not in alphabetical order: loop
- Handle(String) errmess = new String("Parameter n0.%d (%s) not a LIST");
- Sprintf(txtmes, errmess->ToCString(), num0, name);
+ char txtmes[200];
+ Standard_CString errmess = "Parameter n0.%d (%s) not a LIST";
+ Sprintf(txtmes, errmess, num0, name);
for (n = num0; n > 0; n = NextForComplex(n))
{
if (!strcmp(RecordType(n).ToCString(), name))
{
num = n;
- errmess = new String("Complex Record n0.%d, member type %s not in alphabetic order");
- Sprintf(txtmes, errmess->ToCString(), num0, name);
- ach->AddWarning(txtmes, errmess->ToCString());
+ errmess = "Complex Record n0.%d, member type %s not in alphabetic order";
+ Sprintf(txtmes, errmess, num0, name);
+ ach->AddWarning(txtmes, errmess);
return Standard_False;
}
}
num = 0;
- errmess = new String("Complex Record n0.%d, member type %s not found");
- Sprintf(txtmes, errmess->ToCString(), num0, name);
- ach->AddFail(txtmes, errmess->ToCString());
+ errmess = "Complex Record n0.%d, member type %s not found";
+ Sprintf(txtmes, errmess, num0, name);
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
}
// entities are not in alphabetical order
- Handle(String) errmess = new String("Parameter n0.%d (%s) not a LIST");
- Sprintf(txtmes, errmess->ToCString(), num0, theName);
+ char txtmes[200];
+ Standard_CString errmess = "Parameter n0.%d (%s) not a LIST";
+ Sprintf(txtmes, errmess, num0, theName);
for (n = num0; n > 0; n = NextForComplex(n))
{
if (!strcmp(RecordType(n).ToCString(), theName)
|| !strcmp(RecordType(n).ToCString(), theShortName))
{
num = n;
- errmess = new String("Complex Record n0.%d, member type %s not in alphabetic order");
- Sprintf(txtmes, errmess->ToCString(), num0, theName);
- ach->AddWarning(txtmes, errmess->ToCString());
+ errmess = "Complex Record n0.%d, member type %s not in alphabetic order";
+ Sprintf(txtmes, errmess, num0, theName);
+ ach->AddWarning(txtmes, errmess);
return Standard_False;
}
}
num = 0;
- errmess = new String("Complex Record n0.%d, member type %s not found");
- Sprintf(txtmes, errmess->ToCString(), num0, theName);
- ach->AddFail(txtmes, errmess->ToCString());
+ errmess = "Complex Record n0.%d, member type %s not found";
+ Sprintf(txtmes, errmess, num0, theName);
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
{
if (NbParams(num) == nbreq)
return Standard_True;
- Handle(String) errmess;
+ char txtmes[200];
+ Standard_CString errmess;
if (mess[0] == '\0')
- errmess = new String("Count of Parameters is not %d");
+ errmess = "Count of Parameters is not %d";
else
- errmess = new String("Count of Parameters is not %d for %s");
- Sprintf(txtmes, errmess->ToCString(), nbreq, mess);
- ach->AddFail(txtmes, errmess->ToCString());
+ errmess = "Count of Parameters is not %d for %s";
+ Sprintf(txtmes, errmess, nbreq, mess);
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
const Standard_Integer /* lenmin */,
const Standard_Integer /* lenmax */) const
{
+ char txtmes[200];
numsub = SubListNumber(num, nump, Standard_False);
if (numsub > 0)
{
const Standard_Integer aNbParams = NbParams(numsub);
if (aNbParams == 0)
{
- Handle(String) anErrMess = new String("Parameter n0.%d (%s) is an empty LIST");
- Sprintf(txtmes, anErrMess->ToCString(), nump, mess);
- ach->AddWarning(txtmes, anErrMess->ToCString());
+ Standard_CString anErrMess = "Parameter n0.%d (%s) is an empty LIST";
+ Sprintf(txtmes, anErrMess, nump, mess);
+ ach->AddWarning(txtmes, anErrMess);
}
return Standard_True;
}
if (isvoid && optional)
return Standard_False;
- Handle(String) errmess = new String("Parameter n0.%d (%s) not a LIST");
- Sprintf(txtmes, errmess->ToCString(), nump, mess);
+ Standard_CString errmess = "Parameter n0.%d (%s) not a LIST";
+ Sprintf(txtmes, errmess, nump, mess);
if (acceptvoid && isvoid)
- ach->AddWarning(txtmes, errmess->ToCString());
+ ach->AddWarning(txtmes, errmess);
else
{
- ach->AddFail(txtmes, errmess->ToCString());
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
return Standard_True;
if (v == val)
return res;
// changement -> refus
- Handle(String) errmess = new String("Parameter n0.%d (%s) : does not match SELECT clause");
- Sprintf(txtmes, errmess->ToCString(), nump, mess);
- ach->AddFail(txtmes, errmess->ToCString());
+ char txtmes[200];
+ Standard_CString errmess = "Parameter n0.%d (%s) : does not match SELECT clause";
+ Sprintf(txtmes, errmess, nump, mess);
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
const Handle(StepData_PDescr)& descr,
StepData_Field& fild) const
{
- const Interface_FileParameter& FP = Param(num, nump);
- Standard_CString str = FP.CValue();
- Standard_Boolean OK = Standard_True;
- Standard_Integer nent, kind;
- Handle(TCollection_HAsciiString) txt;
- Handle(Standard_Transient) sub;
- Interface_ParamType FT = FP.ParamType();
+ const Interface_FileParameter& FP = Param(num, nump);
+ Standard_CString str = FP.CValue();
+ Standard_Boolean OK = Standard_True;
+ Standard_Integer nent, kind;
+ Handle(Standard_Transient) sub;
+ Interface_ParamType FT = FP.ParamType();
switch (FT)
{
case Interface_ParamMisc:
break;
case Interface_ParamVoid:
break;
- case Interface_ParamText:
- txt = new TCollection_HAsciiString(str);
+ case Interface_ParamText: {
+ Handle(TCollection_HAsciiString) txt = new TCollection_HAsciiString(str);
cleanText(txt);
fild.Set(txt);
break;
+ }
case Interface_ParamEnum:
if (!strcmp(str, ".T."))
fild.SetLogical(StepData_LTrue);
Standard_Real& X,
Standard_Real& Y) const
{
- Handle(String) errmess; // Null if no error
- Standard_Integer numsub = SubListNumber(num, nump, Standard_False);
+ char txtmes[200];
+ Standard_CString errmess = nullptr; // Null if no error
+ Standard_Integer numsub = SubListNumber(num, nump, Standard_False);
if (numsub != 0)
{
if (NbParams(numsub) == 2)
if (FPX.ParamType() == Interface_ParamReal)
X = Interface_FileReaderData::Fastof(FPX.CValue());
else
- errmess = new String("Parameter n0.%d (%s) : (X,Y) X not a Real");
+ errmess = "Parameter n0.%d (%s) : (X,Y) X not a Real";
const Interface_FileParameter& FPY = Param(numsub, 2);
if (FPY.ParamType() == Interface_ParamReal)
Y = Interface_FileReaderData::Fastof(FPY.CValue());
else
- errmess = new String("Parameter n0.%d (%s) : (X,Y) Y not a Real");
+ errmess = "Parameter n0.%d (%s) : (X,Y) Y not a Real";
}
else
- errmess = new String("Parameter n0.%d (%s) : (X,Y) has not 2 params");
+ errmess = "Parameter n0.%d (%s) : (X,Y) has not 2 params";
}
else
- errmess = new String("Parameter n0.%d (%s) : (X,Y) not a SubList");
+ errmess = "Parameter n0.%d (%s) : (X,Y) not a SubList";
- if (errmess.IsNull())
+ if (errmess == nullptr)
return Standard_True;
- Sprintf(txtmes, errmess->ToCString(), nump, mess);
- ach->AddFail(txtmes, errmess->ToCString());
+
+ Sprintf(txtmes, errmess, nump, mess);
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
Standard_Real& Y,
Standard_Real& Z) const
{
- Handle(String) errmess; // Null if no error
- Standard_Integer numsub = SubListNumber(num, nump, Standard_False);
+ char txtmes[200];
+ Standard_CString errmess = nullptr; // Null if no error
+ Standard_Integer numsub = SubListNumber(num, nump, Standard_False);
if (numsub != 0)
{
if (NbParams(numsub) == 3)
if (FPX.ParamType() == Interface_ParamReal)
X = Interface_FileReaderData::Fastof(FPX.CValue());
else
- errmess = new String("Parameter n0.%d (%s) : (X,Y,Z) X not a Real");
+ errmess = "Parameter n0.%d (%s) : (X,Y,Z) X not a Real";
const Interface_FileParameter& FPY = Param(numsub, 2);
if (FPY.ParamType() == Interface_ParamReal)
Y = Interface_FileReaderData::Fastof(FPY.CValue());
else
- errmess = new String("Parameter n0.%d (%s) : (X,Y,Z) Y not a Real");
+ errmess = "Parameter n0.%d (%s) : (X,Y,Z) Y not a Real";
const Interface_FileParameter& FPZ = Param(numsub, 3);
if (FPZ.ParamType() == Interface_ParamReal)
Z = Interface_FileReaderData::Fastof(FPZ.CValue());
else
- errmess = new String("Parameter n0.%d (%s) : (X,Y,Z) Z not a Real");
+ errmess = "Parameter n0.%d (%s) : (X,Y,Z) Z not a Real";
}
else
- errmess = new String("Parameter n0.%d (%s) : (X,Y,Z) has not 3 params");
+ errmess = "Parameter n0.%d (%s) : (X,Y,Z) has not 3 params";
}
else
- errmess = new String("Parameter n0.%d (%s) : (X,Y,Z) not a SubList");
+ errmess = "Parameter n0.%d (%s) : (X,Y,Z) not a SubList";
- if (errmess.IsNull())
+ if (errmess == nullptr)
return Standard_True;
- Sprintf(txtmes, errmess->ToCString(), nump, mess);
- ach->AddFail(txtmes, errmess->ToCString());
+
+ Sprintf(txtmes, errmess, nump, mess);
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
Handle(Interface_Check)& ach,
Standard_Real& val) const
{
- Handle(String) errmess; // Null si pas d erreur
+ char txtmes[200];
+ Standard_CString errmess = nullptr; // Null si pas d erreur
if (nump > 0 && nump <= NbParams(num))
{
const Interface_FileParameter& FP = Param(num, nump);
if (FP.ParamType() == Interface_ParamReal || FP.ParamType() == Interface_ParamInteger)
val = Interface_FileReaderData::Fastof(FP.CValue());
else
- errmess = new String("Parameter n0.%d (%s) not a Real");
+ errmess = "Parameter n0.%d (%s) not a Real";
}
else
- errmess = new String("Parameter n0.%d (%s) absent");
+ errmess = "Parameter n0.%d (%s) absent";
- if (errmess.IsNull())
+ if (errmess == nullptr)
return Standard_True;
- Sprintf(txtmes, errmess->ToCString(), nump, mess);
- ach->AddFail(txtmes, errmess->ToCString());
+
+ Sprintf(txtmes, errmess, nump, mess);
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
const Handle(Standard_Type)& atype,
Handle(Standard_Transient)& ent) const
{
- Handle(String) errmess; // Null if no error
- Standard_Boolean warn = Standard_False;
+ char txtmes[200];
+ Standard_CString errmess = nullptr; // Null if no error
+ Standard_Boolean warn = Standard_False;
if (nump > 0 && nump <= NbParams(num))
{
const Interface_FileParameter& FP = Param(num, nump);
Handle(Standard_Transient) entent = BoundEntity(nent);
if (entent.IsNull() || !entent->IsKind(atype))
{
- errmess = new String("Parameter n0.%d (%s) : Entity has illegal type");
+ errmess = "Parameter n0.%d (%s) : Entity has illegal type";
if (!entent.IsNull() && entent->IsKind(STANDARD_TYPE(StepData_UndefinedEntity)))
ent = entent;
}
ent = entent;
}
else
- errmess = new String("Parameter n0.%d (%s) : Unresolved reference");
+ errmess = "Parameter n0.%d (%s) : Unresolved reference";
}
else
{
if (acceptvoid && FP.ParamType() == Interface_ParamVoid)
warn = Standard_True;
- errmess = new String("Parameter n0.%d (%s) not an Entity");
+ errmess = "Parameter n0.%d (%s) not an Entity";
}
}
else
{
warn = (acceptvoid > 0);
- errmess = new String("Parameter n0.%d (%s) absent");
+ errmess = "Parameter n0.%d (%s) absent";
}
- if (errmess.IsNull())
+ if (errmess == nullptr)
return Standard_True;
- Sprintf(txtmes, errmess->ToCString(), nump, mess);
+
+ Sprintf(txtmes, errmess, nump, mess);
if (warn)
- ach->AddWarning(txtmes, errmess->ToCString());
+ ach->AddWarning(txtmes, errmess);
else
- ach->AddFail(txtmes, errmess->ToCString());
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
Handle(Interface_Check)& ach,
StepData_SelectType& sel) const
{
- Handle(String) errmess; // Null if no error
- Standard_Boolean warn = Standard_False;
+ char txtmes[200];
+ Standard_CString errmess = nullptr; // Null if no error
+ Standard_Boolean warn = Standard_False;
if (nump > 0 && nump <= NbParams(num))
{
const Interface_FileParameter& FP = Param(num, nump);
Handle(Standard_Transient) entent = BoundEntity(nent);
if (!sel.Matches(entent))
{
- errmess = new String("Parameter n0.%d (%s) : Entity has illegal type");
+ errmess = "Parameter n0.%d (%s) : Entity has illegal type";
// fot not supported STEP entity
if (!entent.IsNull() && entent->IsKind(STANDARD_TYPE(StepData_UndefinedEntity)))
sel.SetValue(entent);
sel.SetValue(entent);
}
else
- errmess = new String("Parameter n0.%d (%s) : Unresolved reference");
+ errmess = "Parameter n0.%d (%s) : Unresolved reference";
}
else if (FP.ParamType() == Interface_ParamVoid)
{
if (acceptvoid)
warn = Standard_True;
- errmess = new String("Parameter n0.%d (%s) not an Entity");
+ errmess = "Parameter n0.%d (%s) not an Entity";
}
else
{
Handle(Standard_Transient) sm = sel.NewMember();
// SelectMember which performs this role. Can be specialized
if (!ReadAny(num, nump, mess, ach, sel.Description(), sm))
- errmess = new String("Parameter n0.%d (%s) : could not be read");
+ errmess = "Parameter n0.%d (%s) : could not be read";
if (!sel.Matches(sm))
- errmess = new String("Parameter n0.%d (%s) : illegal parameter type");
+ errmess = "Parameter n0.%d (%s) : illegal parameter type";
else
sel.SetValue(sm);
}
else
{
warn = (acceptvoid > 0);
- errmess = new String("Parameter n0.%d (%s) absent");
+ errmess = "Parameter n0.%d (%s) absent";
}
- if (errmess.IsNull())
+ if (errmess == nullptr)
return Standard_True;
- Sprintf(txtmes, errmess->ToCString(), nump, mess);
+
+ Sprintf(txtmes, errmess, nump, mess);
if (warn)
- ach->AddWarning(txtmes, errmess->ToCString());
+ ach->AddWarning(txtmes, errmess);
else
- ach->AddFail(txtmes, errmess->ToCString());
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
Handle(Interface_Check)& ach,
Standard_Integer& val) const
{
- Handle(String) errmess; // Null if no error
- Standard_Boolean warn = Standard_False;
+ char txtmes[200];
+ Standard_CString errmess = nullptr; // Null if no error
+ Standard_Boolean warn = Standard_False;
if (nump > 0 && nump <= NbParams(num))
{
const Interface_FileParameter& FP = Param(num, nump);
static_cast<Standard_Integer>(std::round(Interface_FileReaderData::Fastof(FP.CValue())));
if (acceptvoid)
warn = Standard_True;
- errmess = new String("Parameter n0.%d (%s) was rounded");
+ errmess = "Parameter n0.%d (%s) was rounded";
}
if (FP.ParamType() != Interface_ParamInteger && FP.ParamType() != Interface_ParamReal)
- errmess = new String("Parameter n0.%d (%s) not an Integer");
+ errmess = "Parameter n0.%d (%s) not an Integer";
}
else
- errmess = new String("Parameter n0.%d (%s) absent");
+ errmess = "Parameter n0.%d (%s) absent";
- if (errmess.IsNull())
+ if (errmess == nullptr)
return Standard_True;
- Sprintf(txtmes, errmess->ToCString(), nump, mess);
+
+ Sprintf(txtmes, errmess, nump, mess);
if (warn)
- ach->AddWarning(txtmes, errmess->ToCString());
+ ach->AddWarning(txtmes, errmess);
else
- ach->AddFail(txtmes, errmess->ToCString());
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
Handle(Interface_Check)& ach,
Standard_Boolean& flag) const
{
- flag = Standard_True;
- Handle(String) errmess; // Null si pas d erreur
+ char txtmes[200];
+ flag = Standard_True;
+ Standard_CString errmess = nullptr; // Null si pas d erreur
if (nump > 0 && nump <= NbParams(num))
{
const Interface_FileParameter& FP = Param(num, nump);
else if (!strcmp(txt, ".F."))
flag = Standard_False;
else
- errmess = new String("Parameter n0.%d (%s) : Incorrect Boolean Value. It was set to true");
+ errmess = "Parameter n0.%d (%s) : Incorrect Boolean Value. It was set to true";
}
else
- errmess = new String("Parameter n0.%d (%s) not a Boolean. It was set to true");
+ errmess = "Parameter n0.%d (%s) not a Boolean. It was set to true";
}
else
- errmess = new String("Parameter n0.%d (%s) absent.It was set to true");
+ errmess = "Parameter n0.%d (%s) absent.It was set to true";
- if (errmess.IsNull())
+ if (errmess == nullptr)
return Standard_True;
- Sprintf(txtmes, errmess->ToCString(), nump, mess);
- ach->AddFail(txtmes, errmess->ToCString());
+
+ Sprintf(txtmes, errmess, nump, mess);
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
Handle(Interface_Check)& ach,
StepData_Logical& flag) const
{
- Handle(String) errmess; // Null si pas d erreur
+ char txtmes[200];
+ Standard_CString errmess = nullptr; // Null si pas d erreur
if (nump > 0 && nump <= NbParams(num))
{
const Interface_FileParameter& FP = Param(num, nump);
else if (!strcmp(txt, ".U."))
flag = StepData_LUnknown;
else
- errmess = new String("Parameter n0.%d (%s) : Incorrect Logical Value");
+ errmess = "Parameter n0.%d (%s) : Incorrect Logical Value";
}
else
- errmess = new String("Parameter n0.%d (%s) not a Logical");
+ errmess = "Parameter n0.%d (%s) not a Logical";
}
else
- errmess = new String("Parameter n0.%d (%s) absent");
+ errmess = "Parameter n0.%d (%s) absent";
- if (errmess.IsNull())
+ if (errmess == nullptr)
return Standard_True;
- Sprintf(txtmes, errmess->ToCString(), nump, mess);
- ach->AddFail(txtmes, errmess->ToCString());
+
+ Sprintf(txtmes, errmess, nump, mess);
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
Handle(Interface_Check)& ach,
Handle(TCollection_HAsciiString)& val) const
{
- Handle(String) errmess; // Null if no error
- Standard_Boolean warn = Standard_False;
+ char txtmes[200];
+ Standard_CString errmess = nullptr; // Null if no error
+ Standard_Boolean warn = Standard_False;
if (nump > 0 && nump <= NbParams(num))
{
const Interface_FileParameter& FP = Param(num, nump);
{
/*Standard_CString anStr = FP.CValue();
if(strlen(anStr) < 3)
- val = new TCollection_HAsciiString("");
+ val = TCollection_AsciiString("");
else {
- val = new TCollection_HAsciiString(FP.CValue());
+ val = TCollection_AsciiString(FP.CValue());
CleanText (val);
}*/
val = new TCollection_HAsciiString(FP.CValue());
{
if (acceptvoid && FP.ParamType() == Interface_ParamVoid)
warn = Standard_True;
- errmess = new String("Parameter n0.%d (%s) not a quoted String");
+ errmess = "Parameter n0.%d (%s) not a quoted String";
}
}
else
- errmess = new String("Parameter n0.%d (%s) absent");
+ errmess = "Parameter n0.%d (%s) absent";
- if (errmess.IsNull())
+ if (errmess == nullptr)
return Standard_True;
- Sprintf(txtmes, errmess->ToCString(), nump, mess);
+
+ Sprintf(txtmes, errmess, nump, mess);
if (warn)
- ach->AddWarning(txtmes, errmess->ToCString());
+ ach->AddWarning(txtmes, errmess);
else
- ach->AddFail(txtmes, errmess->ToCString());
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
Handle(Interface_Check)& ach,
Standard_CString& text) const
{
- Handle(String) errmess; // Null if no error
- Standard_Boolean warn = Standard_False;
+ char txtmes[200];
+ Standard_CString errmess = nullptr; // Null if no error
+ Standard_Boolean warn = Standard_False;
if (nump > 0 && nump <= NbParams(num))
{
const Interface_FileParameter& FP = Param(num, nump);
}
else if (FP.ParamType() == Interface_ParamVoid)
{
- errmess = new String("Parameter n0.%d (%s) : Undefined Enumeration not allowed");
+ errmess = "Parameter n0.%d (%s) : Undefined Enumeration not allowed";
warn = (acceptvoid > 0);
}
else
- errmess = new String("Parameter n0.%d (%s) not an Enumeration");
+ errmess = "Parameter n0.%d (%s) not an Enumeration";
}
else
- errmess = new String("Parameter n0.%d (%s) absent");
+ errmess = "Parameter n0.%d (%s) absent";
- if (errmess.IsNull())
+ if (errmess == nullptr)
return Standard_True;
- Sprintf(txtmes, errmess->ToCString(), nump, mess);
+
+ Sprintf(txtmes, errmess, nump, mess);
if (warn)
- ach->AddWarning(txtmes, errmess->ToCString());
+ ach->AddWarning(txtmes, errmess);
else
- ach->AddFail(txtmes, errmess->ToCString());
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
const Standard_CString mess,
Handle(Interface_Check)& ach) const
{
- Handle(String) errmess = new String("Parameter n0.%d (%s) : Incorrect Enumeration Value");
- Sprintf(txtmes, errmess->ToCString(), nump, mess);
- ach->AddFail(txtmes, errmess->ToCString());
+ char txtmes[200];
+ Standard_CString errmess = "Parameter n0.%d (%s) : Incorrect Enumeration Value";
+ Sprintf(txtmes, errmess, nump, mess);
+ ach->AddFail(txtmes, errmess);
}
//=================================================================================================
Standard_Integer& val) const
{
// resume with ReadEnumParam?
- Handle(String) errmess; // Null if no error
- Standard_Boolean warn = Standard_False;
+ char txtmes[200];
+ Standard_CString errmess = nullptr; // Null if no error
+ Standard_Boolean warn = Standard_False;
if (nump > 0 && nump <= NbParams(num))
{
const Interface_FileParameter& FP = Param(num, nump);
if (val >= 0)
return Standard_True;
else
- errmess = new String("Parameter n0.%d (%s) : Incorrect Enumeration Value");
+ errmess = "Parameter n0.%d (%s) : Incorrect Enumeration Value";
warn = (acceptvoid > 0);
}
else if (FP.ParamType() == Interface_ParamVoid)
{
val = enumtool.NullValue();
if (val < 0)
- errmess = new String("Parameter n0.%d (%s) : Undefined Enumeration not allowed");
+ errmess = "Parameter n0.%d (%s) : Undefined Enumeration not allowed";
warn = (acceptvoid > 0);
}
else
- errmess = new String("Parameter n0.%d (%s) not an Enumeration");
+ errmess = "Parameter n0.%d (%s) not an Enumeration";
}
else
- errmess = new String("Parameter n0.%d (%s) absent");
+ errmess = "Parameter n0.%d (%s) absent";
- if (errmess.IsNull())
+ if (errmess == nullptr)
return Standard_True;
- Sprintf(txtmes, errmess->ToCString(), nump, mess);
+
+ Sprintf(txtmes, errmess, nump, mess);
if (warn)
- ach->AddWarning(txtmes, errmess->ToCString());
+ ach->AddWarning(txtmes, errmess);
else
- ach->AddFail(txtmes, errmess->ToCString());
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
Standard_Integer& numrp,
TCollection_AsciiString& typ) const
{
- Handle(String) errmess; // Null si pas d erreur
+ char txtmes[200];
+ Standard_CString errmess = nullptr; // Null si pas d erreur
if (nump > 0 && nump <= NbParams(num))
{
const Interface_FileParameter& FP = Param(num, nump);
typ.Clear();
if (mustbetyped)
{
- errmess = new String("Parameter n0.%d (%s) : single, not typed");
- Sprintf(txtmes, errmess->ToCString(), nump, mess);
- ach->AddFail(txtmes, errmess->ToCString());
+ errmess = "Parameter n0.%d (%s) : single, not typed";
+ Sprintf(txtmes, errmess, nump, mess);
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
return Standard_True;
numr = FP.EntityNumber();
numrp = 1;
if (NbParams(numr) != 1)
- errmess = new String("Parameter n0.%d (%s) : SubList, not typed");
+ errmess = "Parameter n0.%d (%s) : SubList, not typed";
typ = RecordType(numr);
}
else
- errmess = new String("Parameter n0.%d (%s) absent");
+ errmess = "Parameter n0.%d (%s) absent";
- if (errmess.IsNull())
+ if (errmess == nullptr)
return Standard_True;
- Sprintf(txtmes, errmess->ToCString(), nump, mess);
- ach->AddFail(txtmes, errmess->ToCString());
+ Sprintf(txtmes, errmess, nump, mess);
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}
Handle(Interface_Check)& ach,
const Standard_Boolean errstat) const
{
- Handle(String) errmess; // Null if no error
- Standard_Boolean warn = !errstat;
+ char txtmes[200];
+ Standard_CString errmess = nullptr; // Null if no error
+ Standard_Boolean warn = !errstat;
if (nump > 0 && nump <= NbParams(num))
{
if (!strcmp(Param(num, nump).CValue(), "*"))
return Standard_True;
else
- errmess = new String("Parameter n0.%d (%s) not Derived");
+ errmess = "Parameter n0.%d (%s) not Derived";
if (acceptvoid)
warn = Standard_True;
}
else
- errmess = new String("Parameter n0.%d (%s) absent");
+ errmess = "Parameter n0.%d (%s) absent";
- if (errmess.IsNull())
+ if (errmess == nullptr)
return Standard_True;
- Sprintf(txtmes, errmess->ToCString(), nump, mess);
+
+ Sprintf(txtmes, errmess, nump, mess);
if (warn)
- ach->AddWarning(txtmes, errmess->ToCString());
+ ach->AddWarning(txtmes, errmess);
else
- ach->AddFail(txtmes, errmess->ToCString());
+ ach->AddFail(txtmes, errmess);
return Standard_False;
}