Changeset 2218 in Sophya for trunk/SophyaPI/PIext/nobjmgr.cc
- Timestamp:
- Oct 21, 2002, 5:38:02 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/nobjmgr.cc
r2180 r2218 218 218 bool NamedObjMgr::SetVar(string const & key, string const & val) 219 219 { 220 if ((key.length() < 1) || (! isalpha(key[0])) ) { 221 cout << "NamedObjMgr::SetVar( " << key << " ...) Bad VarName " << endl; 222 return(false); 223 } 220 224 #ifdef SANS_EVOLPLANCK 221 225 bool fg = true; … … 231 235 bool NamedObjMgr::HasVar(string const & key) 232 236 { 237 if ((key.length() < 1) || (! isalpha(key[0])) ) { 238 cout << "NamedObjMgr::HasVar( " << key << ") Bad VarName " << endl; 239 return(false); 240 } 233 241 #ifdef SANS_EVOLPLANCK 234 242 DVList::ValList::const_iterator it; … … 244 252 bool NamedObjMgr::DeleteVar(string const & key) 245 253 { 254 if ((key.length() < 1) || (! isalpha(key[0])) ) { 255 cout << "NamedObjMgr::DeleteVar( " << key << ") Bad VarName " << endl; 256 return(false); 257 } 246 258 #ifdef SANS_EVOLPLANCK 247 259 return(false); … … 254 266 string NamedObjMgr::GetVar(string const & key) 255 267 { 268 if ((key.length() < 1) || (! isalpha(key[0])) ) { 269 cout << "NamedObjMgr::GetVar( " << key << ") Bad VarName " << endl; 270 return(""); 271 } 256 272 // cout << " DEBUG::GetVar " << *myVars << endl; 257 273 return(myVars->GetS(key)); … … 503 519 504 520 myNObj++; 505 if (nobj.length() < 1) { 521 if ((nobj.length() < 1) || (! isalpha(nobj[0]) ) ) { 522 cout << "NamedObjMgr::AddObj() bad object name " << nobj ; 506 523 sprintf(buff,"O%d", myNObj); 507 524 nobj = buff; 525 cout << " changed to " << nobj << endl; 508 526 } 509 527 … … 580 598 cout << "NamedObjMgr::RenameObj() Error - No " << r2 << " directory !" << endl; 581 599 return(false); 582 600 } 583 601 nom = '/' + r1 + '/' + n1; 584 602 nomnew = '/' + r2 + '/' + n2; … … 587 605 cout << "NamedObjMgr::RenameObj() Error - No " << nom << " object !" << endl; 588 606 return(false); 589 } 607 } 608 if ((n2.length() < 1) || (! isalpha(n2[0])) ) { 609 cout << "NamedObjMgr::RenameObj() Error - bad new object name" << n2 << endl; 610 return(false); 611 } 590 612 NObjList::iterator it2 = myObjs->find(nomnew); 591 613 if (it2 != myObjs->end()) { … … 1501 1523 size_t p = nom.find('/'); 1502 1524 if (p < nom.length()) nom = nom.substr(0,p); 1503 if ( nom.length() < 1) return(false);1525 if ((nom.length() < 1) || (! isalpha(nom[0]) ) ) return(false); 1504 1526 return(true); 1505 1527 }
Note:
See TracChangeset
for help on using the changeset viewer.