예제 #1
0
void ParamInfo::out_type(int deref,int var)
{
    char s[256];
    s[0] = 0;
    cat_type(s,deref,var);
    outs(s);
}
예제 #2
0
const char *ParamInfo::getXsdType()
{
    if (xsdtype==NULL)
    {
        char metatype[256];
        *metatype=0;
        cat_type(metatype);

        setXsdType(MetaTypeToXsdType(metatype));
    }

    return xsdtype;
}
예제 #3
0
BOOST_REGEX_DECL cat_type BOOST_REGEX_CALL w32_cat_open(const std::string& name)
{
#ifndef BOOST_NO_ANSI_APIS
   cat_type result(::LoadLibraryA(name.c_str()), &free_module);
   return result;
#else
   LPWSTR wide_name = (LPWSTR)_alloca( (name.size() + 1) * sizeof(WCHAR) );
   if (::MultiByteToWideChar(CP_ACP, 0,  name.c_str(), name.size(),  wide_name, name.size() + 1) == 0)
       return cat_type();

   cat_type result(::LoadLibraryW(wide_name), &free_module);
   return result;
#endif
}
예제 #4
0
void ParamInfo::typesizeacc(char *accstr,size_t &acc)
{
    if ((kind==TK_STRUCT)||(flags&(PF_PTR|PF_REF))) {
        acc = (acc+3)&~3;
        if (*accstr)
            strcat(accstr,"+");
        strcat(accstr,"sizeof(");
        cat_type(accstr);
        strcat(accstr,")");
    }
    else {
        size_t sz=type_size[kind];
        if (sz==2)
            acc = (acc+1)&~1;
        else if (sz>=4)
            acc = (acc+3)&~3;
        acc += type_size[kind];
    }
}
예제 #5
0
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);
}
예제 #6
0
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();
}
예제 #7
0
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);
}