MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / EditName

Method EditName

extern/ttmath/ttmathobjects.h:295–320  ·  view source on GitHub ↗

! this method changes the name of a specific object */

Source from the content-addressed store, hash-verified

293 this method changes the name of a specific object
294 */
295 ErrorCode EditName(const std::string & old_name, const std::string & new_name)
296 {
297 if( !IsNameCorrect(old_name) || !IsNameCorrect(new_name) )
298 return err_incorrect_name;
299
300 Iterator old_i = table.find(old_name);
301 if( old_i == table.end() )
302 return err_unknown_object;
303
304 if( old_name == new_name )
305 // the new name is the same as the old one
306 // we treat it as a normal situation
307 return err_ok;
308
309 ErrorCode err = Add(new_name, old_i->second.value, old_i->second.param);
310
311 if( err == err_ok )
312 {
313 old_i = table.find(old_name);
314 TTMATH_ASSERT( old_i != table.end() )
315
316 table.erase(old_i);
317 }
318
319 return err;
320 }
321
322
323

Callers

nothing calls this directly

Calls 3

findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected