119{
120 auto index = name.find('@');
121 if (index == std::string::npos) {
122 return name;
123 }
124
125 Preconditions::check_true(index < (name.size() - 1),
126 "Object name cannot be empty string");
127 Preconditions::check_true(
128 name.find('@', index + 1) == std::string::npos,
129 "Custom CP group name must be specified at most once");
130
131 auto object_name = name.substr(0, index);
132 boost::trim(object_name);
133 Preconditions::check_true(object_name.size() > 0,
134 "Object name cannot be empty string");
135 return object_name;
136}