Esempio n. 1
0
eclCmdOptionMatchIndicator EclCmdCommon::matchCommandLineOption(ArgvIterator &iter, bool finalAttempt)
{
    bool boolValue;
    if (iter.matchFlag(boolValue, ECLOPT_VERSION))
    {
        fprintf(stdout, "%s\n", BUILD_TAG);
        return EclCmdOptionCompletion;
    }
    if (iter.matchOption(optServer, ECLOPT_SERVER)||iter.matchOption(optServer, ECLOPT_SERVER_S))
        return EclCmdOptionMatch;
    if (iter.matchOption(optPort, ECLOPT_PORT))
        return EclCmdOptionMatch;
    if (iter.matchOption(optUsername, ECLOPT_USERNAME)||iter.matchOption(optUsername, ECLOPT_USERNAME_S))
        return EclCmdOptionMatch;
    if (iter.matchOption(optPassword, ECLOPT_PASSWORD)||iter.matchOption(optPassword, ECLOPT_PASSWORD_S))
        return EclCmdOptionMatch;
    if (iter.matchFlag(optVerbose, ECLOPT_VERBOSE) || iter.matchFlag(optVerbose, ECLOPT_VERBOSE_S))
        return EclCmdOptionMatch;

    StringAttr tempArg;
    if (iter.matchOption(tempArg, "-brk"))
    {
#if defined(_WIN32) && defined(_DEBUG)
        unsigned id = atoi(tempArg.sget());
        if (id == 0)
            DebugBreak();
        else
            _CrtSetBreakAlloc(id);
#endif
        return EclCmdOptionMatch;
    }
    if (finalAttempt)
        fprintf(stderr, "\n%s option not recognized\n", iter.query());
    return EclCmdOptionNoMatch;
}
Esempio n. 2
0
bool EclCMDShell::parseCommandLineOptions(ArgvIterator &iter)
{
    if (iter.done())
    {
        usage();
        return false;
    }

    bool boolValue;
    for (; !iter.done(); iter.next())
    {
        const char * arg = iter.query();
        if (iter.matchFlag(optHelp, "help"))
            continue;
        if (*arg!='-')
        {
            cmd.set(arg);
            iter.next();
            break;
        }
        if (iter.matchFlag(boolValue, "--version"))
        {
            fprintf(stdout, "%s\n", BUILD_TAG);
            return false;
        }
        StringAttr tempArg;
        if (iter.matchOption(tempArg, "-brk"))
        {
#if defined(_WIN32) && defined(_DEBUG)
            unsigned id = atoi(tempArg.sget());
            if (id == 0)
                DebugBreak();
            else
                _CrtSetBreakAlloc(id);
#endif
        }
    }
    return true;
}
Esempio n. 3
0
bool CPackageNode::validate(StringArray &warn, StringArray &err) const
{
    if (!node)
        return true;
    StringAttr packageId = node->queryProp("@id");
    if (packageId.isEmpty())
        err.append("Package has no id attribute");
    Owned<IPropertyTreeIterator> files = node->getElements("SuperFile");
    ForEach(*files)
    {
        IPropertyTree &super = files->query();
        StringAttr superId = super.queryProp("@id");
        if (superId.isEmpty())
            err.append("SuperFile has no id attribute");

        if (!super.hasProp("SubFile"))
        {
            VStringBuffer msg("Package['%s']/SuperFile['%s'] has no SubFiles defined", packageId.sget(), superId.sget());
            warn.append(msg.str());
        }
    }
    return true;
}
Esempio n. 4
0
bool WsEclWuInfo::getWsResource(const char *name, StringBuffer &out)
{
    if (strieq(name, "SOAP"))
    {
        out.appendf("<message name=\"%s\">", queryname.sget());
        IConstWUResultIterator &vars = ensureWorkUnit()->getVariables();
        Owned<IResultSetFactory> resultSetFactory(getResultSetFactory(username, password));
        ForEach(vars)
        {
            IConstWUResult &var = vars.query();
            SCMStringBuffer varname;
            var.getResultName(varname);
            int seq = var.getResultSequence();

            WUResultFormat fmt = var.getResultFormat();

            SCMStringBuffer eclschema;
            var.getResultEclSchema(eclschema);

            SCMStringBuffer s;
            Owned<IResultSetMetaData> meta = resultSetFactory->createResultSetMeta(&var);

            if (!var.isResultScalar())
            {
                meta->getXmlSchema(s, false);
                out.appendf("<part name=\"%s\" type=\"tns:XmlDataSet\" />", varname.str());
            }
            else
            {
                meta->getColumnEclType(s, 0);
                DisplayType dt = meta->getColumnDisplayType(0);
                StringAttr ptype;
                switch (dt)
                {
                case TypeBoolean:
                    ptype.set("xsd:boolean");
                    break;
                case TypeInteger:
                    ptype.set("xsd:integer");
                    break;
                case TypeUnsignedInteger:
                    ptype.set("xsd:integer");
                    break;
                case TypeReal:
                    ptype.set("xsd:real");
                    break;
                case TypeSet:
                    ptype.set("tns:EspStringArray");
                    break;
                case TypeDataset:
                case TypeData:
                    ptype.set("tns:XmlDataSet");
                    break;
                case TypeUnicode:
                case TypeString:
                    ptype.set("xsd:string");
                    break;
                case TypeUnknown:
                case TypeBeginIfBlock:
                case TypeEndIfBlock:
                case TypeBeginRecord:
                default:
                    ptype.set("xsd:string");
                    break;
                }
                out.appendf("<part name=\"%s\" type=\"%s\" />", varname.str(), ptype.sget());
            }
        }
        out.append("</message>");
    }