174 amxp_expr_status_t status = amxp_expr_status_ok;
175 const char* sep =
"";
178 if(amxd_path_is_search_path(obj_path)) {
179 amxc_string_setf(str_expr,
"%s", amxd_path_get(obj_path, AMXD_OBJECT_TERMINATE));
180 amxc_string_replace(str_expr,
"'",
"\"", UINT32_MAX);
181 amxc_string_prependf(str_expr,
"path starts with search_path('");
182 amxc_string_appendf(str_expr,
"')");
185 amxc_string_setf(str_expr,
"%s", amxd_path_get(obj_path, AMXD_OBJECT_TERMINATE));
186 amxc_string_replace(str_expr,
"'",
"\"", UINT32_MAX);
187 amxc_string_prependf(str_expr,
"(path starts with '");
188 amxc_string_appendf(str_expr,
"' || !(contains('path') && contains('object')))");
192 if((expression != NULL) && (*expression != 0)) {
193 amxc_string_appendf(str_expr,
"%s(%s)", sep, expression);
196 if(!amxc_string_is_empty(str_expr)) {
197 status = amxp_expr_init(&expr, amxc_string_get(str_expr, 0));
198 amxp_expr_clean(&expr);
201 return status == amxp_expr_status_ok ? 0 : -1;