class cmpi::CMPISelectExp

Public Instance Methods

match(p1) click to toggle source

  int match(CMPIInstance *instance)
  {
    CMPIStatus st = {CMPI_RC_OK, NULL};
    select_filter_exp *sfe = (select_filter_exp *)$self;
    CMPIBoolean res = CMEvaluateSelExp(sfe->exp, instance, &st);
    RAISE_IF(st);
    return res;
  }

  char **filter() {
    select_filter_exp *sfe = (select_filter_exp *)$self;
    return sfe->filter;
  }

  /* Return string representation */
#ifdef SWIGPYTHON
%rename ("__str__") string();
#endif
#ifdef SWIGRUBY
%rename ("to_s") string();
#endif
  %newobject string;
  const char* string() {
    select_filter_exp *sfe = (select_filter_exp *)$self;
    CMPIString *s = CMGetSelExpString(sfe->exp, NULL);
    const char *result = strdup(CMGetCharPtr(s));
    CMRelease(s);
    return result;
  }
}
to_s() click to toggle source
  const char* string() {
    select_filter_exp *sfe = (select_filter_exp *)$self;
    CMPIString *s = CMGetSelExpString(sfe->exp, NULL);
    const char *result = strdup(CMGetCharPtr(s));
    CMRelease(s);
    return result;
  }
}