X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingMemArray.cxx;h=0d5d059a04685eb0884cd269f8348c7107558110;hb=0c9d48870957c4a9f6f82fc8e2c569780a5f886b;hp=ff071afa6900e094d3a01acf462312d08df7ede6;hpb=6ff6047d97540bac9220e7eba6c221eb9a7a5579;p=modules%2Fmed.git diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index ff071afa6..0d5d059a0 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -130,7 +130,7 @@ std::vector DataArray::getDirectChildren() const * See \ref MEDCouplingArrayBasicsName "DataArrays infos" for more information. * \param [in] name - new array name */ -void DataArray::setName(const char *name) +void DataArray::setName(const std::string& name) { _name=name; } @@ -164,7 +164,7 @@ void DataArray::copyPartOfStringInfoFrom(const DataArray& other, const std::vect throw INTERP_KERNEL::Exception(oss.str().c_str()); } for(std::size_t i=0;i& compoIds, const DataArray& other) @@ -180,7 +180,7 @@ void DataArray::copyPartOfStringInfoFrom2(const std::vector& compoIds, cons throw INTERP_KERNEL::Exception(oss.str().c_str()); } for(std::size_t i=0;i& arrs) * \param [in] info - the string containing the information. * \throw If \a i is not a valid component index. */ -void DataArray::setInfoOnComponent(int i, const char *info) +void DataArray::setInfoOnComponent(int i, const std::string& info) { if(i<(int)_info_on_compo.size() && i>=0) _info_on_compo[i]=info; @@ -516,7 +516,7 @@ void DataArray::setInfoAndChangeNbOfCompo(const std::vector& info) _info_on_compo=info; } -void DataArray::checkNbOfTuples(int nbOfTuples, const char *msg) const +void DataArray::checkNbOfTuples(int nbOfTuples, const std::string& msg) const { if(getNumberOfTuples()!=nbOfTuples) { @@ -525,7 +525,7 @@ void DataArray::checkNbOfTuples(int nbOfTuples, const char *msg) const } } -void DataArray::checkNbOfComps(int nbOfCompo, const char *msg) const +void DataArray::checkNbOfComps(int nbOfCompo, const std::string& msg) const { if(getNumberOfComponents()!=nbOfCompo) { @@ -534,7 +534,7 @@ void DataArray::checkNbOfComps(int nbOfCompo, const char *msg) const } } -void DataArray::checkNbOfElems(std::size_t nbOfElems, const char *msg) const +void DataArray::checkNbOfElems(std::size_t nbOfElems, const std::string& msg) const { if(getNbOfElems()!=nbOfElems) { @@ -543,7 +543,7 @@ void DataArray::checkNbOfElems(std::size_t nbOfElems, const char *msg) const } } -void DataArray::checkNbOfTuplesAndComp(const DataArray& other, const char *msg) const +void DataArray::checkNbOfTuplesAndComp(const DataArray& other, const std::string& msg) const { if(getNumberOfTuples()!=other.getNumberOfTuples()) { @@ -557,7 +557,7 @@ void DataArray::checkNbOfTuplesAndComp(const DataArray& other, const char *msg) } } -void DataArray::checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const char *msg) const +void DataArray::checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const std::string& msg) const { checkNbOfTuples(nbOfTuples,msg); checkNbOfComps(nbOfCompo,msg); @@ -566,7 +566,7 @@ void DataArray::checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const char /*! * Simply this method checks that \b value is in [0,\b ref). */ -void DataArray::CheckValueInRange(int ref, int value, const char *msg) +void DataArray::CheckValueInRange(int ref, int value, const std::string& msg) { if(value<0 || value>=ref) { @@ -579,7 +579,7 @@ void DataArray::CheckValueInRange(int ref, int value, const char *msg) * This method checks that [\b start, \b end) is compliant with ref length \b value. * typicaly start in [0,\b value) and end in [0,\b value). If value==start and start==end, it is supported. */ -void DataArray::CheckValueInRangeEx(int value, int start, int end, const char *msg) +void DataArray::CheckValueInRangeEx(int value, int start, int end, const std::string& msg) { if(start<0 || start>=value) { @@ -596,7 +596,7 @@ void DataArray::CheckValueInRangeEx(int value, int start, int end, const char *m } } -void DataArray::CheckClosingParInRange(int ref, int value, const char *msg) +void DataArray::CheckClosingParInRange(int ref, int value, const std::string& msg) { if(value<0 || value>ref) { @@ -644,7 +644,7 @@ void DataArray::GetSlice(int start, int stop, int step, int sliceId, int nbOfSli stopSlice=stop; } -int DataArray::GetNumberOfItemGivenBES(int begin, int end, int step, const char *msg) +int DataArray::GetNumberOfItemGivenBES(int begin, int end, int step, const std::string& msg) { if(endsetName(getName().c_str()); + ret->setName(getName()); for(int i=0;isetInfoOnComponent(i,getInfoOnComponent(i).c_str()); - ret->setName(getName().c_str()); + ret->setInfoOnComponent(i,getInfoOnComponent(i)); + ret->setName(getName()); return ret.retn(); } @@ -3536,7 +3536,7 @@ DataArrayDouble *DataArrayDouble::fromCylToCart() const w[1]=wIn[0]*sin(wIn[1]); w[2]=wIn[2]; } - ret->setInfoOnComponent(2,getInfoOnComponent(2).c_str()); + ret->setInfoOnComponent(2,getInfoOnComponent(2)); return ret; } @@ -4276,7 +4276,7 @@ DataArrayDouble *DataArrayDouble::applyFunc(int nbOfComp, FunctionToEvaluate fun * \throw If \a this is not allocated. * \throw If computing \a func fails. */ -DataArrayDouble *DataArrayDouble::applyFunc(int nbOfComp, const char *func) const +DataArrayDouble *DataArrayDouble::applyFunc(int nbOfComp, const std::string& func) const { checkAllocated(); INTERP_KERNEL::ExprParser expr(func); @@ -4330,7 +4330,7 @@ DataArrayDouble *DataArrayDouble::applyFunc(int nbOfComp, const char *func) cons * \throw If \a this is not allocated. * \throw If computing \a func fails. */ -DataArrayDouble *DataArrayDouble::applyFunc(const char *func) const +DataArrayDouble *DataArrayDouble::applyFunc(const std::string& func) const { checkAllocated(); INTERP_KERNEL::ExprParser expr(func); @@ -4376,7 +4376,7 @@ DataArrayDouble *DataArrayDouble::applyFunc(const char *func) const * \throw If \a func contains vars that are not in \a this->getInfoOnComponent(). * \throw If computing \a func fails. */ -DataArrayDouble *DataArrayDouble::applyFunc2(int nbOfComp, const char *func) const +DataArrayDouble *DataArrayDouble::applyFunc2(int nbOfComp, const std::string& func) const { checkAllocated(); INTERP_KERNEL::ExprParser expr(func); @@ -4432,7 +4432,7 @@ DataArrayDouble *DataArrayDouble::applyFunc2(int nbOfComp, const char *func) con * \throw If \a func contains vars not in \a varsOrder. * \throw If computing \a func fails. */ -DataArrayDouble *DataArrayDouble::applyFunc3(int nbOfComp, const std::vector& varsOrder, const char *func) const +DataArrayDouble *DataArrayDouble::applyFunc3(int nbOfComp, const std::vector& varsOrder, const std::string& func) const { checkAllocated(); INTERP_KERNEL::ExprParser expr(func); @@ -4472,7 +4472,7 @@ DataArrayDouble *DataArrayDouble::applyFunc3(int nbOfComp, const std::vectorsetInfoOnComponent(k,a[i]->getInfoOnComponent(j).c_str()); + ret->setInfoOnComponent(k,a[i]->getInfoOnComponent(j)); return ret; } @@ -4749,8 +4749,8 @@ DataArrayDouble *DataArrayDouble::Dot(const DataArrayDouble *a1, const DataArray sum+=a1Ptr[i*nbOfComp+j]*a2Ptr[i*nbOfComp+j]; retPtr[i]=sum; } - ret->setInfoOnComponent(0,a1->getInfoOnComponent(0).c_str()); - ret->setName(a1->getName().c_str()); + ret->setInfoOnComponent(0,a1->getInfoOnComponent(0)); + ret->setName(a1->getName()); return ret; } @@ -5605,12 +5605,12 @@ bool DataArrayDouble::resizeForUnserialization(const std::vector& tinyInfoI */ void DataArrayDouble::finishUnserialization(const std::vector& tinyInfoI, const std::vector& tinyInfoS) { - setName(tinyInfoS[0].c_str()); + setName(tinyInfoS[0]); if(isAllocated()) { int nbOfCompo=getNumberOfComponents(); for(int i=0;isetName(getName().c_str()); + ret->setName(getName()); for(int i=0;isetInfoOnComponent(i,getInfoOnComponent(i).c_str()); - ret->setName(getName().c_str()); + ret->setInfoOnComponent(i,getInfoOnComponent(i)); + ret->setName(getName()); return ret.retn(); } @@ -9407,7 +9407,7 @@ DataArrayInt *DataArrayInt::Meld(const std::vector& arr) int k=0; for(int i=0;i<(int)a.size();i++) for(int j=0;jsetInfoOnComponent(k,a[i]->getInfoOnComponent(j).c_str()); + ret->setInfoOnComponent(k,a[i]->getInfoOnComponent(j)); return ret; } @@ -11192,12 +11192,12 @@ bool DataArrayInt::resizeForUnserialization(const std::vector& tinyInfoI) */ void DataArrayInt::finishUnserialization(const std::vector& tinyInfoI, const std::vector& tinyInfoS) { - setName(tinyInfoS[0].c_str()); + setName(tinyInfoS[0]); if(isAllocated()) { int nbOfCompo=tinyInfoI[1]; for(int i=0;i