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


C++ NAString::toLower方法代码示例

本文整理汇总了C++中NAString::toLower方法的典型用法代码示例。如果您正苦于以下问题:C++ NAString::toLower方法的具体用法?C++ NAString::toLower怎么用?C++ NAString::toLower使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NAString的用法示例。


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

示例1: initializeISPCaches

NABoolean ISPIterator::initializeISPCaches(SP_ROW_DATA  inputData, SP_EXTRACT_FUNCPTR  eFunc, SP_ERROR_STRUCT* error, 
                                  const NAArray<CmpContextInfo*> & ctxs, //input 
                                  NAString & contextName, 
                                  Int32 & index           //output, set initial index in arrary of CmpContextInfos
                                  ) 
{
//extract ISP input, find QueryCache belonging to specified context
//and use it for fetch later
  Lng32 maxSize = 16;
  char receivingField[maxSize+1];
  if (eFunc (0, inputData, (Lng32)maxSize, receivingField, FALSE) == SP_ERROR_EXTRACT_DATA)
  {
      error->error = arkcmpErrorISPFieldDef;
      return FALSE;
  }
   //choose context
   // 1. Search ctxInfos_ for all context with specified name('USER', 'META', 'USTATS'),
   //    'ALL' option will fetch all context in ctxInfos_, index is set to 0, qcache is always NULL, 
   // 2. For remote arkcmp, which has 0 context in ctxInfos_, index is always -1, 

  NAString qCntxt = receivingField;
  qCntxt.toLower();
  //the receivingField is of pattern xxx$trafodion.yyy, 
  //where xxx is the desired input string.
  Int32 dollarIdx = qCntxt.index("$");
  CMPASSERT(dollarIdx > 0);
  //find the specified context
  if(ctxs.entries() == 0){
    //for remote compiler
    if( (dollarIdx==3 && strncmp(qCntxt.data(), "all", dollarIdx)==0) 
     ||(dollarIdx==4 && strncmp(qCntxt.data(), "user", dollarIdx)==0) )
      index = -1;
  }
  else
  {
    if(dollarIdx==3 && strncmp(qCntxt.data(), "all", dollarIdx)==0)
    {
       contextName = "ALL";
       index = 0;
    }
    else if(dollarIdx==4 && strncmp(qCntxt.data(), "user", dollarIdx)==0)
    {
       contextName = "NONE";
       index = 0;
    }
    else if(dollarIdx==4 && strncmp(qCntxt.data(), "meta", dollarIdx)==0)
    {
       contextName = "META";
       index = 0;
    }
    else if(dollarIdx==6 && strncmp(qCntxt.data(), "ustats", dollarIdx)==0)
    {
       contextName = "USTATS";
       index = 0;
    }
  }           
  return TRUE;
}
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:58,代码来源:QueryCacheSt.cpp


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