Exemple #1
0
static void cxActionRootLoadCodesWithReader(cxAny pav,xmlTextReaderPtr reader)
{
    cxActionRoot this = pav;
    cxReaderAttrInfo *info = cxReaderAttrInfoMake(reader, pav, pav);
    while(xmlTextReaderRead(reader) && !this->isError){
        if(xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT){
            continue;
        }
        cxConstChars temp = cxXMLReadElementName(reader);
        if(!ELEMENT_IS_TYPE(cxActionRoot)){
            continue;
        }
        cxObjectReadAttrRun(info);
        break;
    }
    while(xmlTextReaderRead(reader)){
        CX_CONTINUE(xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT);
        
        cxConstChars id = cxXMLAttr(reader, "id");
        CX_CONTINUE(id == NULL);
        
        cxString code = cxXMLReaderReadOuterXml(reader);
        cxHashSet(this->codes, cxHashStrKey(id), code);
    }
}
Exemple #2
0
CX_SETTER_DEF(cxTimeLine, times)
{
    cxJson times = cxJsonToArray(value);
    CX_JSON_ARRAY_EACH_BEG(times, item)
    {
        cxFloat time = cxJsonToDouble(item, -1);
        CX_CONTINUE(time < 0);
        cxTimeLineSet(this, time);
    }
Exemple #3
0
cxAny cxActionRootGet(cxConstChars src)
{
    cxUrlPath path = cxUrlPathParse(src);
    CX_RETURN(path == NULL, NULL);
    cxActionRoot this = cxActionRootCreate(path->path);
    CX_RETURN(this == NULL, NULL);
    cxString code = cxHashGet(this->codes, (path->count == 1) ? cxHashStrKey(path->path) : cxHashStrKey(path->key));
    CX_RETURN(code == NULL, NULL);
    //create by code
    xmlTextReaderPtr reader = cxXMLReaderForString(code, NULL, NULL);
    cxReaderAttrInfo *info = cxReaderAttrInfoMake(reader, this, NULL);
    while(xmlTextReaderRead(reader)){
        CX_CONTINUE(xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT);
        cxConstChars temp = cxXMLReadElementName(reader);
        info->object = CX_METHOD_FIRE(NULL, this->Make,temp,reader);
        CX_CONTINUE(info->object == NULL);
        //save root
        cxObjectSetRoot(info->object, this);
        cxObjectReadAttrRun(info);
    }
    return info->object;
}