Exemple #1
0
void BomKeyNode::buildItem(const char *pId, KeyValNode *pKvn) {
    //char op[4096];
    BomItem *tmp;
    char args[10];
    KeyValNode *kvn;
    StringNode *svn;
    int c;
    tmp = (BomItem *)malloc(sizeof(BomItem));
    tmp->refChar = pKvn->key()[0];
    tmp->node = pKvn;
    if(tmp->refChar >= 'a' && tmp->refChar <= 'z') {
        tmp->refChar = (tmp->refChar - 'a') + 'A';
    }
    tmp->block = new TextBlock(gVxm.parts->getPart(pId));
    mCount++;
    tmp->idNum = refCount(tmp->refChar);
    if(tmp->block == NULL) {
        printf("block not found for %s\n", pId);
        return;
    }

    sprintf(args, "%c%d%02d", tmp->refChar, mMajor, tmp->idNum);
    tmp->block->setArg(args, 1);
    for(c = 2; c <= tmp->block->argCount(); c++) {
        sprintf(args,"*arg%d", c);
        kvn = (KeyValNode*)FindNode(pKvn, args);
        svn = (StringNode*) kvn->value();
        tmp->block->setArg(svn->value(), c);
    }
    tmp->next = mHead;
    mHead = tmp;
    //tmp->block->buildBlock(op);
    //printf("%s\n", op);
}
Exemple #2
0
void BomKeyNode::addComponent(MapNode *pNode) {
    MapNode *mn;
    KeyValNode *kvn;
    StringNode *svn;
    mn = FindNode(pNode, "pid");
    if(mn->nodeType() == 2) {
        kvn = (KeyValNode *) mn;
        svn = (StringNode*) kvn->value();
        //printf("Bom: %s\n", svn->value());
        buildItem(svn->value(),(KeyValNode*) pNode);
    }
    mList->append(pNode);
}
Exemple #3
0
void
XmlRenderer::renderNode(const StringNode& node)
{
  displayTag("str", node.value());
}