当前位置: 首页>>代码示例>>C++>>正文


C++ StringAttr类代码示例

本文整理汇总了C++中StringAttr的典型用法代码示例。如果您正苦于以下问题:C++ StringAttr类的具体用法?C++ StringAttr怎么用?C++ StringAttr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了StringAttr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getWorkunit

static IConstWorkUnit *getWorkunit(ICodeContext * ctx)
{
    StringAttr wuid;
    wuid.setown(ctx->getWuid());
    // One assumes we have read access to our own wu
    return getWorkunit(ctx, wuid);
}
开发者ID:Josh-Googler,项目名称:HPCC-Platform,代码行数:7,代码来源:workunitservices.cpp

示例2: getWorkunit

static IConstWorkUnit * getWorkunit(ICodeContext * ctx)
{
    Owned<IWorkUnitFactory> factory = getWorkUnitFactory();
    StringAttr wuid;
    wuid.setown(ctx->getWuid());
    return factory->openWorkUnit(wuid, false);
}
开发者ID:mokerjoke,项目名称:HPCC-Platform,代码行数:7,代码来源:workunitservices.cpp

示例3: splitXmlTagNamesFromXPath

void splitXmlTagNamesFromXPath(const char *xpath, StringAttr &inner, StringAttr *outer=NULL)
{
    if (!xpath || !xpath)
        return;

    StringBuffer s1;
    StringBuffer s2;

    appendNextXpathName(s1, xpath);
    if (outer && xpath)
        appendNextXpathName(s2, ++xpath);
    if (xpath) //xpath too deep
        return;

    if (!s2.length())
        inner.set(s1.str());
    else
    {
        inner.set(s2.str());
        outer->set(s1.str());
    }
    if (!inner.get())
        inner.set("");
    if (outer && !outer->get())
        outer->set("");
}
开发者ID:Goon83,项目名称:HPCC-Platform,代码行数:26,代码来源:fvsource.cpp

示例4: splitGitFileName

static void splitGitFileName(const char *fullName, StringAttr &gitDir, StringAttr &revision, StringAttr &relPath)
{
    assertex(fullName);
    const char *git = strstr(fullName, ".git" PATHSEPSTR "{" );
    assertex(git);
    const char *tail = git+5;
    gitDir.set(fullName, tail-fullName);
    assertex (*tail=='{');
    tail++;
    const char *end = strchr(tail, '}');
    if (!end)
        throw MakeStringException(0, "Invalid git repository filename - no matching } found");
    revision.set(tail, end - tail);
    tail = end+1;
    if (*tail==PATHSEPCHAR)
        tail++;
    else if (*tail != 0)
        throw MakeStringException(0, "Invalid git repository filename - " PATHSEPSTR " expected after }");
    if (tail && *tail)
    {
        StringBuffer s(tail);
        s.replace(PATHSEPCHAR, '/');
        relPath.set(s);
    }
    else
        relPath.clear();
    // Check it's a valid git repository
    StringBuffer configName(gitDir);
    configName.append("config");
    if (!checkFileExists(configName.str()))
        throw MakeStringException(0, "Invalid git repository - config file %s not found", configName.str());
}
开发者ID:garonsky,项目名称:HPCC-Platform,代码行数:32,代码来源:gitfile.cpp

示例5: splitArchivedFileName

static void splitArchivedFileName(const char *fullName, StringAttr &container, StringAttr &option, StringAttr &relPath)
{
    const char *tail = splitName(fullName);
    assertex(tail);
    size_t containerLen = tail-fullName;
    if (fullName[containerLen-1]==PATHSEPCHAR)
        containerLen--;
    container.set(fullName, containerLen);
    if (*tail=='{')
    {
        tail++;
        const char *end = strchr(tail, '}');
        if (!end)
            throw MakeStringException(0, "Invalid archive-embedded filename - no matching } found");
        option.set(tail, end - tail);
        tail = end+1;
        if (*tail==PATHSEPCHAR)
            tail++;
        else if (*tail != 0)
            throw MakeStringException(0, "Invalid archive-embedded filename - " PATHSEPSTR " expected after }");
    }
    else
        option.clear();
    if (tail && *tail)
    {
        StringBuffer s(tail);
        s.replace(PATHSEPCHAR, '/');
        relPath.set(s);
    }
    else
        relPath.clear();
}
开发者ID:BenMJones,项目名称:HPCC-Platform,代码行数:32,代码来源:archive.cpp

示例6: fprintf

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;
}
开发者ID:Goon83,项目名称:HPCC-Platform,代码行数:35,代码来源:eclcmd_common.cpp

示例7: connectionRemoteMachine

bool connectionRemoteMachine(const StringBuffer& sPath, IConstEnvironment* pConstEnv)
{
  bool rc = true;
  if (sPath.length() > 2 && sPath[0] == '\\' && sPath[1] == '\\')
  {
    const char* spath = sPath.str();
    const char* cpos = strchr(spath + 2, '\\');
    int pos = cpos? cpos - spath : -1;

    if (pos != -1)
    {
      char szComp[128];
      strncpy(szComp, spath + 2, pos);
      StringBuffer computer(szComp);
      StringAttr userid;
      StringAttr pswd;

      try {
        //if computer is defined in hardware section then use its associated
        //login information, if any
        getAccountInfo(computer, userid, pswd, pConstEnv);
      } catch (...)
      {
        userid.clear();
        pswd.clear();
      }
    }
  }
  return rc;
}
开发者ID:AttilaVamos,项目名称:HPCC-Platform,代码行数:30,代码来源:buildset.cpp

示例8: SplitIpPort

void SplitIpPort(StringAttr & ip, unsigned & port, const char * address)
{
    const char * colon = strchr(address, ':');
    if (colon)
    {
        ip.set(address,colon-address);
        port = atoi(colon+1);
    }
    else
        ip.set(address);
}
开发者ID:miguelvazq,项目名称:HPCC-Platform,代码行数:11,代码来源:testsocket.cpp

示例9: LINK

IHqlRemoteScope * XmlEclRepository::resolveScope(IProperties *props, const char * modname, bool deleteIfExists, bool createIfMissing)
{
    Owned<IHqlRemoteScope> parentScope = LINK(rootScope);
    
    const char * item = modname;
    const char * dot;
    do
    {
        dot = strchr(item, '.');
        _ATOM moduleName;
        StringAttr fullName;
        if (dot)
        {
            moduleName = createIdentifierAtom(item, dot-item);
            fullName.set(modname, dot - modname);
            item = dot + 1;
        }
        else
        {
            moduleName = createIdentifierAtom(item);
            fullName.set(modname);
        }

        //nested module already exist in parent scope?
        Owned<IHqlRemoteScope> rScope = parentScope->lookupRemoteModule(moduleName);

        if (!rScope && !createIfMissing)
            return NULL;

        if (rScope && deleteIfExists && !dot)
        {
            rScope->noteTextModified();
            if (rScope->isEmpty())
                parentScope->removeNestedScope(moduleName);
            return NULL;
        }

        if (!rScope)
        {
            rScope.setown(createRemoteScope(moduleName, fullName, this, dot ? NULL : props, NULL, true));

            int flags = props->getPropInt("@flags", 0);
            parentScope->addNestedScope(rScope->queryScope(), flags);
        }
        else
            rScope->invalidateParsed();

        parentScope.set(rScope);
    } while (dot);
    if (parentScope)
        parentScope->noteTextModified();
    return parentScope.getLink();
}
开发者ID:EwokVillage,项目名称:HPCC-Platform,代码行数:53,代码来源:hqlremote.cpp

示例10: SplitIpPort

void SplitIpPort(StringAttr & ip, unsigned & port, const char * address)
{
  const char * colon = strchr(address, ':');
  if (colon)
  {
    ip.set(address,colon-address);
    if (strcmp(ip, ".")==0)
        ip.set(GetCachedHostName());
    port = atoi(colon+1);
  }
  else
    ip.set(address);
}
开发者ID:LlsDimple,项目名称:HPCC-Platform,代码行数:13,代码来源:hrpcutil.cpp

示例11: run

 virtual int run()
 {
     int access = 0;
     int total = 0, mint = -1, maxt = 0;
     for(int i = 0; i < m_rounds; i++)
     {
         time_t start, stop;
         time(&start);
         {
             //synchronized block(m_mutex);
             Owned<ISecUser> usr = m_secmgr->createUser(m_user.get());
             usr->credentials().setPassword(m_passwd.get());
             //access = m_secmgr->authorizeFileScope(*usr, m_resource.get());
             access = m_secmgr->authorizeEx(m_rtype, *usr, m_resource.get());
         }
         time(&stop);
         int span = (int)(stop - start);
         total += span;
         if(mint == -1 || mint > span)
             mint = span;
         if(maxt < span)
             maxt = span;
         if((i+1)%100 == 0)
             DBGLOG("Finished %d times\n", i+1);
     }
     DBGLOG("Permission: %d, min: %d, max: %d, average:%f", access, mint, maxt, total*1.0/m_rounds);
     return 0;
 }
开发者ID:RogerDev,项目名称:HPCC-Platform,代码行数:28,代码来源:ldapsecuritytest.cpp

示例12: finalizeOptions

    bool finalizeOptions(IProperties *globals)
    {
        if (optInput.length())
        {
            const char *in = optInput.get();
            while (*in && isspace(*in)) in++;
            if (*in!='<')
            {
                StringBuffer content;
                content.loadFile(in);
                optInput.set(content.str());
            }
        }

        if (optESDLDefID.isEmpty())
            throw MakeStringException( 0, "ESDL definition ID must be provided!" );

        if (optESDLService.isEmpty())
            throw MakeStringException( 0, "ESDL service definition name must be provided!" );

        if(optTargetESPProcName.isEmpty())
            throw MakeStringException( 0, "Name of Target ESP process must be provided!" );

        if (optPortOrName.isEmpty())
            throw MakeStringException( 0, "Either the target ESP service port of name must be provided!" );
        else
        {
            const char * portorname =  optPortOrName.get();
            isdigit(*portorname) ? optTargetPort.set(portorname) : optService.set(portorname);
        }

        return EsdlPublishCmdCommon::finalizeOptions(globals);
    }
开发者ID:jamienoss,项目名称:HPCC-Platform,代码行数:33,代码来源:esdl-publish.cpp

示例13: getHeader

 void getHeader(StringBuffer & header) const
 {
     header.append(senderHeader).append(sender.get()).append("\r\n");
     header.append(toHeader).append(to.str()).append("\r\n");
     header.append(subjectHeader).append(subject.get()).append("\r\n");
     header.append("MIME-Version: 1.0\r\n");
 }
开发者ID:AttilaVamos,项目名称:HPCC-Platform,代码行数:7,代码来源:rmtsmtp.cpp

示例14: parseCommandLineOptions

    bool parseCommandLineOptions(ArgvIterator &iter)
    {
        if (iter.done())
        {
            usage();
            return false;
        }

        //First 5 parameter order is fixed.
        for (int cur = 0; cur < 5 && !iter.done(); cur++)
        {
           const char *arg = iter.query();
           if (*arg != '-')
           {
               switch (cur)
               {
                case 0:
                    optTargetESPProcName.set(arg);
                    break;
                case 1:
                    optBindingName.set(arg);
                    break;
                case 2:
                    optService.set(arg);
                    break;
                case 3:
                    optVersionStr.set(arg);
                    break;
                case 4:
                    optMethod.set(arg);
                    break;
                default:
                    fprintf(stderr, "\nUnrecognized positional argument detected : %s\n", arg);
                    usage();
                    return false;
               }
           }
           else
           {
               fprintf(stderr, "\noption detected before required arguments: %s\n", arg);
               usage();
               return false;
           }

           iter.next();
        }

        for (; !iter.done(); iter.next())
        {
            if (parseCommandLineOption(iter))
                continue;

            if (matchCommandLineOption(iter, true)!=EsdlCmdOptionMatch)
                return false;
        }

        return true;
    }
开发者ID:SAB2012,项目名称:HPCC-Platform,代码行数:58,代码来源:esdl-publish.cpp

示例15: CPermissionCheckThread

 CPermissionCheckThread(ISecManager* secmgr, const char* user, const char* passwd, const char* r, SecResourceType rtype, int rounds)
 {
     m_secmgr = secmgr;
     m_user.set(user);
     m_passwd.set(passwd);
     m_resource.set(r);
     m_rtype = rtype;
     m_rounds = rounds;
 }
开发者ID:RogerDev,项目名称:HPCC-Platform,代码行数:9,代码来源:ldapsecuritytest.cpp


注:本文中的StringAttr类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。