您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ str_cpy_all函数代码示例

51自学网 2021-06-03 08:26:03
  C++
这篇教程C++ str_cpy_all函数代码示例写得很实用,希望能帮到您。

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

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

示例1: ex_assert

void ExProcessIdsOfFrag::unpackObj(IpcMessageObjType objType,				   IpcMessageObjVersion objVersion,				   NABoolean sameEndianness,				   IpcMessageObjSize objSize,				   IpcConstMessageBufferPtr buffer){  ex_assert(objType == ESP_PROCESS_IDS_OF_FRAG AND	    objVersion == CurrProcessIdsOfFragVersion AND	    sameEndianness AND	    objSize >= baseClassPackedLength() +	       sizeof(fragmentId_) + sizeof(CollIndex),            "Received invalid ProcessIdsOfFrag object");  unpackBaseClass(buffer);  // unpack fragment id and number of entries  Int32 np;  buffer += sizeof(spare_);  str_cpy_all((char *) &fragmentId_, buffer, sizeof(fragmentId_));  buffer += sizeof(fragmentId_);  str_cpy_all((char *) &np, buffer, sizeof(np));  buffer += sizeof(np);  // unpack the process ids  for (CollIndex i = 0; i < (CollIndex) np; i++)    {      alignBufferForNextObj(buffer);      processIds_.insert(IpcProcessId());      processIds_[i].unpackDependentObjFromBuffer(buffer,sameEndianness);    }}
开发者ID:apache,项目名称:incubator-trafodion,代码行数:31,


示例2: new

// copy_chars(): create a copy of given chars on the specified heap.// The C runtime heap is used if heap is NULL. Target string is null// terminated if terminate is TRUE. A pointer to the copy is returned.char *copy_chars(NAMemory *heap, const char *src, ComUInt32 len,                 NABoolean terminate){  if (!src)    return NULL;  if (terminate)    len++;  char *tgt;  if (heap)    tgt = new (heap) char [len];  else    tgt = (char *) malloc(len);    LMCOMMON_ASSERT(tgt);    if (terminate)  {    str_cpy_all(tgt, src, (Lng32)len-1);    tgt[len-1] = '/0';  }  else    str_cpy_all(tgt, src, (Lng32)len);    return tgt;}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:30,


示例3: packBaseClassIntoMessage

IpcMessageObjSize ExProcessIdsOfFrag::packObjIntoMessage(     IpcMessageBufferPtr buffer){  IpcMessageObjSize result = packBaseClassIntoMessage(buffer);  Int32 np = processIds_.entries();  // pack fragment id and number of entries  str_cpy_all(buffer, (const char *) &spare_, sizeof(spare_));  result += sizeof(spare_);  buffer += sizeof(spare_);  str_cpy_all(buffer, (const char *) &fragmentId_, sizeof(fragmentId_));  result += sizeof(fragmentId_);  buffer += sizeof(fragmentId_);  str_cpy_all(buffer, (const char *) &np, sizeof(np));  result += sizeof(np);  buffer += sizeof(np);  // pack each process id, as an IpcMessageObj  for (CollIndex i = 0; i < (CollIndex) np; i++)    {      alignSizeForNextObj(result);      alignBufferForNextObj(buffer);      IpcMessageObjSize pidsize =	processIds_[i].packDependentObjIntoMessage(buffer);      result += pidsize;      buffer += pidsize;    }  return result;}
开发者ID:apache,项目名称:incubator-trafodion,代码行数:30,


示例4: str_cpy_all

void CmpCompileInfo::packVars(char * buffer, CmpCompileInfo *ci,                              Lng32 &nextOffset){  if (sqltext_ && (sqlTextLen_ > 0))    {      str_cpy_all(&buffer[nextOffset], sqltext_, sqlTextLen_);      ci->sqltext_ = (char *)nextOffset;      nextOffset += ROUND8(sqlTextLen_);    }    if (rlnil_ && (rlnilLen_ > 0))    {      str_cpy_all(&buffer[nextOffset], (char *)rlnil_, rlnilLen_);      ci->rlnil_ = (RecompLateNameInfoList *)nextOffset;      nextOffset += ROUND8(rlnilLen_);    }  if (schemaName_ && (schemaNameLen_ > 0))    {      str_cpy_all(&buffer[nextOffset], (char *)schemaName_, schemaNameLen_);      ci->schemaName_ = (char *)nextOffset;      nextOffset += ROUND8(schemaNameLen_);    }  if (recompControlInfo_ && (recompControlInfoLen_ > 0))    {      str_cpy_all(&buffer[nextOffset], (char *)recompControlInfo_, recompControlInfoLen_);      ci->recompControlInfo_ = (char *)nextOffset;      nextOffset += ROUND8(recompControlInfoLen_);    }}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:31,


示例5: Int32

void MdamColumn::completeKey(char *bktarget,			     char *ektarget,			     short bkexcl,			     short ekexcl){  Int32 len = Int32(columnGenInfo_->getLength());  char *extremalValue;  bktarget = bktarget + columnGenInfo_->getOffset();  ektarget = ektarget + columnGenInfo_->getOffset();  if (bkexcl)    // use hi value if begin key is excluded    extremalValue = hi_.getDataPointer();    else    // use lo value if begin key is included    extremalValue = lo_.getDataPointer();     str_cpy_all(bktarget,extremalValue,len);    if (ekexcl)    // use lo value if end key is excluded    extremalValue = lo_.getDataPointer();   else    // use hi value if end key is included    extremalValue = hi_.getDataPointer();     str_cpy_all(ektarget,extremalValue,len);};
开发者ID:qwertyioz,项目名称:incubator-trafodion,代码行数:29,


示例6: strlen

short ex_tcb::moveRowToUpQueue(ex_queue_pair *qparent,                               UInt16 tuppIndex,                               const char * row, Lng32 len,                                short * rc, NABoolean isVarchar){  if (qparent->up->isFull())    {      if (rc)	*rc = WORK_CALL_AGAIN;      return -1;    }  Lng32 length;  if (len <= 0)    length = strlen(row);  else    length = len;  tupp p;  if (pool_->get_free_tuple(p, (Lng32)			    ((isVarchar ? SQL_VARCHAR_HDR_SIZE : 0)			     + length)))    {      if (rc)	*rc = WORK_POOL_BLOCKED;      return -1;    }    char * dp = p.getDataPointer();  if (isVarchar)    {      *(short*)dp = (short)length;      str_cpy_all(&dp[SQL_VARCHAR_HDR_SIZE], row, length);    }  else    {      str_cpy_all(dp, row, length);    }  ex_queue_entry * pentry_down = qparent->down->getHeadEntry();  ex_queue_entry * up_entry = qparent->up->getTailEntry();    up_entry->copyAtp(pentry_down);  up_entry->getAtp()->getTupp((Lng32)tuppIndex) = p;  up_entry->upState.parentIndex =     pentry_down->downState.parentIndex;    up_entry->upState.setMatchNo(0);  up_entry->upState.status = ex_queue::Q_OK_MMORE;  // insert into parent  qparent->up->insert();  return 0;}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:56,


示例7: packBaseClassIntoMessage

IpcMessageObjSize ExMsgFragment::packObjIntoMessage(IpcMessageBufferPtr buffer){  // See description of packed format in packedLength() method  IpcMessageBufferPtr start = buffer;  // Pack the base class  packBaseClassIntoMessage(buffer);  alignBufferForNextObj(buffer);  // Pack the fixed length fields  str_cpy_all(buffer, (const char *) &f_, sizeof(f_));  buffer += sizeof(f_);  alignBufferForNextObj(buffer);  // Pack the query ID  if (f_.queryId_ != NULL)  {    str_cpy_all(buffer, f_.queryId_, f_.queryIdLen_);    buffer += f_.queryIdLen_;    alignBufferForNextObj(buffer);  }  // Pack the user name  if (f_.userName_ != NULL)  {    str_cpy_all(buffer, f_.userName_, f_.userNameLen_);    buffer += f_.userNameLen_;    alignBufferForNextObj(buffer);  }  // Pack the fragment itself  if (f_.compressedLength_ > 0 && f_.compressedLength_ < f_.fragmentLength_)  {    size_t cmprSize = str_compress(buffer,fragment_,f_.fragmentLength_);    ex_assert(cmprSize == f_.compressedLength_,              "Error during compress a fragment for download");    buffer += f_.compressedLength_;  }  else  {#pragma nowarn(1506)   // warning elimination     str_cpy_all(buffer,fragment_,f_.fragmentLength_);#pragma warn(1506)  // warning elimination     buffer += f_.fragmentLength_;  }  alignBufferForNextObj(buffer);  // Pack the fragment key (is an IpcMessageObj itself)  buffer += key_.packDependentObjIntoMessage(buffer);  return (IpcMessageObjSize) (buffer - start);}
开发者ID:lanbb,项目名称:incubator-trafodion,代码行数:55,


示例8: sizeof

void SQLMXLoggingArea::logCompNQCretryEvent(char *stmt){  const char m[]="Statement was compiled as if query plan caching were off: ";  Int32 mLen = sizeof(m);  Int32 sLen = str_len(stmt);  char msg[8192];  str_cpy_all(msg, m, mLen);  str_cpy_all(msg+mLen, stmt, MINOF(sLen, 8192-mLen));  logSQLMXEventForError(SQEV_CMP_NQC_RETRY_OCCURED, "ADVANCED", "INFRM",                         "LOGONLY", msg); }
开发者ID:ryzuo,项目名称:incubator-trafodion,代码行数:11,


示例9: nowarn

ex_expr::exp_return_type ex_function_substring_doublebyte::eval(char *op_data[],						 CollHeap* heap,						 ComDiagsArea** diagsArea){#pragma nowarn(1506)   // warning elimination   Lng32 len1 = getOperand(1)->getLength(op_data[-MAX_OPERANDS+1]);#pragma warn(1506)  // warning elimination   len1 /= sizeof(NAWchar); // len1 now counts in terms of number of NCHARs.    // Get the starting position from operand 2.  Int64 start = *(Lng32 *)op_data[2];      // If operand 3 exists, get the length of substring from operand 3.  // Otherwise, length of the substring is (len1 - start + 1).  Int64 len = 0;  Int64 temp = 0;  if (getNumOperands() == 4)    {      len = *(Lng32 *)op_data[3];      temp = start + len;    }  else    {      if (start > (len1 + 1)) 	temp = start;      else	temp = len1 + 1;    }    // Check for error conditions.  if (temp < start)    {      ExRaiseSqlError(heap, diagsArea, EXE_SUBSTRING_ERROR);      return ex_expr::EXPR_ERROR;    }    Lng32 len0 = 0;  if ((start <= len1) && (temp > 0))     {      if (start < 1)        start = 1;      if (temp > (len1 + 1))        temp = len1 + 1;      len0 = int64ToInt32(temp - start);         }  len0 *= sizeof(NAWchar);  // convert the length back into the number of octets.    // Result is always a varchar, so store the length of substring   // in the varlen indicator.  getOperand(0)->setVarLength(len0, op_data[-MAX_OPERANDS]);    // Now, copy the substring of operand 1 from the starting position into  // operand 0, if len0 is greater than 0.  if (len0 > 0)     str_cpy_all(op_data[0], &op_data[1][sizeof(NAWchar)*(int64ToInt32(start) - 1)], len0);     return ex_expr::EXPR_OK;}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:60,


示例10: str_pad

// Generates LOB handle that is stored in the SQL row.// LOB handle len:  64 bytes// <flags><LOBnum><objectUid><descKey><descTS><schNameLen><schName>// <--4--><--4---><----8----><---8---><--8---><-----2----><--vc--->void ExpLOBoper::genLOBhandle(Int64 uid, 			      Lng32 lobNum,			      short lobType,			      Int64 descKey, 			      Int64 descTS,			      Lng32 flags,			      short schNameLen,			      char  * schName,			      Lng32 &handleLen,			      char * ptr){  LOBHandle * lobHandle = (LOBHandle*)ptr;  lobHandle->flags_ = flags;  lobHandle->lobType_ = (char)lobType;  lobHandle->filler1_ = 0;  lobHandle->lobNum_ = lobNum;  lobHandle->objUID_ = uid;  lobHandle->descSyskey_ = descKey;  lobHandle->descPartnkey_ = descTS;  str_pad(lobHandle->filler_, 30, '/0');  lobHandle->schNameLen_ = schNameLen;  handleLen = sizeof(LOBHandle);  if (schNameLen > 0)    {      char * s = &lobHandle->schName_;      str_cpy_all(s, schName, schNameLen);      s[schNameLen] = 0;      handleLen += schNameLen;    }  //  lobHandle->inlinedLOBlen_ = 0;}
开发者ID:anoopsharma00,项目名称:incubator-trafodion,代码行数:36,


示例11: str_cpy_all

// Extracts values from the LOB handle stored at ptrLng32 ExpLOBoper::extractFromLOBhandle(Int16 *flags,				       Lng32 *lobType,				       Lng32 *lobNum,				       Int64 *uid, 				       Int64 *descSyskey, 				       Int64 *descPartnKey,				       short *schNameLen,				       char * schName,				       char * ptrToLobHandle,				       Lng32 handleLen){  LOBHandle * lobHandle = (LOBHandle*)ptrToLobHandle;  if (flags)    *flags = lobHandle->flags_;  if (lobType)    *lobType = lobHandle->lobType_;  if (lobNum)    *lobNum = lobHandle->lobNum_;  if (uid)    *uid = lobHandle->objUID_;  if (descSyskey)    *descSyskey = lobHandle->descSyskey_;  if (descPartnKey)    *descPartnKey = lobHandle->descPartnkey_;  if (schNameLen)    *schNameLen = lobHandle->schNameLen_;  if ((schNameLen) && (*schNameLen > 0) && (schName != NULL))    {      str_cpy_all(schName, &lobHandle->schName_, *schNameLen);      schName[*schNameLen] = 0;    }  return 0;}
开发者ID:anoopsharma00,项目名称:incubator-trafodion,代码行数:35,


示例12: strcpy

/////////////////////////////////////////// class Define/////////////////////////////////////////Define::Define(const char * name_, const char * value_){  if (name_)    {      name = new char[strlen(name_) + 1];      strcpy(name, name_);      defineNameInternal = new char[24];      str_pad(defineNameInternal, 24, ' ');#pragma nowarn(1506)   // warning elimination       short len = MINOF(strlen(name), 24);#pragma warn(1506)  // warning elimination       str_cpy_all(defineNameInternal, name, len);    }  else    name = 0;  if (value_)    {      value = new char[strlen(value_) + 1];      strcpy(value, value_);    }  else    value = 0;}
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:28,


示例13: ex_assert

ex_tcb::~ex_tcb(){  ex_assert(!str_cmp((char *)&eyeCatcher_, (char *)(&tdb.eyeCatcher_), 4),            "TCB points to wrong TDB");  // Change the eye catcher  str_cpy_all((char *) &eyeCatcher_, eye_FREE, 4);};
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:7,


示例14: ex_assert

void TupMsgBuffer::unpackObj(IpcMessageObjType objType,			     IpcMessageObjVersion objVersion,			     NABoolean sameEndianness,			     IpcMessageObjSize objSize,			     IpcConstMessageBufferPtr buffer){  ex_assert((objType == ESP_INPUT_SQL_BUFFER OR	     objType == ESP_OUTPUT_SQL_BUFFER) AND	    objVersion == 100 AND	    sameEndianness AND	    objSize > sizeof(IpcMessageObj),	    "invalid type or version for TupMsgBuffer::unpackObj()");  unpackBaseClass(buffer);  IpcMessageObjSize sqlBufferSize = objSize - sizeof(IpcMessageObj);  ex_assert(allocSize_ >= (Lng32) sqlBufferSize,	    "TupMsgBuffer too small for unpack");#pragma nowarn(1506)   // warning elimination   str_cpy_all((char *) theBuffer_, buffer, sqlBufferSize);#pragma warn(1506)  // warning elimination   // convert offsets in buffer to pointers  theBuffer_->driveUnpack();  // just checking whether we really got the right size info  ex_assert(sqlBufferSize == theBuffer_->get_buffer_size(),	    "Buffer size mismatch");}
开发者ID:lanbb,项目名称:incubator-trafodion,代码行数:31,


示例15: getCommandLen

void InputStmt::processInsert(){  size_t command_len = getCommandLen();  if ((command_len > 0) && (text_maxlen > 0))    {      size_t j = text_maxlen - 1;      while (j >= text_pos)	{	  text[j+command_len] = text[j];	  if (j-- == 0) break;	}#pragma nowarn(1506)   // warning elimination       str_cpy_all(&text[text_pos], &command[command_pos], command_len);#pragma warn(1506)  // warning elimination       command_pos += command_len;      text_pos += 2 * command_len + 1;      text_maxlen += command_len;      if (text_pos > text_maxlen)	text_maxlen = text_pos;    }}	// processInsert()
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:25,


示例16: checkLobOperStatus

ex_expr::exp_return_type ExpLOBselect::eval(char *op_data[],					    CollHeap*h,					    ComDiagsArea** diagsArea){  char * result = op_data[0];  Lng32 rc = 0;  Int64 uid;  Lng32 lobType;  Lng32 lobNum;  Int64 descKey;  Int16 flags;  Int64 descTS = -1;  short schNameLen = 0;  char  schName[500];  LobsSubOper so;  Lng32 waitedOp = 0;  Int64 lobLen = 0;   char *lobData = NULL;  Lng32 cliError = 0;  Lng32 lobOperStatus = checkLobOperStatus();  if (lobOperStatus == DO_NOTHING_)    return ex_expr::EXPR_OK;  Int32 handleLen = getOperand(1)->getLength(op_data[-MAX_OPERANDS+1]);  char * lobHandle = op_data[1];  extractFromLOBhandle(&flags, &lobType, &lobNum, &uid,		       &descKey, &descTS, 		       &schNameLen, schName,		       lobHandle);  // select returns lobhandle only  str_pad(result, getOperand(0)->getLength());  str_cpy_all(result, lobHandle, strlen(lobHandle));    return ex_expr::EXPR_OK;}
开发者ID:anoopsharma00,项目名称:incubator-trafodion,代码行数:34,


示例17: ex_assert

void MdamColumn::reportProbeResult(char *keyData){ex_assert(sparseProbeNeeded_,	  "MdamColumn::reportProbeResult called unexpectedly.");sparseProbeNeeded_ = FALSE;if (keyData)  {    // the sparse probe was successful -- save the key value    Int32 len = Int32(columnGenInfo_->getLength());#pragma nowarn(1506)   // warning elimination     Lng32 offset = columnGenInfo_->getOffset();#pragma warn(1506)  // warning elimination     char * cv = currentValue_.getDataPointer();    str_cpy_all(cv,keyData + offset,len);    sparseProbeSucceeded_ = TRUE;  }else  {    // the sparse probe returned no data    sparseProbeFailed_ = TRUE;  }}
开发者ID:qwertyioz,项目名称:incubator-trafodion,代码行数:26,


示例18: NAVersionedObject

ExSPInputOutput::ExSPInputOutput() : NAVersionedObject(-1){    str_cpy_all(eyeCatcher_, "SPIO", 4);    totalLen_ = 0;    tupleDesc_ = NULL;    caseIndexArray_ = (Int16Ptr) NULL;    flags_ = 0;}
开发者ID:svarnau,项目名称:incubator-trafodion,代码行数:8,


示例19: str_cpy_all

NA_EIDPROC ComTdb::~ComTdb(){  // ---------------------------------------------------------------------  // Change the eye catcher  // ---------------------------------------------------------------------  str_cpy_all((char *) &eyeCatcher_, eye_FREE, 4);  }
开发者ID:blfritch-esgyn,项目名称:incubator-trafodion,代码行数:8,


示例20: bytes

/*  DP2 Query Id Format:    Each of the part is in binary numeric format.  <segment><cpu><pin><processStartTS><queryNum>  <segment>        :      1 byte  <cpu>            :      1 byte  <pin>            :      2 bytes(short)  <processStartTS> :      8 bytes (Int64)  <queryNum>       :      4 bytes (Lng32)*/Lng32 ComSqlId::getDp2QueryIdString(char * queryId,                 // IN Lng32 queryIdLen,                // IN char * dp2QueryId,              // INOUT Lng32 &dp2QueryIdLen             // OUT ){  if ((!queryId) ||      (queryIdLen < MAX_DP2_QUERY_ID_LEN))    return -1;  Int64 value;  Lng32 currOffset = 0;  // In case of Linux and NT, segment num and cpu num are same  // Copy them as short  // get cpu  getSqlQueryIdAttr(SQLQUERYID_CPUNUM, queryId, queryIdLen,		    value, NULL);  *(short*)&dp2QueryId[currOffset] = (short)value;  currOffset += sizeof(short);  // get pin  getSqlQueryIdAttr(SQLQUERYID_PIN, queryId, queryIdLen,		    value, NULL);  *(short*)&dp2QueryId[currOffset] = (short)value;  currOffset += sizeof(short);  // get process start time  getSqlQueryIdAttr(SQLQUERYID_EXESTARTTIME, queryId, queryIdLen,		    value, NULL);  str_cpy_all(&dp2QueryId[currOffset], (char*)&value, sizeof(Int64));  currOffset += sizeof(Int64);  // get query num  getSqlQueryIdAttr(SQLQUERYID_QUERYNUM, queryId, queryIdLen,		    value, NULL);  Lng32 qNum = (Lng32)value;  str_cpy_all(&dp2QueryId[currOffset], (char*)&qNum, sizeof(Lng32));  currOffset += sizeof(Lng32);  dp2QueryIdLen = currOffset;  return 0;}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:57,


示例21: lockMutex

// log an ASSERTION FAILURE eventvoidSQLMXLoggingArea::logSQLMXAssertionFailureEvent(const char* file, Int32 line, const char* msgTxt, const char* condition, const Lng32* tid){  bool lockedMutex = lockMutex();    Int32 LEN = 8192;  char msg[8192];  memset(msg, 0, LEN);  Int32 sLen = str_len(msgTxt);  Int32 sTotalLen = sLen;  str_cpy_all (msg, msgTxt, sLen);  char fileLineStr[200];  if (file)  {    str_sprintf(fileLineStr, ", FILE: %s, LINE: %d ",file, line);    sLen = str_len(fileLineStr);    str_cpy_all (msg+sTotalLen, fileLineStr, sLen);    sTotalLen += sLen;  }  if (tid && (*tid != -1))  {    char transId[100];    str_sprintf(transId, " TRANSACTION ID: %d ", *tid);    sLen = str_len(transId);    str_cpy_all (msg+sTotalLen, transId, sLen);    sTotalLen += sLen;  }  if (condition)  {    char condStr[100];    str_sprintf(condStr, " CONDITION: %s ", condition);    sLen = str_len(condStr);    str_cpy_all (msg+sTotalLen, condStr, sLen);  }  QRLogger::log(QRLogger::instance().getMyDefaultCat(), LL_FATAL, "%s", msg);  if (lockedMutex)    unlockMutex();  }
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:46,


示例22: new

char *UDRCopyString ( const ComString &sourceString, CollHeap *heap ){  char *string = new(heap)char [sourceString.length()+1];  str_cpy_all ( string		, sourceString.data()		, sourceString.length()+1	      );  return string;} // UDRCopyString
开发者ID:lanbb,项目名称:incubator-trafodion,代码行数:9,


示例23: LM_DEBUG0

jint JNICALL LmJavaHooks::vfprintfHookJVM(FILE *stream, const char *fmt,                                          va_list printArgs){  if (!fmt || !stream)  {    return 0;  }  LM_DEBUG0("[BEGIN vfprintf hook]");    char tmpBuf[LMJ_HOOK_TEXT_BUF_SIZE] = "";  // 1. First make a temporary copy of the output message  ComSafePrinter safePrinter;  safePrinter.vsnPrintf(tmpBuf, LMJ_HOOK_TEXT_BUF_SIZE, fmt, printArgs);  // 2. Send the message to its intended FILE stream  // Do not know why but inside this hook, writing to the FILE pointer  // that was passed in seems to cause problems on Windows. Depending  // on how the FILE pointer is used we have seen crashes inside JVM  // code after hook returns, and inside fprintf. The JVM bug database  // says a few things about the JVM being compiled with a version of  // certain stdio structures such as va_list that may not be  // compatible with all IDEs. Have not tried to verify that  // though. For now on Windows we just write our temporary string to  // stderr. And our observation has been that all JVM messages go to  // stderr anyway, so this seems to serve the same purpose.  //  // For example the following line does not work  //  //   vfprintf(stream, fmt, printArgs)  //  // And neither does this  //  //   fprintf(stream, tmpBuf)  //  fprintf(stderr, tmpBuf);  // Write as much as possible into our textBuf_ area  Int32 currentLength = str_len(textBuf_);  Int32 tmpLen = str_len(tmpBuf);  if ((currentLength + 1) < LMJ_HOOK_TEXT_BUF_SIZE)  {    Int32 bytesToCopy =      MINOF(tmpLen + 1, LMJ_HOOK_TEXT_BUF_SIZE - currentLength);    str_cpy_all(&textBuf_[currentLength], tmpBuf, bytesToCopy);    textBuf_[LMJ_HOOK_TEXT_BUF_SIZE - 1] = 0;  }  else  {    LM_DEBUG0("*** WARNING: textBuf_ buffer is full");  }  LM_DEBUG0("[END vfprintf hook]");  return 0;}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:56,


示例24: classID_

// ---------------------------------------------------------------------// Constructor//// Note that imageSize_ and versionIDArray_ are only filled in at// packing time. These values are not useful on the source platform// where the objects are constructed. They are only useful at the// destination while the objects are unpacked. Before the objects are// packed, drivePack() will make sure their values are correctly set.// This arrangement avoids the dependence on the constructors of sub-// classes of NAVersionedObject on setting these values correctly.// ---------------------------------------------------------------------NA_EIDPROC NAVersionedObject::NAVersionedObject(Int16 classID)    : classID_(classID),      reallocatedAddress_(NULL),      imageSize_(0)  {    clearFillers();    initFlags();    // set to state of "not packed".    clearVersionIDArray();    str_cpy_all(eyeCatcher_,VOBJ_EYE_CATCHER,VOBJ_EYE_CATCHER_SIZE);  }
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:21,


示例25: module_name_len_

Module::Module(const char * module_name, Lng32 len, char * pathName,                Lng32 pathNameLen, NAHeap *heap)     : module_name_len_(len), path_name_len_(pathNameLen),        heap_(heap), statementCount_(0),       stmtCntrsSpace_(NULL),       vproc_(NULL){  module_name_ = (char *)   (heap->allocateMemory((size_t)(len+1)));  str_cpy_all(module_name_, module_name, len);  module_name_[len] = 0;  path_name_ = (char *)   (heap->allocateMemory((size_t)(pathNameLen+1)));  str_cpy_all(path_name_, pathName, pathNameLen);  path_name_[pathNameLen] = 0;}
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:20,


示例26: getClassSize

void CmpDDLwithStatusInfo::pack(char * buffer){  CmpDDLwithStatusInfo * ci = (CmpDDLwithStatusInfo *)buffer;  Lng32 classSize = getClassSize();  Lng32 nextOffset = 0;  str_cpy_all(buffer, (char *)this, classSize);  nextOffset += ROUND8(classSize);  packVars(buffer, ci, nextOffset);  if (blackBox_ && (blackBoxLen_ > 0))    {      str_cpy_all(&buffer[nextOffset], blackBox_, blackBoxLen_);      ci->blackBox_ = (char *)nextOffset;      nextOffset += ROUND8(blackBoxLen_);    }}
开发者ID:lanbb,项目名称:incubator-trafodion,代码行数:20,



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


C++ str_data函数代码示例
C++ str_cpy函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。