这篇教程C++ DgString0函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DgString0函数的典型用法代码示例。如果您正苦于以下问题:C++ DgString0函数的具体用法?C++ DgString0怎么用?C++ DgString0使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DgString0函数的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: module//ss_cc_change : This file is obsolete and is not used//LCOV_EXCL_START// read and return module header structuremodule_header_struct*readModuleHeader(fstream &mf, // (IN): binary module file module_header_struct &hdr, // (IN): target of read const char * name, // (IN): name of module (for error msg) ComDiagsArea &diags) // (IN): deposit any error msg here{ // read the module header mf.seekg(0, ios::beg); mf.read((char *)&hdr, sizeof(module_header_struct)); if (mf.fail()) { diags << DgSqlCode(-CLI_READ_ERROR) << DgString0(name); return NULL; } // give versioning a chance to massage/migrate it to this version module_header_struct modHdrCls, *latestModHdr = (module_header_struct*) hdr.driveUnpack(&hdr, &modHdrCls, NULL); if (!latestModHdr) { // error: version is no longer supported diags << DgSqlCode(-CLI_MODULE_HDR_VERSION_ERROR) << DgString0(name); return NULL; } // verify its validity Lng32 errCode = latestModHdr->RtduStructIsCorrupt(); if (errCode) { // the module file is corrupted or has invalid data diags << DgSqlCode(errCode) << DgString0(name); return NULL; } return latestModHdr;}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:37,
示例2: currContextLng32 CliGlobals::sendEnvironToMxcmp(){ ComDiagsArea & diags = currContext()->diags(); if (NOT getArkcmp()->isConnected()) return 0; // send the current environment to mxcmp ExSqlComp::ReturnStatus sendStatus = getArkcmp()->sendRequest(CmpMessageObj::ENVS_REFRESH, NULL,0); if (sendStatus != ExSqlComp::SUCCESS) { if (sendStatus == ExSqlComp::ERROR) { diags << DgSqlCode(-CLI_SEND_REQUEST_ERROR) << DgString0("SET ENVIRON"); return -CLI_SEND_REQUEST_ERROR; // return SQLCLI_ReturnCode(&currContext,-CLI_SEND_REQUEST_ERROR); } //else // retcode = WARNING; } if (getArkcmp()->status() != ExSqlComp::FINISHED) { diags << DgSqlCode(-CLI_IO_REQUESTS_PENDING) << DgString0("SET ENVIRON"); return -CLI_IO_REQUESTS_PENDING; //return SQLCLI_ReturnCode(&currContext,-CLI_IO_REQUESTS_PENDING); } return 0;}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:33,
示例3: Int64ToNAStringvoid ElemDDLUdfOptimizationHint::synthesize(void){ if (getOptimizationKind() NEQ COM_UDF_NUMBER_OF_UNIQUE_OUTPUT_VALUES OR uniqueOutputValuesParseTree_ EQU NULL) return; NABoolean isErrMsgIssued = FALSE; ComSInt64 value = 0; ItemExpr * pItemExpr = NULL; ConstValue * pConstVal = NULL; for (CollIndex i = 0; i < uniqueOutputValuesParseTree_->entries(); i++) { pItemExpr = (*uniqueOutputValuesParseTree_)[i]; pConstVal = (ConstValue *)pItemExpr; if (NOT pConstVal->canGetExactNumericValue() AND NOT isErrMsgIssued) { *SqlParser_Diags << DgSqlCode(-3017) << DgString0(pConstVal->getConstStr()); isErrMsgIssued = TRUE; } value = pConstVal->getExactNumericValue(); uniqueOutputValues_.insert(value); if (value < -1 AND NOT isErrMsgIssued) // only issue the error message once { // Error: Expected a positive value or -1 (representing the default SYSTEM setting option) NAString valueStr = Int64ToNAString(value); *SqlParser_Diags << DgSqlCode(-3017) << DgString0(valueStr); isErrMsgIssued = TRUE; } } // for} // ElemDDLUdfOptimizationHint::synthesize()
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:30,
示例4: NADELETEBASICLmResult LmRoutineCppObj::dealloc(ComDiagsArea *diagsArea){ LmResult result = LM_OK; delete invocationInfo_; invocationInfo_ = NULL; for (CollIndex i=0; i<planInfos_.getUsedLength(); i++) if (planInfos_.used(i)) delete planInfos_[i]; planInfos_.clear(); if (paramRow_) { NADELETEBASIC(paramRow_, collHeap()); paramRow_ = NULL; } if (inputRows_) { for (int i=0; i<numInputTables_; i++) if (inputRows_[i]) NADELETEBASIC((inputRows_[i]), collHeap()); NADELETEBASIC(inputRows_, collHeap()); inputRows_ = NULL; } if (outputRow_) { // actually allocated buffer started where the wall starts NADELETEBASIC((outputRow_ - WALL_STRING_LEN), collHeap()); outputRow_ = NULL; } try { // delete the interface object, the virtual destructor may call user code delete interfaceObj_; } catch (tmudr::UDRException e) { *diagsArea << DgSqlCode(-LME_UDR_METHOD_ERROR) << DgString0("destructor") << DgString1(getNameForDiags()) << DgString2(e.getMessage().c_str()); result = LM_ERR; } catch (...) { *diagsArea << DgSqlCode(-LME_UDR_METHOD_ERROR) << DgString0("destructor") << DgString1(getNameForDiags()) << DgString2("General exception."); result = LM_ERR; } interfaceObj_ = NULL; return result;}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:59,
示例5: mainInt32 main(Int32 argc, char **argv){ _set_new_handler(mainNewHandler); // for NA_YOS newHandler_NSK needs to be added, once it is ready -- Sri gadde mxCompileUserModule mxCUM; mxCUMptr = &mxCUM; // process command line arguments Cmdline_Args args; args.processArgs(argc, argv); ApplicationFile *appFile=NULL; // check if application file exists if (ACCESS(args.application().c_str(), READABLE) != 0) { mxCUM << ERROR << DgSqlCode(-2223) << DgString0(args.application().c_str()); } else { // ask factory to create an ELFFile or a SQLJFile appFile = ApplicationFile::makeApplicationFile(args.application()); if (!appFile) { // no, it's not an application file mxCUM << ERROR << DgSqlCode(-2202) << DgString0(args.application().c_str()); } else { // open the application file if (appFile->openFile(args)) { // process appFile's embedded module definitions std::string modName; while (appFile->findNextModule(modName)) { // extract embedded module definition & SQL compile it if (!appFile->processModule()) { mxCUM << WARNING << DgSqlCode(-2204) << DgString0(modName.c_str()); // set mxCUM to WARNING at least. processModule may have set // it to WARNING, ERROR, or FAIL. If we get here, mxCUM // should never be set to SUCCEED. } } // close the application file appFile->closeFile(); appFile->logErrors(); } } } mxCUM.dumpDiags(); if (appFile) { appFile->printSummary(); delete appFile; } return mxCUM.returnCode();}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:54,
示例6: loadDllLmHandle loadDll( const char *containerName, const char *externalPath, LmHandle extLoader, ComUInt32 *containerSize, ComDiagsArea *da, NAMemory *heap){#ifdef LMCOMMON_CANNOT_CALL_DLOPEN *da << DgSqlCode(-LME_INTERNAL_ERROR) << DgString0(": dlopen() is not supported"); *da << DgSqlCode(-LME_DLL_CONT_NOT_FOUND) << DgString0(containerName) << DgString1(externalPath); return NULL;#else char *libraryName = NULL; if (str_len(externalPath) == 0) externalPath = "."; libraryName = new (heap) char[str_len(externalPath) + str_len(containerName) + 2]; sprintf(libraryName, "%s/%s", externalPath, containerName); // TBD: For now, set container size to 0. Need to see how to get // the actual size if (containerSize) *containerSize = 0; // extLoader is an object of LmCLoader class. It's not used to // load the library. We can simply load the DLL. LmHandle container = NULL; const char *operation = "dlopen"; container = (LmHandle) dlopen(libraryName, RTLD_NOW | RTLD_GLOBAL); LM_DEBUG3("%s(%s) returned 0x%08x/n", operation, libraryName, container); if (container == NULL) { *da << DgSqlCode(-LME_DLL_CONT_NOT_FOUND) << DgString0(containerName) << DgString1(externalPath); addDllErrors(*da, operation, FALSE); } NADELETEBASIC(libraryName, heap); return container;#endif // LMCOMMON_CANNOT_CALL_DLOPEN}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:48,
示例7: addDllErrorsvoid addDllErrors(ComDiagsArea &diags, const char *operation, NABoolean isWarningOnly){ Int32 errorCode = 0; Int32 errorDetail = 0; char *errorString = (char *)"";#ifndef LMCOMMON_CANNOT_CALL_DLOPEN // dlresultcode() is not applicable to Linux errorString = dlerror();#endif // Remove trailing period and linefeed characters from the message // string ComUInt32 msglen = 0; while (errorString && (msglen = strlen(errorString)) > 0) { ComUInt32 idx = msglen - 1; if (errorString[idx] == '/n' || errorString[idx] == '/r' || errorString[idx] == '.') errorString[idx] = 0; else break; } diags << DgSqlCode((isWarningOnly ? LME_DLFCN_ERROR : -LME_DLFCN_ERROR)) << DgString0(operation) << DgInt0(errorCode) << DgInt1(errorDetail) << DgString1(errorString);}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:35,
示例8: DgSqlCodeshort SqlciRWExecuteCmd::process(SqlciEnv * sqlci_env){ short rc = 0; PrepStmt * prepStmt = sqlci_env->get_prep_stmts()->get(stmtName_); if (! prepStmt) { sqlci_env->diagsArea() << DgSqlCode(-SQLCI_STMT_NOT_FOUND) << DgString0(stmtName_); return 0; } sqlci_env->sqlciRWEnv()->rwExe()->setExecutePrepStmt(prepStmt); sqlci_env->sqlciRWEnv()->rwExe()->setExecuteCmd(stmtName_); if (usingParamStr_) { rc = sqlci_env->sqlciRWEnv()->rwExe()->setUsingParamInfo(usingParamStr_); if (rc) return 0; } sqlci_env->sqlciRWEnv()->rwExe()->setState(SqlciRWInterfaceExecutor::SELECT_STARTED_); sqlci_env->sqlciRWEnv()->rwExe()->setResetListFlag(FALSE); rc = sqlci_env->sqlciRWEnv()->rwExe()->process(sqlci_env); sqlci_env->sqlciRWEnv()->setSelectInProgress(TRUE); return rc;}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:33,
示例9: name// read and return descriptor area (headers + entries)Int32readDescArea(fstream &mf, // (IN) : binary module file module_header_struct &latestModHdr,// (IN) : its module header NAHeap &heap, // (IN) : allocate DESC area from here const char * name, // (IN) : module name (for error msg) ComDiagsArea &diags, // (IN) : deposit any error msg here char *&descArea) // (OUT): desc headers + entries{ // make sure we have reasonable arguments if (latestModHdr.descriptor_area_offset <= 0 || latestModHdr.descriptor_area_length <= 0) return -1; // allocate space for DESC headers + entries descArea = (char*) heap.allocateMemory((size_t)latestModHdr.descriptor_area_length); // read DESC headers + entries mf.seekg(latestModHdr.descriptor_area_offset, ios::beg); mf.read(descArea, (Int32)latestModHdr.descriptor_area_length); if (mf.fail()) { diags << DgSqlCode(-CLI_READ_ERROR) << DgString0(name); return -1; } return 1; // all OK}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:28,
示例10: validateLibraryFileExists// *****************************************************************************// * *// * Function: validateLibraryFileExists *// * *// * Determines if a library file exists, and if not, reports an error. *// * *// * *// *****************************************************************************// * *// * Parameters: *// * *// * <libraryFilename> const ComString & In *// * is the file whose existence is to be validated. *// * *// * <isSystemObject> bool In *// * if true, indicates the filename should be prepended with the value of *// * MY_SQROOT before validating existence. *// * *// *****************************************************************************static int validateLibraryFileExists( const NAString &libraryFilename, bool isSystemObject) { NAString completeLibraryFilename(libraryFilename); if (isSystemObject) { completeLibraryFilename.insert(0,'/'); completeLibraryFilename.insert(0,getenv("MY_SQROOT")); } else if (CmpCommon::getDefault(CAT_LIBRARY_PATH_RELATIVE) == DF_ON) completeLibraryFilename.insert(0,getenv("MY_UDR_ROOT")); char *libraryFilenameString = convertNAString(completeLibraryFilename,STMTHEAP); struct stat sts; if ((stat(libraryFilenameString,&sts)) == -1 && errno == ENOENT) { *CmpCommon::diags() << DgSqlCode(-1382) << DgString0(libraryFilename); return 1; } return 0;}
开发者ID:kleopatra999,项目名称:incubator-trafodion,代码行数:46,
示例11: cliInterfaceshort ExExeUtilLongRunningTcb::processContinuing(Lng32 &rc) { Int64 rowsAffected = 0; rc = cliInterface()->execContinuingRows(getContinuingOutputVarPtrList(), rowsAffected); if (rc < 0) { return -1; } if (rowsAffected > 0) addRowsDeleted(rowsAffected);#ifdef _DEBUG if ((rowsAffected > 0) && lrTdb().longRunningQueryPlan()) { char lruQPInfo[100]; str_sprintf(lruQPInfo, "Continuing rows deleted: %ld/n/n", rowsAffected); ComDiagsArea * diagsArea = getDiagAreaFromUpQueueTail(); (*diagsArea) << DgSqlCode(8427) << DgString0(lruQPInfo); }#endif return 0;}
开发者ID:apache,项目名称:incubator-trafodion,代码行数:32,
示例12: csnNABoolean CmpSqlSession::validateVolatileSchemaName(NAString &schName){ if (NOT schName.isNull()) { ComSchemaName csn(schName); if (NOT csn.isValid()) { // Schema name $0~SchemaName is not valid. *CmpCommon::diags() << DgSqlCode(-8009) << DgSchemaName(schName); return FALSE; } Lng32 len = MINOF(strlen(csn.getSchemaNamePartAsAnsiString().data()), strlen(COM_VOLATILE_SCHEMA_PREFIX)); NAString upSch(csn.getSchemaNamePartAsAnsiString().data()); upSch.toUpper(); if ((NOT Get_SqlParser_Flags(ALLOW_VOLATILE_SCHEMA_IN_TABLE_NAME)) && (len > 0) && (strncmp(upSch.data(), COM_VOLATILE_SCHEMA_PREFIX, len) == 0)) { *CmpCommon::diags() << DgSqlCode(-4193) << DgString0(COM_VOLATILE_SCHEMA_PREFIX); return FALSE; } } return TRUE;}
开发者ID:fuentead,项目名称:recovery,代码行数:30,
示例13: pubSchema// This function copies the above applyDefaults() function// and includes checking for the object existence and // search in the public schema if necessary.// This is used to replace the above function when // we need to consider PUBLIC_SCHEMA_NAMEInt32 QualifiedName::applyDefaultsValidate(const SchemaName& defCatSch, ComAnsiNameSpace nameSpace){ // need to try public schema if it is specified // and the object schema is not specified NAString publicSchema = ""; CmpCommon::getDefault(PUBLIC_SCHEMA_NAME, publicSchema, FALSE); ComSchemaName pubSchema(publicSchema); NAString pubSchemaIntName = ""; if ( getSchemaName().isNull() && !pubSchema.isEmpty() ) { pubSchemaIntName = pubSchema.getSchemaNamePart().getInternalName(); } Int32 ret = extractAndDefaultNameParts( defCatSch , catalogName_ , schemaName_ , objectName_ ); // try public schema if the table does not exist if (!pubSchemaIntName.isNull()) { *(CmpCommon::diags()) << DgSqlCode(-4222) << DgString0("Public Access Schema"); } return ret;}
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:35,
示例14: schemaName// *****************************************************************************// * *// * Function: CmpSeabaseDDL::createSeabaseSchema *// * *// * Implements the CREATE SCHEMA command. *// * *// *****************************************************************************// * *// * Parameters: *// * *// * <createSchemaNode> StmtDDLCreateSchema * In *// * is a pointer to a create schema parser node. *// * *// * <currentCatalogName> NAString & In *// * is the name of the current catalog. *// * *// *****************************************************************************void CmpSeabaseDDL::createSeabaseSchema( StmtDDLCreateSchema * createSchemaNode, NAString & currentCatalogName) {ComSchemaName schemaName (createSchemaNode->getSchemaName()); if (schemaName.getCatalogNamePart().isEmpty()) schemaName.setCatalogNamePart(currentCatalogName); NAString catName = schemaName.getCatalogNamePartAsAnsiString();ComAnsiNamePart schNameAsComAnsi = schemaName.getSchemaNamePart();NAString schName = schNameAsComAnsi.getInternalName();ExeCliInterface cliInterface(STMTHEAP, NULL, NULL,CmpCommon::context()->sqlSession()->getParentQid());ComSchemaClass schemaClass;Int32 objectOwner = NA_UserIdDefault;Int32 schemaOwner = NA_UserIdDefault;int32_t retCode = verifyDDLCreateOperationAuthorized(&cliInterface, SQLOperation::CREATE_SCHEMA, catName, schName, schemaClass, objectOwner, schemaOwner); if (retCode != 0) { handleDDLCreateAuthorizationError(retCode,catName,schName); return; } Int32 schemaOwnerID = NA_UserIdDefault; // If the AUTHORIZATION clause was not specified, the current user becomes// the schema owner. if (createSchemaNode->getAuthorizationID().isNull()) schemaOwnerID = ComUser::getCurrentUser(); else if (ComUser::getAuthIDFromAuthName(createSchemaNode->getAuthorizationID().data(), schemaOwnerID) != 0) { *CmpCommon::diags() << DgSqlCode(-CAT_AUTHID_DOES_NOT_EXIST_ERROR) << DgString0(createSchemaNode->getAuthorizationID().data()); return; } addSchemaObject(cliInterface, schemaName, createSchemaNode->getSchemaClass(), schemaOwnerID, createSchemaNode->createIfNotExists());}
开发者ID:kleopatra999,项目名称:incubator-trafodion,代码行数:74,
示例15: matchvoid ExtQualModuleNames::parseModule(std::string& cat, std::string& sch, std::string& mod){ // parse [[<catalog>.]<schema>.]<module> std::string id1, id2; if (nextToken() == ID) { id1 = currentToken_; match(ID); if (nextToken() == DOT) { match(DOT); if (nextToken() == ID) { id2 = currentToken_; match(ID); if (nextToken() == DOT) { match(DOT); if (nextToken() == ID) { // module is <cat>.<sch>.<mod> cat = id1; sch = id2; mod = currentToken_; match(ID); } else { *mxCUMptr << FAIL << DgSqlCode(-2213) << DgString0(currentToken_.c_str()); } } else { // nextToken != DOT sch = id1; // module is <sch>.<mod> mod = id2; cat = moduleCatalog_; } } else { *mxCUMptr << FAIL << DgSqlCode(-2213) << DgString0(currentToken_.c_str()); } } else { // nextToken != DOT mod = id1; // module is just <mod> sch = moduleSchema_; cat = moduleCatalog_; } }}
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:44,
示例16: NABooleanCmpStatement::error(Lng32 no, const char* s){ if ( diags()->getNumber() ) return TRUE; // means the underlying routines have put the errors into // diags. *diags() << DgSqlCode(no) << DgString0(s); return TRUE;}
开发者ID:XueminZhu,项目名称:incubator-trafodion,代码行数:10,
示例17: scanner// match a terminal symbol tvoid ExtQualModuleNames::match(tokenType t){ if (nextToken() == t) { // matches t. all is OK. currentTokenCode_ = scanner(); // get next token } else { *mxCUMptr << FAIL << DgSqlCode(-2212) << DgString0(tokenString(t)) << DgString1(currentTokenString()); }}
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:11,
示例18: DgString0LmResult LmRoutineCppObj::invokeRoutine(void *inputRow, void *outputRow, ComDiagsArea *da){ // This type of routine does not support the old C interface, // must call invokeRoutineMethod instead *da << DgSqlCode(-11111) << DgString0("Called LmRoutineCppObj::invokeRoutine()"); return LM_ERR;}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:11,
示例19: DgString0void ExFastExtractTcb::updateWorkATPDiagsArea(const char *file, int line, const char *msg){ ComDiagsArea *da = workAtp_->getDiagsArea(); if(!da) { da = ComDiagsArea::allocate(getHeap()); workAtp_->setDiagsArea(da); } *da << DgSqlCode(-1001) << DgString0(file) << DgInt0(line) << DgString1(msg);}
开发者ID:sandhyasun,项目名称:incubator-trafodion,代码行数:15,
示例20: strcpy// LCOV_EXCL_START :cnuInt32 ValidateAnsiList::validate( const char *value, const NADefaults *nad, Int32 attrEnum, Int32 errOrWarn, float *) const{ // Validate using a copy of "*value" char tempStr[1000]; // max length of ATTR_VALUE if ( strlen(value) >= 1000 ) return FALSE; // just in case if ( strlen(value) == 0 ) return TRUE; // empty string ATTR_VALUE is OK strcpy(tempStr, value); // prepare to extract the partitions/tokens from the default string const char *token, *sep = " ,:" ; token = strtok( tempStr, sep ); // iterate thru list of volume names; return false iff any name is invalid // (Also an appropriate error/warning would be issued.) while ( token != NULL ) { NAString tokenObj(token); Int32 countPeriods = 0, inBetween = 0; NABoolean anyError = tokenObj.isNull() ; // check three part ANSI name for (Int32 i = 0; !anyError && i < (Int32)tokenObj.length() ; i++ ) { if ( ComSqlText.isDigit(token[i]) || ComSqlText.isSimpleLatinLetter(token[i]) ) inBetween++; else { if ( ComSqlText.getPeriod() == token[i] && // it is a period countPeriods++ < 2 ) { if ( inBetween == 0 ) anyError = TRUE; // no CATALOG or SCHEMA else inBetween = 0 ; // start counting the next ( SCHEMA or NAME ) } else anyError = TRUE; } } if ( countPeriods != 2 || inBetween == 0 ) anyError = TRUE; if ( anyError ) { if (errOrWarn) *CmpCommon::diags() << DgSqlCode(ERRWARN(2055)) << DgString0(token) << DgString1("INVALID QUALIFIED NAME"); return FALSE; } token = strtok( NULL, sep ); } return TRUE;}
开发者ID:qwertyioz,项目名称:incubator-trafodion,代码行数:49,
示例21: ExRaiseSqlErrorComDiagsArea *ExRaiseFunctionSqlError(CollHeap* heap, ComDiagsArea** diagsArea, ExeErrorCode err, NABoolean derivedFunction, OperatorTypeEnum origOperType, ComCondition** cond){ ExRaiseSqlError(heap, diagsArea, err); if (derivedFunction) { **diagsArea << DgSqlCode(-EXE_MAPPED_FUNCTION_ERROR); **diagsArea << DgString0(exClauseGetText(origOperType)); } return *diagsArea;}
开发者ID:apache,项目名称:incubator-trafodion,代码行数:16,
示例22: DgSqlCode// process -g {moduleGlobal|moduleLocal[=OSSdirectory]}Int32 Cmdline_Args::doModuleGlobalLocalDir(char *arg, Int32 argc, char **argv, Int32 &gCount, ComDiagsArea& diags){ Int32 result = 0; // at most one -g moduleBlah option is allowed if (gCount > 0) { diags << DgSqlCode(mxcmpUmAtMostOneoptionGisAllowed); cout << diags; usage(argc, argv); result = -1; } gCount++; // process -g {moduleGlobal|moduleLocal} char *eq = strchr(arg, '='); if (!eq) { // -g {moduleGlobal|moduleLocal} return doModuleGlobalLocal(arg, argc, argv, diags); } // else -g moduleLocal=OSSdirectory if (strlen(eq+1) >= 1024) { // OSSdirectory is too long diags << DgSqlCode(mxcmpUmOssDirectoryPathTooLong) << DgString0(eq+1); cout << diags; usage(argc, argv); result = -1; } else { // OSSdirectory < 1024 // verify we have -g moduleLocal=OSSdirectory Int32 kwdLen=(Int32)strlen("moduleLocal"); if (eq-arg == kwdLen && strncmp(arg,"moduleLocal",kwdLen)==0) { modulePlacement_ = MOD_LOCAL; // reject any Expand or Guardian path if (!strncmp(eq+1,"/E/",3) || !strncmp(eq+1,"/G/",3)) { diags << DgSqlCode(mxcmpUmModuleLocalSpecifyDir); cout << diags; usage(argc, argv); result = -1; } else { // copy OSSdirectory moduleDir_ = eq+1; } } else { diags << DgSqlCode(mxcmpUmUnsupportedArgumentInOptionG); cout << diags; usage(argc, argv); result = -1; } } return result;}
开发者ID:lanbb,项目名称:incubator-trafodion,代码行数:47,
示例23: text// validate parameter for MV_AGEInt32 ValidateMVAge::validate( const char *value, const NADefaults *nad, Int32 attrEnum, Int32 errOrWarn, float *alreadyHaveFloat ) const{ Int32 isOK = FALSE; float number=0; char textChars[20]; if (strlen(value) < 15) { if (sscanf(value, "%f %s", &number, textChars) == 2) { const NAString text(textChars); if (!text.compareTo("Seconds", NAString::ignoreCase)) { isOK = TRUE; } else if (!text.compareTo("Minutes", NAString::ignoreCase)) { isOK = TRUE; } else if (!text.compareTo("Hours", NAString::ignoreCase)) { isOK = TRUE; } else if (!text.compareTo("Days", NAString::ignoreCase)) { isOK = TRUE; } } } if (!isOK) { if (errOrWarn) *CmpCommon::diags() << DgSqlCode(ERRWARN(2055)) << DgString0(value) << DgString1(nad->lookupAttrName(attrEnum, errOrWarn)); } return isOK;}
开发者ID:qwertyioz,项目名称:incubator-trafodion,代码行数:45,
注:本文中的DgString0函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ DiagBreak函数代码示例 C++ Dftype函数代码示例 |