Changeset 2999 in Sophya for trunk/SophyaPI/PIext/nobjmgr.cc


Ignore:
Timestamp:
Jul 2, 2006, 7:20:56 PM (19 years ago)
Author:
ansari
Message:

1/ Ajout methode Services2NObjMgr::DisplayPoints3DW() et commande plot3dw
2/ Ajout et utilisation methode de verification de nom NamedObjMgr::CheckName()
3/ Changement methode NObjMgrAdapter::GetInfoString() et son utilisation
a travers la methdoe PIACmd::GetVarApp() pour acces de type $objname
4/ Ajout methode NObjMgrAdapter::PerformOperation() , implemente pour
adaptateur TMatrix<T> et TArray<T> pour extraction de ligne/colonne
(des matrices) et plan (slice) des TArray pour Rank()>3 Et mise en place
de la commande objaoper pour appel a PerformOperation()
5/ Petites corrections pour ntline2var vec2var

Reza 2 Juillet 2006

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/nobjmgr.cc

    r2975 r2999  
    564564
    565565myNObj++;
    566 if ((nobj.length() < 1) || (! isalpha(nobj[0]) ) ) {
    567   cout << "NamedObjMgr::AddObj() bad object name " << nobj ;
     566if ( !CheckName(nobj) ) {
    568567  sprintf(buff,"O%d", myNObj);
    569   nobj = buff;
    570   cout << " changed to " << nobj << endl;
    571   }
     568  cout << "NamedObjMgr::AddObj() Name changed: " << nom << " -> " << buff << endl;
     569  nom = buff;
     570}
    572571
    573572nom = '/' + nrep + '/' + nobj; 
     
    663662  return(false);
    664663}
    665 if ((n2.length() < 1) || (! isalpha(n2[0])) ) {
     664
     665if ( !CheckName(n2) ) {
    666666  cout << "NamedObjMgr::RenameObj() Error -  bad new object name" << n2 << endl;
    667667  return(false);
     
    671671  cout << "NamedObjMgr::RenameObj() Error -  Object " << nomnew << " exist !" << endl;
    672672  return(false);
    673   }
    674 
     673}
     674   
    675675if ( (*itr1).second.lock || (*itr2).second.lock ) {
    676676  cout << "NamedObjMgr::RenameObj() Error - Source or destination directory locked !"
     
    17341734}
    17351735
     1736/* Nouvelle-Fonction */
     1737bool NamedObjMgr::CheckName(string const & nom)
     1738{
     1739if (nom.length() < 1) return false;
     1740if (! isalpha(nom[0]) ) return false;
     1741for(int k=0; k<nom.length(); k++)
     1742  if ((!isalnum(nom[k])) && (nom[k] != '_')) return false;
     1743return true;
     1744}
Note: See TracChangeset for help on using the changeset viewer.