本文整理汇总了C++中NAString::remove方法的典型用法代码示例。如果您正苦于以下问题:C++ NAString::remove方法的具体用法?C++ NAString::remove怎么用?C++ NAString::remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NAString
的用法示例。
在下文中一共展示了NAString::remove方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExprNodeFlagsToString
NAString TDBDlgExprList::ExprNodeFlagsToString(ex_expr* exprNode)
{
NAString string;
if (exprNode->getFixupConstsAndTemps())
string += "FIXUP_CONSTS_AND_TEMPS|";
if (exprNode->generateNoPCode())
string += "GENERATE_NO_PCODE|";
if (exprNode->getPCodeGenCompile())
string += "PCODE_GEN_COMPILE|";
if (exprNode->getPCodeMoveFastpath())
string += "PCODE_MOVE_FASTPATH|";
if (exprNode->forInsertUpdate())
string += "FOR_INSERT_UPDATE|";
if (exprNode->usePCodeEvalAligned())
string += "PCODE_EVAL_ALIGNED|";
if (exprNode->handleIndirectVC())
string += "HANDLE_INDIRECT_VC|";
if (exprNode-> getPCodeNative())
string += "PCODE_EVAL_NATIVE";
int len = string.length();
string.remove(len-1);
return string;
}
示例2: CmAnsiNameToUTF8
// -----------------------------------------------------------------------
// Translate ANSI SQL names from UCS-2/UTF-16 encoding values to
// the Default ANSI SQL Name character set.
// -----------------------------------------------------------------------
void CmAnsiNameToUTF8(const NAWString &inWcs, NAString &outMbs)
{
outMbs.remove(0); // set to an empty string
if (inWcs.length() <= 0)
{
return;
}
NAString *pConvStr =
unicodeToChar ( inWcs.data() // in - const char * str
, (Int32)inWcs.length() // in - Int32 len
, (Lng32)ComGetNameInterfaceCharSet() // in - Lng32 strCharSet
, (NAMemory *)STMTHEAP // in - NAMemory * h
, FALSE // in - NABoolean allowInvalidChar
);
if (pConvStr != NULL AND pConvStr->length() > 0)
{
outMbs = *pConvStr;
}
delete pConvStr;
}
示例3: action
//.........这里部分代码省略.........
result += LongToNAString((Lng32) error);
}
Throw(env, result);
}
} // CommitTx
else if (action.compareTo("RollbackTx", NAString::ignoreCase) == 0)
{
error = ABORTTRANSACTION();
if (error)
{
if (error == 75)
{
result = "No active transaction";
}
else
{
result = "ABORTTRANSACTION returned ";
result += LongToNAString((Lng32) error);
}
Throw(env, result);
}
} // RollbackTx
else if (action.compareTo("GetProcessId", NAString::ignoreCase) == 0)
{
Lng32 pid = GETPID();
result = LongToNAString(pid);
} // GetProcessId
else if (action.index("GetEnv ", 0, NAString::ignoreCase) == 0)
{
NAString name = action;
name.remove(0, str_len("GetEnv "));
TrimNAStringSpace(name);
char *value = getenv(name.data());
if (value != NULL)
{
result = value;
}
else
{
result = "";
}
} // GetEnv
else if (action.index("PutEnv ", 0, NAString::ignoreCase) == 0)
{
NAString nameAndValue = action;
nameAndValue.remove(0, str_len("PutEnv "));
TrimNAStringSpace(nameAndValue);
Int32 retcode = putenv((char *) nameAndValue.data());
if (retcode != 0)
{
result = "putenv returned ";
result += LongToNAString((Lng32) retcode);
Throw(env, result);
}
} // PutEnv
else if (action.index("LmDebug ", 0, NAString::ignoreCase) == 0)
{
NAString name = action;
name.remove(0, str_len("LmDebug "));
LM_DEBUG0(name.data());
} // LmDebug
示例4: AddColumnSet
Lng32 AddColumnSet(HSColSet &colSet)
{
HSGlobalsClass *hs_globals = GetHSContext();
Lng32 retcode = 0;
HSColGroupStruct *newGroup = NULL;
Lng32 colCount = 0;
NABoolean badColList = FALSE;
NAString colNames = "";
NAString temp;
HSLogMan *LM = HSLogMan::Instance();
Int32 numCols = colSet.entries();
Int32 i;
if (numCols < 2) // Must have at least 2 columns in multi-col set.
{
if (LM->LogNeeded())
{
sprintf(LM->msg, "\t\tIgnoring Column Group with single unique entry (%s)",
colSet[0].colname->data());
LM->Log(LM->msg);
}
return HS_WARNING;
}
for (i=0; i<numCols; i++) // update column numbers, position & NO DUPLICATES
{
HSColumnStruct &col = colSet[i];
temp = " ";
temp += ToAnsiIdentifier(col.colname->data());
// Note: ToAnsiIdentifier() determines whether a name needs to be delimited
// with quotes. This function works for shift-JIS but may not work for other
// non-ISO88591 char sets such as Korean, BIG5, GB2312, and GB18030, ...
temp += ",";
if (colNames.contains(temp))
badColList = TRUE;
else
{
col.colnum = hs_globals->objDef->getColNum((char*)col.colname->data());
if (col.colnum < 0)
{
retcode = -1;
HSHandleError(retcode);
}
col.position = colCount;
colCount++;
}
colNames += temp;
}
colNames.remove(0,1); // remove first blank
colNames.remove(colNames.length() - 1); // remove last comma
if (badColList) // column list contains repeating columns
{
if (LM->LogNeeded())
{
sprintf(LM->msg, "\t\tNon-Unique Column Group (%s)", colNames.data());
LM->Log(LM->msg);
}
HSFuncMergeDiags(- UERR_COLUMNLIST_NOT_UNIQUE, colNames.data());
retcode = -1;
HSHandleError(retcode);
}
else
{
if (GroupExists(colSet))
{
if (LM->LogNeeded())
{
sprintf(LM->msg, "\t\tDuplicate Column Group (%s) has been ignored.", colNames.data());
LM->Log(LM->msg);
}
retcode = HS_WARNING;
}
else
{
newGroup = new(STMTHEAP) HSColGroupStruct;
newGroup->colSet = colSet;
newGroup->colCount = colCount;
*newGroup->colNames = colNames.data();
if (hs_globals->multiGroup == NULL) // first group entry
{
hs_globals->multiGroup = newGroup;
}
else // append to front of list
{
newGroup->next = hs_globals->multiGroup;
hs_globals->multiGroup->prev = newGroup;
hs_globals->multiGroup = newGroup;
}
hs_globals->groupCount++;
}
}
return retcode;
}