Ejemplo n.º 1
0
static void queryExpandFilename(StringBuffer & out, IHqlExpression * expr)
{
    if (expr)
    {
        OwnedHqlExpr folded = foldHqlExpression(expr);
        if (folded->queryValue())
            folded->queryValue()->generateECL(out.append('\n'));
    }
}
Ejemplo n.º 2
0
CChildLimitedDatasetColumnInfo::CChildLimitedDatasetColumnInfo(CContainerInfo * _container, CMemberInfo * _prior, IHqlExpression * _column, RecordOffsetMap & map, unsigned defaultMaxRecordSize) : CColumnInfo(_container, _prior, _column)
{
    IHqlExpression * count = column->queryAttribute(countAtom);
    if (count)
        countField.setown(foldHqlExpression(column->queryAttribute(countAtom)->queryChild(0)));
    else
    {
        IHqlExpression * size = column->queryAttribute(sizeofAtom);
        if (size)
            sizeField.setown(foldHqlExpression(size->queryChild(0)));
        else
            countField.setown(createConstantOne());
    }
    if (countField)
        countField.setown(ensureExprType(countField, sizetType));
    if (sizeField)
        sizeField.setown(ensureExprType(sizeField, sizetType));
    ColumnToOffsetMap * offsetMap = map.queryMapping(column->queryRecord(), defaultMaxRecordSize);
    maxChildSize = offsetMap->getMaxSize();
    fixedChildSize = offsetMap->isFixedWidth() ? maxChildSize : UNKNOWN_LENGTH;
}
Ejemplo n.º 3
0
    ForEachChild(i, record)
    {
        IHqlExpression * cur = record->queryChild(i);
        switch (cur->getOperator())
        {
        case no_record:
            expandFieldNames(errorProcessor, out, cur, prefix, sep, formatFunc);
            break;
        case no_ifblock:
            expandFieldNames(errorProcessor, out, cur->queryChild(1), prefix, sep, formatFunc);
            break;
        case no_field:
            {
                StringBuffer lowerName;
                lowerName.append(cur->queryName()).toLowerCase();
                if (formatFunc)
                {
                    HqlExprArray args;
                    args.append(*createConstant(lowerName.str()));
                    OwnedHqlExpr bound = createBoundFunction(NULL, formatFunc, args, NULL, true);
                    OwnedHqlExpr folded = foldHqlExpression(errorProcessor, bound, NULL, HFOthrowerror|HFOfoldimpure|HFOforcefold);
                    assertex(folded->queryValue());
                    lowerName.clear();
                    getStringValue(lowerName, folded);
                }

                switch (cur->queryType()->getTypeCode())
                {
                case type_record:
                case type_row:
                    {
                        unsigned len = prefix.length();
                        prefix.append(lowerName).append(".");
                        expandFieldNames(errorProcessor, out, cur->queryRecord(), prefix, sep, formatFunc);
                        prefix.setLength(len);
                        break;
                    }
                default:
                    {
                        if (out.length())
                            out.append(sep);
                        out.append(prefix).append(lowerName);
                        break;
                    }
                }
                break;
            }
        }
    }