String8 SurfaceFlinger::getUniqueLayerName(const String8& name)
{
bool matchFound = true;
uint32_t dupeCounter = 0;
// Tack on our counter whether there is a hit or not, so everyone gets a tag
String8 uniqueName = name + "#" + String8(std::to_string(dupeCounter).c_str());
return uniqueName ;
}
一般作为形参,const表示name为常量,传递过程中不允许改变,String8表示name为字符类型,&取地址,类似指针,表示传递过程是以指针形式传递,不会产生临时变量;
depeCounter为int型,转换为字符串类型std::to_string(depeCounter).c_str()