这篇教程C++ typeToString函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中typeToString函数的典型用法代码示例。如果您正苦于以下问题:C++ typeToString函数的具体用法?C++ typeToString怎么用?C++ typeToString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了typeToString函数的22个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: isValidIOProcInvocationintisValidIOProcInvocation(Symbol *s, struct ElementArray *ea){ Symbol *param = NULL; type_t type; int i, nArgs, valid = 1; nArgs = ea->nElements; // TODO use is isElementArraySimple() to do type checking? for (i = 0; i < nArgs; i++) { param = ((struct treeNode *)getElementAt(ea, i))->symbol; type = getType(param); if (!isArgTypeValidInIOFunc(s, param)) { errMsg = customErrorString("Invalid argument " "of type %s passed to procedure %s.", typeToString(type), s->name); recordError(errMsg, yylineno, colno, SEMANTIC); valid = 0; } } if (!valid) return 0; return 1;}
开发者ID:a-krebs,项目名称:YACC,代码行数:25,
示例2: customErrorString/* ea is an array of nodes now */ProxySymbol *isValidPreDefFuncInvocation(Symbol *s, struct ElementArray *ea){ Symbol *param = NULL; Symbol * type; int i = 0; int nArgs = 0; nArgs = ea->nElements; // check argument count if (nArgs != 1) { errMsg = customErrorString("Function %s expected " "1 argument but %d given.", s->name, nArgs); recordError(errMsg, yylineno, colno, SEMANTIC); return 0; } param = ((struct treeNode *)getElementAt(ea, i))->symbol; type = getTypeSym(param); if (isArgTypeValidInPreDefFunc(s, param)) { return getPreDefFuncReturnType(s, type); } else { errMsg = customErrorString("Function %s cannot be " "called with argument of type %s.", s->name, typeToString(getType(type))); recordError(errMsg, yylineno, colno, SEMANTIC); return 0; }}
开发者ID:a-krebs,项目名称:YACC,代码行数:32,
示例3: ofSetColorvoid ofApp::draw(){ ofSetColor(255, 255, 255, alpha); if((type==MOVIE)&&(state!=STOPPED)) { videoPlayer.draw(x, y, w, h); } else if((type==IMAGE)&&(state!=STOPPED)) { stillImage.draw(x, y, w, h); } else if(type==NOTFOUND) { ofSetHexColor(0xFFFFFF); ofDrawBitmapString("file '"+fileName+"' not found!", 300, 300); } if(info) { ofSetHexColor(0xFFFFFF); ofDrawBitmapString("listening on port: "+ofToString(PORT), 30, 30); ofDrawBitmapString("last osc: "+message, 30, 50); ofDrawBitmapString("screen resolution: "+ofToString(ofGetScreenWidth())+"x"+ofToString(ofGetScreenHeight()), 30, 70); ofDrawBitmapString("framerate: "+ofToString(ofGetFrameRate()), 30, 90); ofDrawBitmapString("fileName: "+fileName, 30, 110); ofDrawBitmapString("media type: "+typeToString(type), 30, 130); ofDrawBitmapString("media resolution: "+ofToString(ow)+"x"+ofToString(oh), 30, 150); ofDrawBitmapString("mode: "+modeToString(mode), 30, 170); ofDrawBitmapString("loopMode: "+ofToString(loopMode), 30, 190); ofDrawBitmapString("frames: "+ofToString(frames), 30, 210); ofDrawBitmapString("speed: "+ofToString(speed), 30, 230); ofDrawBitmapString("alpha: "+ofToString(alpha), 30, 250); ofDrawBitmapString("state: "+stateToString(state), 30, 270); }}
开发者ID:redFrik,项目名称:yetanotheroscmovieplayer,代码行数:27,
示例4: qWarningbool Collection::loadXML(const QDomElement& root){ if (root.tagName() != KXMLQLCFunction) { qWarning() << Q_FUNC_INFO << "Function node not found"; return false; } if (root.attribute(KXMLQLCFunctionType) != typeToString(Function::Collection)) { qWarning() << Q_FUNC_INFO << root.attribute(KXMLQLCFunctionType) << "is not a collection"; return false; } /* Load collection contents */ QDomNode node = root.firstChild(); while (node.isNull() == false) { QDomElement tag = node.toElement(); if (tag.tagName() == KXMLQLCFunctionStep) addFunction(tag.text().toInt()); else qWarning() << Q_FUNC_INFO << "Unknown collection tag:" << tag.tagName(); node = node.nextSibling(); } return true;}
开发者ID:bekiS,项目名称:qlcplus,代码行数:31,
示例5: printHashtablevoid printHashtable(Hashtable *env, char* buf2) { int i; char typeNameBuf[128]; sprintf(buf2, "len: %d/n", env->len); int k = 0; for (i = 0; i < env->size; i++) { struct bucket *b = env->buckets[i]; while (b != NULL) { Res *res = (Res *) b->value; if (k != 0)strncat(buf2, "/n", MAX_NAME_LEN - strlen(buf2)); strncat(buf2, b->key, MAX_NAME_LEN - strlen(buf2)); strncat(buf2, "=", MAX_NAME_LEN - strlen(buf2)); if (res == NULL) { strncat(buf2, "<null>", MAX_NAME_LEN - strlen(buf2)); } else { char *buf4 = convertResToString(res); strncat(buf2, buf4, MAX_NAME_LEN - strlen(buf2)); strncat(buf2, ":", MAX_NAME_LEN - strlen(buf2)); strncat(buf2, res->exprType == NULL? "<null>" : typeToString(res->exprType, NULL, typeNameBuf, 128), MAX_NAME_LEN - strlen(buf2)); free(buf4); } k++; b = b->next; } }}
开发者ID:iPlantCollaborativeOpenSource,项目名称:iRODS3.2-custom,代码行数:26,
示例6: QStringQString Function::path(bool simplified) const{ if (simplified == true) return m_path; else return QString("%1/%2").arg(typeToString(type())).arg(m_path);}
开发者ID:basileus,项目名称:qlcplus,代码行数:7,
示例7: typeToString//// Name: reportError()// Discription: This helper function is used to output a error in a common way// accross all instructions.// Parameters: char* error - The error to ouput.// int* num - If num is non NULL it will be printed directly after// the error.// Returns: void//void Instruction::reportError(const char *error, int *num) { cerr << "Line:" << lineNumber << " Command:" << typeToString(type) << " Error: " << error ; if (num != NULL) { cerr << (*num); } cerr << endl;}
开发者ID:icefox,项目名称:smada,代码行数:17,
示例8: QStringQDebug operator<<(QDebug dbg, const CoverInfo& info) { return dbg.maybeSpace() << QString("CoverInfo(%1,%2,%3,%4,%5,%6)") .arg(typeToString(info.type)) .arg(sourceToString(info.source)) .arg(info.coverLocation) .arg(QString::number(info.hash)) .arg(info.trackLocation);}
开发者ID:abhinavtankha,项目名称:mixxx,代码行数:8,
示例9: isValidFuncInvocationSymbol *isValidFuncInvocation(Symbol *s, struct ElementArray *ea){ struct ElementArray *params = NULL; Symbol *passedParam, *expectedParam = NULL; int i; // make sure we're given a func and not a proc if (s->kind != FUNC_KIND) { errMsg = customErrorString("Identifier %s cannot be " "called as a function.", s->name); e = recordError(errMsg, yylineno, colno, SEMANTIC); return 0; } params = s->kindPtr.FuncKind->params; if (!params) { // special case of predefined-function // TODO check what types are acceptable, // for now assuming all types return getTypeSym(s); } else if (params->nElements != ea->nElements) { errMsg = customErrorString("Procedure %s expects %d " "parameters, got %d", s->name, params->nElements, ea->nElements); e = recordError(errMsg, yylineno, colno, SEMANTIC); return NULL; } // TODO: should'nt call to is areSameType below be a call to // are assignment compatible? for (i = 0; i < params->nElements; i++) { passedParam = ((struct treeNode *)getElementAt(ea, i))->symbol; expectedParam = (Symbol *) getElementAt(params, i); if (!isAssignmentCompat(expectedParam,passedParam)) { errMsg = customErrorString("Procedure %s expects " "argument of type %s at index %d, but got " "argument of type %s", s->name, typeToString(getType(expectedParam)),i, typeToString(getType(passedParam))); e = recordError(errMsg, yylineno, colno, SEMANTIC); return NULL; } } return getTypeSym(s);}
开发者ID:a-krebs,项目名称:YACC,代码行数:46,
示例10: qWarningbool RGBMatrix::loadXML(const QDomElement& root){ if (root.tagName() != KXMLQLCFunction) { qWarning() << Q_FUNC_INFO << "Function node not found"; return false; } if (root.attribute(KXMLQLCFunctionType) != typeToString(Function::RGBMatrix)) { qWarning() << Q_FUNC_INFO << "Function is not an RGB matrix"; return false; } /* Load matrix contents */ QDomNode node = root.firstChild(); while (node.isNull() == false) { QDomElement tag = node.toElement(); if (tag.tagName() == KXMLQLCFunctionSpeed) { loadXMLSpeed(tag); } else if (tag.tagName() == KXMLQLCRGBAlgorithm) { setAlgorithm(RGBAlgorithm::loader(doc(), tag)); } else if (tag.tagName() == KXMLQLCRGBMatrixFixtureGroup) { setFixtureGroup(tag.text().toUInt()); } else if (tag.tagName() == KXMLQLCFunctionDirection) { loadXMLDirection(tag); } else if (tag.tagName() == KXMLQLCFunctionRunOrder) { loadXMLRunOrder(tag); } else if (tag.tagName() == KXMLQLCRGBMatrixStartColor) { setStartColor(QColor::fromRgb(QRgb(tag.text().toUInt()))); } else if (tag.tagName() == KXMLQLCRGBMatrixEndColor) { setEndColor(QColor::fromRgb(QRgb(tag.text().toUInt()))); } else { qWarning() << Q_FUNC_INFO << "Unknown RGB matrix tag:" << tag.tagName(); } node = node.nextSibling(); } return true;}
开发者ID:Boudewijn26,项目名称:qlcplus,代码行数:58,
示例11: typeToStringstd::string Scene::Mesh::toString() const { return tfm::format( "Mesh[/n" " type = %s,/n" " filename = %s/n" "]", typeToString(type), filename );}
开发者ID:Seashell2011,项目名称:pbsproject,代码行数:9,
示例12: typeToStringint Stats::getTypeCount(type_t t) { std::string k = typeToString(t); if (stats_.find(k) == stats_.end()) { return -1; } else { return stats_[k]; }}
开发者ID:jordond,项目名称:pokerhands,代码行数:9,
示例13: check_failed_MatTypevoid check_failed_MatType(const int v, const CheckContext& ctx){ std::stringstream ss; ss << ctx.message << ":" << std::endl << " '" << ctx.p2_str << "'" << std::endl << "where" << std::endl << " '" << ctx.p1_str << "' is " << v << " (" << typeToString(v) << ")"; cv::errorNoReturn(cv::Error::StsError, ss.str(), ctx.func, ctx.file, ctx.line);}
开发者ID:adamrankin,项目名称:opencv,代码行数:9,
示例14: typeToStringvoid SemanticAnalyzer::visit(AssignStatement& node){ std::string varName = node.varID; for(unsigned i=0; i<symbolTable.size(); i++) { if(!symbolTable.at(i).name.compare(varName)) { ValueType type = node.expression->typeCheck(*this); if(symbolTable.at(i).declType != type) { std::cout << "Trying to assign type " << typeToString(type) << " to type " << typeToString(symbolTable.at(i).declType) << " at line " << node.lineNumber << "." << std::endl; errors = true; }; symbolTable.at(i).type = type; } }};
开发者ID:jlonardi,项目名称:Mini-PL-front-end,代码行数:18,
示例15: isValidProcInvocation/* * Return 1 if valid invocation, 0 otherwise. */int isValidProcInvocation(Symbol *s, struct ElementArray *ea){ struct ElementArray *params = NULL; Symbol *passedParam, *expectedParam = NULL; int i; // make sure we're given a proc and not a func or any other symbol if (s->kind != PROC_KIND) { errMsg = customErrorString("Identifier %s cannot be called " "as a procedure.", s->name); e = recordError(errMsg, yylineno, colno, SEMANTIC); return 0; } params = s->kindPtr.ProcKind->params; if (!params) { // special built-in proc that takes unlimited args // TODO for now just assuming all arguments are valid return 1; } else if (params->nElements != ea->nElements) { errMsg = customErrorString("Procedure %s expects %d " "parameters, got %d", s->name, params->nElements, ea->nElements); e = recordError(errMsg, yylineno, colno, SEMANTIC); return 0; } for (i = 0; (i < params->nElements) && (i < ea->nElements); i++) { passedParam = ((struct treeNode *)getElementAt(ea, i))->symbol; expectedParam = (Symbol *) getElementAt(params, i); if (!isAssignmentCompat(expectedParam, passedParam)) { errMsg = customErrorString("Procedure %s expects " "argument of type %s at index %d, but got " "argument of type %s", s->name, typeToString(getType(expectedParam)), i, typeToString(getType(passedParam))); e = recordError(errMsg, yylineno, colno, SEMANTIC); return 0; } } return 1;}
开发者ID:a-krebs,项目名称:YACC,代码行数:46,
示例16: throwXmlDomElement* GridProperties::serializeToXmlDomElement() const throw (Exception){ if (!checkAttributesValidity()) throw LogicError(__FILE__, __LINE__); QScopedPointer<XmlDomElement> root(new XmlDomElement("grid_properties")); root->setAttribute("type", typeToString(mType)); root->setAttribute("interval", mInterval); root->setAttribute("unit", mUnit); return root.take();}
开发者ID:0xB767B,项目名称:LibrePCB,代码行数:10,
示例17: typeToString Status Value::get(double* val) const { if (_type != Double) { StringBuilder sb; sb << "Attempting to get Value as type: Double, but Value is of type: " << typeToString(); return Status(ErrorCodes::TypeMismatch, sb.str()); } *val = _doubleVal; return Status::OK(); }
开发者ID:Krolcom,项目名称:mongo,代码行数:10,
示例18: checkAttributesValiditybool FootprintPad::checkAttributesValidity() const noexcept{ if (mUuid.isNull()) return false; if (typeToString(mType).isEmpty()) return false; if (mWidth <= 0) return false; if (mHeight <= 0) return false; if (mDrillDiameter < 0) return false; if (mNames.value("en_US").isEmpty()) return false; if (!mDescriptions.contains("en_US")) return false; return true;}
开发者ID:nemofisch,项目名称:LibrePCB,代码行数:11,
示例19: SerializableItem_MapServerInfo_Zone::ServerInfo_Zone(const QString &_name, ZoneType _type, bool _hasCoords, int _cardCount, const QList<ServerInfo_Card *> &_cardList) : SerializableItem_Map("zone"){ insertItem(new SerializableItem_String("name", _name)); insertItem(new SerializableItem_String("zone_type", typeToString(_type))); insertItem(new SerializableItem_Bool("has_coords", _hasCoords)); insertItem(new SerializableItem_Int("card_count", _cardCount)); for (int i = 0; i < _cardList.size(); ++i) itemList.append(_cardList[i]);}
开发者ID:Zors,项目名称:Cockatrice,代码行数:11,
示例20: typeToString/* given a name and a functiontype, assembles a function signature */String FunctionMap::getFunctionSignature(const String name, const DataType* type) { /* this returns the whole type including return */ String signature = name + typeToString(&((*(type->subtypes))[0])); /* if there is an arrow in it, remove it */ int idx = signature.indexOf("->"); if (idx != -1) { signature = signature.substring(0, idx); } return signature;}
开发者ID:IanFinlayson,项目名称:tetra,代码行数:13,
示例21: typeToStringvoid SnarlNotifier::showMessage(Type type, const std::string& subject, const std::string& description, const boost::filesystem::path& picture, boost::function<void()> callback) { int timeout = (type == IncomingMessage || type == SystemMessage) ? DEFAULT_MESSAGE_NOTIFICATION_TIMEOUT_SECONDS : DEFAULT_STATUS_NOTIFICATION_TIMEOUT_SECONDS; int notificationID = snarl.EZNotify( typeToString(type).c_str(), subject.c_str(), description.c_str(), timeout, picture.string().c_str()); if (notificationID > 0) { notifications.insert(std::make_pair(notificationID, callback)); }}
开发者ID:pedrosorren,项目名称:swift,代码行数:12,
示例22: json_packjson_t *CalaosEvent::toJson() const{ json_t *ret; ret = json_pack("{s:s, s:s, s:s, s:o}", "event_raw", toString().c_str(), "type", Utils::to_string(getType()).c_str(), "type_str", typeToString(getType()).c_str(), "data", evParams.toJson()); return ret;}
开发者ID:expertisesolutions,项目名称:calaos_base,代码行数:12,
注:本文中的typeToString函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ type_alloc函数代码示例 C++ typeString函数代码示例 |