SALOMEDS::Locker lock;
SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
- if (strlen(theContext) == 0 && !_impl->HasCurrentContext()) throw SALOMEDS::Study::StudyInvalidContext();
- Handle(TColStd_HSequenceOfAsciiString) aSeq = _impl->GetObjectNames(TCollection_AsciiString((char*)theContext));
+
+ if (strlen(theContext) == 0 && !_impl->HasCurrentContext())
+ throw SALOMEDS::Study::StudyInvalidContext();
+
+ Handle(TColStd_HSequenceOfAsciiString) aSeq =
+ _impl->GetObjectNames(TCollection_AsciiString((char*)theContext));
+ if (_impl->GetErrorCode() == "InvalidContext")
+ throw SALOMEDS::Study::StudyInvalidContext();
+
int aLength = aSeq->Length();
aResult->length(aLength);
- for(int anIndex = 1; anIndex <= aLength; anIndex++) {
+ for (int anIndex = 1; anIndex <= aLength; anIndex++) {
aResult[anIndex-1] = CORBA::string_dup(TCollection_AsciiString(aSeq->Value(anIndex)).ToCString());
}
+
return aResult._retn();
}
SALOMEDS::Locker lock;
SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
- if (strlen(theContext) == 0 && !_impl->HasCurrentContext()) throw SALOMEDS::Study::StudyInvalidContext();
- Handle(TColStd_HSequenceOfAsciiString) aSeq = _impl->GetDirectoryNames(TCollection_AsciiString((char*)theContext));
+
+ if (strlen(theContext) == 0 && !_impl->HasCurrentContext())
+ throw SALOMEDS::Study::StudyInvalidContext();
+
+ Handle(TColStd_HSequenceOfAsciiString) aSeq =
+ _impl->GetDirectoryNames(TCollection_AsciiString((char*)theContext));
+ if (_impl->GetErrorCode() == "InvalidContext")
+ throw SALOMEDS::Study::StudyInvalidContext();
+
int aLength = aSeq->Length();
aResult->length(aLength);
- for(int anIndex = 1; anIndex <= aLength; anIndex++) {
+ for (int anIndex = 1; anIndex <= aLength; anIndex++) {
aResult[anIndex-1] = CORBA::string_dup(TCollection_AsciiString(aSeq->Value(anIndex)).ToCString());
}
+
return aResult._retn();
}
SALOMEDS::Locker lock;
SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
- if (strlen(theContext) == 0 && !_impl->HasCurrentContext()) throw SALOMEDS::Study::StudyInvalidContext();
- Handle(TColStd_HSequenceOfAsciiString) aSeq = _impl->GetFileNames(TCollection_AsciiString((char*)theContext));
+
+ if (strlen(theContext) == 0 && !_impl->HasCurrentContext())
+ throw SALOMEDS::Study::StudyInvalidContext();
+
+ Handle(TColStd_HSequenceOfAsciiString) aSeq =
+ _impl->GetFileNames(TCollection_AsciiString((char*)theContext));
+ if (_impl->GetErrorCode() == "InvalidContext")
+ throw SALOMEDS::Study::StudyInvalidContext();
+
int aLength = aSeq->Length();
aResult->length(aLength);
- for(int anIndex = 1; anIndex <= aLength; anIndex++) {
+ for (int anIndex = 1; anIndex <= aLength; anIndex++) {
aResult[anIndex-1] = CORBA::string_dup(TCollection_AsciiString(aSeq->Value(anIndex)).ToCString());
}
+
return aResult._retn();
}
SALOMEDS::Locker lock;
SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
- if (strlen(theContext) == 0 && !_impl->HasCurrentContext()) throw SALOMEDS::Study::StudyInvalidContext();
- Handle(TColStd_HSequenceOfAsciiString) aSeq = _impl->GetComponentNames(TCollection_AsciiString((char*)theContext));
+
+ if (strlen(theContext) == 0 && !_impl->HasCurrentContext())
+ throw SALOMEDS::Study::StudyInvalidContext();
+
+ Handle(TColStd_HSequenceOfAsciiString) aSeq =
+ _impl->GetComponentNames(TCollection_AsciiString((char*)theContext));
+
int aLength = aSeq->Length();
aResult->length(aLength);
for(int anIndex = 1; anIndex <= aLength; anIndex++) {
aResult[anIndex-1] = CORBA::string_dup(TCollection_AsciiString(aSeq->Value(anIndex)).ToCString());
}
+
return aResult._retn();
}
Handle(TColStd_HSequenceOfAsciiString) aResultSeq = new TColStd_HSequenceOfAsciiString;
TDF_Label aLabel;
if (theContext.IsEmpty()) {
- if(_current.IsNull()) {
- _errorCode = "InvalidContext";
- return aResultSeq;
- }
aLabel = _current;
} else {
TDF_Label aTmp = _current;
aLabel = _current;
_current = aTmp;
}
- TDF_ChildIterator anIter(aLabel, Standard_False); // iterate all subchildren at all sublevels
- for(; anIter.More(); anIter.Next()) {
+ if (aLabel.IsNull()) {
+ _errorCode = "InvalidContext";
+ return aResultSeq;
+ }
+
+ TDF_ChildIterator anIter (aLabel, Standard_False); // iterate all subchildren at all sublevels
+ for (; anIter.More(); anIter.Next()) {
TDF_Label aLabel = anIter.Value();
Handle(SALOMEDSImpl_AttributeName) aName;
if (aLabel.FindAttribute(SALOMEDSImpl_AttributeName::GetID(), aName)) aResultSeq->Append(aName->Value());
Handle(TColStd_HSequenceOfAsciiString) aResultSeq = new TColStd_HSequenceOfAsciiString;
TDF_Label aLabel;
if (theContext.IsEmpty()) {
- if(_current.IsNull()) {
- _errorCode = "InvalidContext";
- return aResultSeq;
- }
aLabel = _current;
} else {
TDF_Label aTmp = _current;
aLabel = _current;
_current = aTmp;
}
- TDF_ChildIterator anIter(aLabel, Standard_False); // iterate first-level children at all sublevels
- for(; anIter.More(); anIter.Next()) {
+ if (aLabel.IsNull()) {
+ _errorCode = "InvalidContext";
+ return aResultSeq;
+ }
+
+ TDF_ChildIterator anIter (aLabel, Standard_False); // iterate first-level children at all sublevels
+ for (; anIter.More(); anIter.Next()) {
TDF_Label aLabel = anIter.Value();
Handle(SALOMEDSImpl_AttributeLocalID) anID;
if (aLabel.FindAttribute(SALOMEDSImpl_AttributeLocalID::GetID(), anID)) {
Handle(TColStd_HSequenceOfAsciiString) aResultSeq = new TColStd_HSequenceOfAsciiString;
TDF_Label aLabel;
if (theContext.IsEmpty()) {
- if(_current.IsNull()) {
- _errorCode = "InvalidContext";
- return aResultSeq;
- }
aLabel = _current;
} else {
TDF_Label aTmp = _current;
aLabel = _current;
_current = aTmp;
}
- TDF_ChildIterator anIter(aLabel, Standard_False); // iterate all subchildren at all sublevels
- for(; anIter.More(); anIter.Next()) {
+ if (aLabel.IsNull()) {
+ _errorCode = "InvalidContext";
+ return aResultSeq;
+ }
+
+ TDF_ChildIterator anIter (aLabel, Standard_False); // iterate all subchildren at all sublevels
+ for (; anIter.More(); anIter.Next()) {
TDF_Label aLabel = anIter.Value();
Handle(SALOMEDSImpl_AttributeLocalID) anID;
if (aLabel.FindAttribute(SALOMEDSImpl_AttributeLocalID::GetID(), anID)) {
if (anID->Value() == FILELOCALID) {
Handle(SALOMEDSImpl_AttributePersistentRef) aName;
- if(aLabel.FindAttribute(SALOMEDSImpl_AttributePersistentRef::GetID(), aName)) {
+ if (aLabel.FindAttribute(SALOMEDSImpl_AttributePersistentRef::GetID(), aName)) {
TCollection_ExtendedString aFileName = aName->Value();
- if(aFileName.Length() > 0)
+ if (aFileName.Length() > 0)
aResultSeq->Append(aFileName.Split(strlen(FILEID)));
}
}