static esp_xlate_info *esp_xlat(ParamInfo *pi) { char metatype[256]; *metatype=0; pi->cat_type(metatype); return esp_xlat(metatype); }
void ParamInfo::write_esp_ng_declaration(int pos) { char metatype[256]={0}; cat_type(metatype); esp_xlate_info *xlation=esp_xlat(metatype, false); const char *type_name="StringBuffer"; if (xlation) { if (xlation->eam_type==EAM_jmbin || (flags & PF_TEMPLATE) || getMetaInt("attach", 0)) return; //not implemented type_name=xlation->store_type; } int maxlen=getMetaInt("maxlen", -1); if (!strcmp(type_name, "StringBuffer")) outf(2, "m_params[%d]=new EspNgStringParameter(\"%s\", %d);\n", pos, name, maxlen); else outf(2, "m_params[%d]=new EspNgParameter<%s>(\"%s\", %d);\n", pos, type_name, name, maxlen); }
const char* ParamInfo::getArrayImplType() { if (m_arrayImplType) return m_arrayImplType->str(); if (isPrimitiveArray()) { char metatype[256]; metatype[0] = 0; cat_type(metatype); esp_xlate_info *xlation=esp_xlat(metatype, false); m_arrayImplType = new StringBuffer(xlation->array_type); } else { if (kind == TK_ESPENUM) m_arrayImplType = new VStringBuffer("%sArray", typname); else m_arrayImplType = new VStringBuffer("IArrayOf<IConst%s>", typname); } return m_arrayImplType->str(); }
void ParamInfo::write_esp_attr_method_ng(const char *msgname, int pos, bool isSet, bool hasNilRemove) { char metatype[256]={0}; cat_type(metatype); esp_xlate_info *xlation=esp_xlat(metatype); char *methName=strdup(name); *methName=upperchar(*methName); if (isSet) { if (hasNilRemove) outf(1,"void set%s_null(){ m_params[%d]->setNull(); }\n", methName, pos); outf(1,"void set%s(%s val){m_params[%d]->setValue(val);}\n", methName, xlation->access_type, pos); } else { if (hasNilRemove) outf(1,"bool get%s_isNull(){return m_params[%d]->isNull();}\n", methName, pos); outf(1,"%s get%s(){return EspNgParamConverter(m_params[%d]);}\n", xlation->access_type, methName, pos); } free(methName); }
static const char *MetaTypeToXsdType(const char *val) { esp_xlate_info *xlation=esp_xlat(val); return (xlation) ? xlation->xsd_type : (const char *)"string"; }