X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fengine%2FTypeCode.cxx;h=f7c4774474b2a1a5575d51a67074d753ee8306ef;hb=0243f55b2c630fdc91ff284499c33337d3630afe;hp=3000150b3ab9d83d745e7f7e84484c5d9f253135;hpb=88c5f67088445931a1598331e1faae6df0145c0b;p=modules%2Fyacs.git diff --git a/src/engine/TypeCode.cxx b/src/engine/TypeCode.cxx index 3000150b3..f7c477447 100644 --- a/src/engine/TypeCode.cxx +++ b/src/engine/TypeCode.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2006-2014 CEA/DEN, EDF R&D +// Copyright (C) 2006-2016 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -139,6 +139,11 @@ int TypeCode::isAdaptable(const TypeCode* tc) const } } +std::string TypeCode::getPrintStr() const +{ + return id(); +} + //! Check if this TypeCode can be used in place of tc /*! * this TypeCode is equivalent to tc if they have the same kind @@ -200,6 +205,23 @@ const char *TypeCode::getKindRepr(DynType kind) return KIND_STR_REPR[(int)kind]; } +const TypeCode *TypeCode::subContentType(int lev) const +{ + if(lev<0) + throw YACS::Exception("subContentType: Invalid input val !"); + if(lev==0) + return this; + const TypeCode *ret(this); + for(int i=0;icontentType()); + if(!cand) + throw YACS::Exception("subContentType : Invalid input val 2 !"); + ret=cand; + } + return ret; +} + const char * TypeCode::getKindRepr() const { return KIND_STR_REPR[(int)_kind]; @@ -447,6 +469,12 @@ const char * TypeCodeSeq::shortName() const return _shortName.c_str(); } +std::string TypeCodeSeq::getPrintStr() const +{ + std::ostringstream oss; oss << "seq[" << contentType()->getPrintStr() << "]"; + return oss.str(); +} + const TypeCode * TypeCodeSeq::contentType() const throw(YACS::Exception) { return _content;