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

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

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

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

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

示例1: main

int main (){  Any a2 = Int(1);  Any a3 = Int(3);  sr8tup a4 = { a2, a3 };  Any a5 = Int(4);  Any a6 = Int(8);  sr8tup a7 = { a5, a6 };  Any a8[] = {a4, a7};  Any a1 = a8;  Any a9 = Int(0);  Any a10 = Int(2);  a1[a9.i] = a10;  Any a15 = a1;  Any a14 = toStr ( a15 );  println ( a14 );  return 0;}
开发者ID:Matt--,项目名称:Whiley-wyce,代码行数:17,


示例2: loadXMLController

static void loadXMLController(unsigned int controller[], const char * name){	item = mxmlFindElement(xml, xml, "controller", "name", name, MXML_DESCEND);	if(item)	{		// populate buttons		for(int i=0; i < MAXJP; i++)		{			elem = mxmlFindElement(item, xml, "button", "number", toStr(i), MXML_DESCEND);			if(elem)			{				const char * tmp = mxmlElementGetAttr(elem, "assignment");				if(tmp)					controller[i] = atoi(tmp);			}		}	}}
开发者ID:askotx,项目名称:vba-wii,代码行数:19,


示例3: switch

void PromelaDataModel::setVariable(void* ast, Data value) {	PromelaParserNode* node = (PromelaParserNode*)ast;	std::list<PromelaParserNode*>::iterator opIter = node->operands.begin();	switch (node->type) {	case PML_VAR_ARRAY: {		PromelaParserNode* name = *opIter++;		PromelaParserNode* expr = *opIter++;		if (INVALID_ASSIGNMENT(name->value)) {			ERROR_EXECUTION_THROW("Cannot assign to " + name->value);		}		int index = dataToInt(evaluateExpr(expr));		if (_variables.compound.find(name->value) == _variables.compound.end()) {			ERROR_EXECUTION_THROW("No variable " + name->value + " was declared");		}		if (!_variables[name->value].hasKey("size")) {			ERROR_EXECUTION_THROW("Variable " + name->value + " is no array");		}		if (strTo<int>(_variables[name->value]["size"].atom) <= index) {			ERROR_EXECUTION_THROW("Index " + toStr(index) + " in array " + name->value + "[" + _variables[name->value]["size"].atom + "] is out of bounds");		}		_variables.compound[name->value].compound["value"][index] = value;		break;	}	case PML_NAME:		if (INVALID_ASSIGNMENT(node->value)) {			ERROR_EXECUTION_THROW("Cannot assign to " + node->value);		}		_variables.compound[node->value].compound["value"] = value;		break;	default:		break;	}//	std::cout << Data::toJSON(_variables) << std::endl;}
开发者ID:vogelsgesang,项目名称:uscxml,代码行数:43,


示例4: get181Validator

		string get181Validator(const string& mPackPath, const string& mLevelId, const string& mJsonRootPath, const string& mLuaScriptPath, float mDifficultyMultiplier)		{			string luaScriptContents{get181FileContents(mLuaScriptPath)}, result{""};			unordered_set<string> luaScriptNames;			recursiveFillIncludedLuaFileNames(luaScriptNames, mPackPath, luaScriptContents);			result.append(get181UrlEncoded(mLevelId));			result.append(get181MD5Hash(get181FileContents(mJsonRootPath) + serverKey182));			result.append(get181MD5Hash(luaScriptContents + serverKey182));			for(auto& luaScriptName : luaScriptNames)			{				string path{mPackPath + "/Scripts/" + luaScriptName}, contents{get181FileContents(path)}, hash{get181MD5Hash(contents + serverKey182)}, compressedHash{""};				for(unsigned int i{0}; i < hash.length(); ++i) if(i % 3 == 0) compressedHash.append(toStr(hash[i]));				result.append(compressedHash);			}			result.append(get181UrlEncoded(toStr(mDifficultyMultiplier))); return result;		}
开发者ID:ionagamed,项目名称:SSVOpenHexagon,代码行数:19,


示例5: contentScale

 TaskPtr Gem::updateCountdown() {     if(this->mCountdown == NULL ) return TaskIgnore::make();          auto pre = CCSpawn::create(CCScaleTo::create(0.25f, contentScale()*2),                                CCFadeTo::create(0.25f, 155),                                NULL);          auto rev = CCSpawn::create(CCScaleTo::create(0.25f, contentScale()),                                CCFadeTo::create(0.25f, 255),                                NULL);          auto action = CCCallLambda::create([=]()     {         this->mCountdown->setString(toStr(this->mTurn).c_str());     });     return TaskAnim::make(this->mCountdown,                           CCSequence::create(pre,rev,action,NULL), false); }
开发者ID:13609594236,项目名称:ph-open,代码行数:19,


示例6: PurpleEventContext

guint IMInvoker::purpleEventInputAdd(int fd, PurpleInputCondition cond, PurpleInputFunction func, gpointer data) {	PurpleEventContext* ctx = new PurpleEventContext();	ctx->function = NULL;	ctx->input = func;	ctx->inputFD = fd;	ctx->cond = cond;	ctx->data = data;	short opMask = 0;	if (cond & PURPLE_INPUT_READ)		opMask |= DelayedEventQueue::DEQ_READ;	if (cond & PURPLE_INPUT_WRITE)		opMask |= DelayedEventQueue::DEQ_WRITE;	guint eventId = g_rand_int(_gRand);//	std::cout << "-- Input add " << eventId << " --------" << fd << std::endl;	_eventQueue->addEvent(toStr(eventId), fd, opMask, purpleCallback, ctx, true);	return eventId;}
开发者ID:juehv,项目名称:uscxml,代码行数:19,


示例7: main

int main (){  Any a2 = Int(1);  Any a3 = Int(2);  Any a4 = Int(3);  Any a5[] = {a2, a3, a4};  Any *a1 = a5;  Any a7 = Real(4.23);  Any a8 = Real(5.5);  Any a9[] = {a7, a8};  Any *a6 = a9;  Any *a10 = a6;  Any *a11 = a1;  #### appending arrays not yet catered for;  a6 = Null();  Any a17 = a6;  Any a16 = toStr ( a17 );  println ( a16 );  return 0;}
开发者ID:Matt--,项目名称:Whiley-wyce,代码行数:19,


示例8: toStr

TQString TQtRegExpConverter::toString( RepeatRegExp* regexp, bool markSelection ){    RegExp* child = regexp->child();    TQString cText = toStr( child, markSelection );    TQString startPar;    TQString endPar;    if ( markSelection ) {        if ( !regexp->isSelected() && child->isSelected()) {            startPar = TQString::fromLatin1( "(" );            endPar = TQString::fromLatin1( ")" );        }        else if ( child->precedence() < regexp->precedence() ) {            startPar = TQString::fromLatin1( "(?:" );            endPar = TQString::fromLatin1( ")" );        }    }    else if ( child->precedence() < regexp->precedence() ) {        startPar = TQString::fromLatin1( "(" );        endPar = TQString::fromLatin1( ")" );    }    if ( regexp->min() == 0 && regexp->max() == -1) {        return startPar + cText +endPar + TQString::fromLocal8Bit("*");    }    else if ( regexp->min() == 0 && regexp->max() == 1 ) {        return startPar + cText + endPar + TQString::fromLocal8Bit("?");    }    else if ( regexp->min() == 1 && regexp->max() == -1 ) {        return startPar + cText + endPar + TQString::fromLocal8Bit("+");    }    else if ( regexp->max() == -1 ) {        return startPar + cText + endPar + TQString::fromLocal8Bit("{") +            TQString::number( regexp->min() ) + TQString::fromLocal8Bit(",") +            TQString::fromLocal8Bit("}");    }    else {        return startPar + cText + endPar + TQString::fromLocal8Bit("{") +            TQString::number( regexp->min() ) + TQString::fromLocal8Bit(",") +            TQString::number( regexp->max() ) + TQString::fromLocal8Bit("}");    }}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:42,


示例9: lock

void RTPPublisher::removed(const SubscriberStub& sub, const NodeStub& node) {	RScopeLock lock(_mutex);	int status;	std::string ip = sub.getIP();	uint16_t port = sub.getPort();	if (!ip.length())		//only use separate subscriber ip (for multicast support etc.), if specified		ip = node.getIP();	// do we now about this sub via this node?	bool subscriptionFound = false;	std::pair<_domainSubs_t::iterator, _domainSubs_t::iterator> subIter = _domainSubs.equal_range(sub.getUUID());	while(subIter.first !=  subIter.second) {		if (subIter.first->second.first.getUUID() ==  node.getUUID()) {			subscriptionFound = true;			break;		}		subIter.first++;	}	if (!subscriptionFound)		return;	UM_LOG_INFO("%s: lost a %s subscriber (%s:%u) for channel %s", SHORT_UUID(_uuid).c_str(), sub.isMulticast() ? "multicast" : "unicast", ip.c_str(), port, _channelName.c_str());	struct libre::sa addr;	libre::sa_init(&addr, AF_INET);	if ((status = libre::sa_set_str(&addr, ip.c_str(), port)))		UM_LOG_WARN("%s: error %d in libre::sa_set_str(%s:%u): %s", SHORT_UUID(_uuid).c_str(), status, ip.c_str(), port, strerror(status));	else		_destinations.erase(ip+":"+toStr(port));	if (_domainSubs.count(sub.getUUID()) ==  1) { // about to vanish		if (_greeter !=  NULL) {			Publisher pub(Publisher(StaticPtrCast<PublisherImpl>(shared_from_this())));			_greeter->farewell(pub, sub);		}		_subs.erase(sub.getUUID());	}	_domainSubs.erase(subIter.first);	UMUNDO_SIGNAL(_pubLock);}
开发者ID:DrHausel,项目名称:umundo,代码行数:41,


示例10: toStr

shared_ptr<ParseResult> Choice::match(TokenBuffer &buffer){    QStringList errs;    for(int i=0; i<res.count(); i++)    {        shared_ptr<Parser> p = res[i];        TokenBuffer::State s;        buffer.saveState(s);        shared_ptr<ParseResult> result = p->match(buffer);        if(result->success())            return result;        errs.append(result->toPartialString());        buffer.restoreState(s);    }    QString found = buffer.eof()? "EOF" : toStr(buffer.readAhead());    shared_ptr<ExpectedOneOf> err = expectedOneOf(buffer.GetPos(), found);    err->what += errs;    return err;}
开发者ID:samiz,项目名称:smallprolog,代码行数:21,


示例11: main

int main (){  Any a3 = Int(2);  Any a4 = neg(a3);  Any a5 = Int(3);  Any a6 = neg(a5);  Any a7 = Int(1);  Any a8 = Int(2);  Any a9 = Int(23);  Any a10 = neg(a9);  Any a11 = Int(3);  Any a12 = Int(2345);  Any a13 = Int(4);  Any a14 = Int(5);  Any a15[] = {a4, a6, a7, a8, a10, a11, a12, a13, a14};  Any a2 = extract ( a15 );  Any a1 = a2;  Any a20 = a1;  Any a19 = toStr ( a20 );  println ( a19 );  return 0;}
开发者ID:Matt--,项目名称:Whiley-wyce,代码行数:21,


示例12: main

int main (){  Any a2, a3, a4;	a2 = Int(4);  a3 = Int(5);  a4 = Tuple( a2, a3);	// current state of a2, pointed to by a4.ptr[0] 	printf("/n/n");	Any* x_address = ((Any**)a4.ptr)[0];		printf ("x address is %d/n", x_address);		printf ("x is %d/n", x_address->i);	//==========================================	// the method pass	//==========================================  printf("-----enter method-----/n");  toStr ( a4 );  printf("/n/n/n");  return;}
开发者ID:Matt--,项目名称:wyce,代码行数:21,


示例13: main

int main (){  Any a2 = Byte(00000000b);  Any a3 = Byte(00000101b);  Any a4 = Byte(00000000b);  Any a5 = Byte(00000110b);  Any a6 = Byte(00000000b);  Any a7 = Byte(00000101b);  Any a8[] = {a2, a3, a4, a5, a6, a7};  Any a12 = Int(0);  Any a14 = Int( sizeof( a8 ) / sizeof( a8[0] ) );  Any a15 = Int(2);  Any a16 = sub( a14 , a15);  Any a22 = Int(0);  a22 = Int(0);  Any a10 = match ( a8, a12, a16 );  Any a9 = a10;  Any a21 = a9;  Any a20 = toStr ( a21 );  println ( a20 );  return 0;}
开发者ID:Matt--,项目名称:Whiley-wyce,代码行数:21,


示例14: trackingModeName

void DetectionParameters::writeToStream(std::ostream& os) {    // Only write the parameters that are set by model options    // these are the options that a user can set    os << "/tcachesize:" << itsSizeAvgCache;    os << "/tminarea:" << itsMinEventArea << "/tmaxarea:" << itsMaxEventArea;    os << "/ttrackingmode:" << trackingModeName(itsTrackingMode);     os << "/tsegmentalgorithminputimagetype:" << segmentAlgorithmInputImageType(itsSegmentAlgorithmInputType);    os << "/tsegmentalgorithmtype:" << segmentAlgorithmType(itsSegmentAlgorithmType);    os << "/tsegmentadaptiveparameters:" << itsSegmentAdaptiveParameters;    os << "/tsaliencyinputimagetype:" << saliencyInputImageType(itsSaliencyInputType);    os << "/tusefoamaskregion:" << itsUseFoaMaskRegion;    os << "/tsaliencyrescale:" << toStr(itsRescaleSaliency);    os << "/tsegmentgraphparameters:" << itsSegmentGraphParameters;    os << "/txkalmanfilterparameters:" << itsXKalmanFilterParameters;    os << "/tykalmanfilterparameters:" << itsYKalmanFilterParameters;    os << "/tcleanupelementsize:" << itsCleanupStructureElementSize;    os << "/tminframes:" << itsMinEventFrames;    os << "/tmaxframes:" << itsMaxEventFrames;    os << "/tmaxdist:" << itsMaxDist;    os << "/tsaliencyframedist:" << itsSaliencyFrameDist;    os << "/tmaxcost:" << itsMaxCost;    os << "/tmaxevolvetime(msecs):" << itsMaxEvolveTime;    os << "/tmaxwtapoints:" << itsMaxWTAPoints;    os << "/tsavenoninteresting:" << itsSaveNonInteresting;    os << "/tsaveoriginalframespec:" << itsSaveOriginalFrameSpec;    os << "/taddgraphpoints:" << itsMaskLasers;    os << "/tcolorspace:" << colorSpaceType(itsColorSpaceType);    os << "/tminstddev:" << itsMinStdDev;    os << "/teventexpirationframes:" << itsEventExpirationFrames;    os << "/tdynamicmask:" << itsMaskDynamic;    if (itsMaskPath.length() > 0) {        os << "/tmaskpath:" << itsMaskPath;        os << "/tmaskxposition:" << itsMaskXPosition;        os << "/tmaskyposition:" << itsMaskYPosition;        os << "/tmaskwidth:" << itsMaskWidth;        os << "/tmaskheight:" << itsMaskHeight;    }    os << "/n";}
开发者ID:binary42,项目名称:avedac,代码行数:40,


示例15: mkdir

  bool KineticEnergyTypesData::writeToFile(string fileName, bool useName) {    // The name of the directory for this data    string dirName = fileName;    if (*fileName.rbegin()=='/') // Make sure there is a /      dirName += dataName+"/";    else       dirName += ("/"+dataName+"/");    // Write the data    // Create a directory for all the data    mkdir(dirName.c_str(), 0777);    for (int ty=0; ty<ntypes; ++ty) {      ofstream fout(dirName+dataName+toStr(ty)+".csv");      if (fout.fail()) return false;      for (auto ke : keData[ty])        fout << ke.first << "," << ke.second << endl;      fout.close();    }    // Return success    return true;  }
开发者ID:nrupprecht,项目名称:GFlow,代码行数:22,


示例16: catch

std::string XPathDataModel::evalAsString(const std::string& expr) {    XPathValue<std::string> result;    try {        result = _xpath.evaluate_expr(expr, _doc);    } catch(SyntaxException e) {        ERROR_EXECUTION_THROW(e.what());    } catch(std::runtime_error e) {        ERROR_EXECUTION_THROW(e.what());    }    switch (result.type()) {    case STRING:        return result.asString();        break;    case Arabica::XPath::BOOL: // MSVC croaks with ambiguous symbol without qualified name        return (result.asBool() ? "true" : "false");        break;    case NUMBER:        return toStr(result.asNumber());        break;    case NODE_SET: {        NodeSet<std::string> nodeSet = result.asNodeSet();        std::stringstream ss;        for (size_t i = 0; i < nodeSet.size(); i++) {            ss << nodeSet[i];            if (nodeSet[i].getNodeType() != Node_base::TEXT_NODE) {                ss << std::endl;            }        }        return ss.str();        break;    }    case ANY:        ERROR_EXECUTION_THROW("Type ANY not supported to evaluate as string");        break;    }    return "undefined";}
开发者ID:juehv,项目名称:uscxml,代码行数:38,


示例17: lock

/** * A ServiceManager was removed. */void ServiceManager::farewell(Publisher& pub, const SubscriberStub& subStub) {	RScopeLock lock(_mutex);	UM_LOG_INFO("removed remote ServiceManager - notifying", _localQueries.size());	// did this publisher responded to our queries before?	if (_remoteSvcDesc.find(subStub.getUUID()) != _remoteSvcDesc.end()) {		// check all local queries if the remote services matched and notify about removal		std::map<ServiceFilter, ResultSet<ServiceDescription>*>::iterator queryIter = _localQueries.begin();		while(queryIter != _localQueries.end()) {			std::map<std::string, ServiceDescription>::iterator remoteSvcIter = _remoteSvcDesc[subStub.getUUID()].begin();			while(remoteSvcIter != _remoteSvcDesc[subStub.getUUID()].end()) {				if (queryIter->first.matches(remoteSvcIter->second)) {					queryIter->second->remove(remoteSvcIter->second, toStr(this));				}				remoteSvcIter++;			}			queryIter++;		}	}	_remoteSvcDesc.erase(subStub.getUUID());}
开发者ID:DrHausel,项目名称:umundo,代码行数:26,


示例18: writeVectorToDirectory

  //! /param dirName is the name of the directory that we should create our new directory of data in  //! /param fileName is the name of the new directory, and the files in that directory are called [fileName][#].csv  bool writeVectorToDirectory(vector<RealType*>& record, const vector<int>& elements,     int width, string dirName, const string fileName)   {    // Create the directory    if (*dirName.rbegin()=='/') // Make sure there is a /      dirName += fileName+"/";    else       dirName += ("/"+fileName+"/");    // --> Dir name is now the name of the directory we are creating    // Create a directory for all the data    mkdir(dirName.c_str(), 0777);    // Create the data files in the directory    for (uint iter=0; iter<record.size(); ++iter) {      // The name of the file for this data      string subfile = dirName+fileName+toStr(iter)+".csv";      // Create the file [fileName] (inside directory [dirName]) containing the data from record.at(iter)      if (!writeArrayDataToFile(record.at(iter), elements.at(iter), width, subfile)) return false;    }    // Return success    return true;  }
开发者ID:nrupprecht,项目名称:GFlow,代码行数:25,


示例19: toStr

	void HexagonGame::drawText()	{		ostringstream s;		s << "time: " << toStr(status.currentTime).substr(0, 5) << endl;		if(getOfficial()) s << "official mode" << endl;		if(getDebug()) s << "debug mode" << endl;		if(status.scoreInvalid) s << "score invalidated (performance issues)" << endl;		if(status.hasDied) s << "press r to restart" << endl;		Vector2f pos{15, 3};		vector<Vector2f> offsets{{-1, -1}, {-1, 1}, {1, -1}, {1, 1}};		Color offsetColor{getColor(1)};		if(getBlackAndWhite()) offsetColor = Color::Black;		text.setString(s.str());		text.setCharacterSize(25 / getZoomFactor());		text.setOrigin(0, 0);		text.setColor(offsetColor);		for(const auto& o : offsets) { text.setPosition(pos + o); render(text); }		text.setColor(getColorMain());		text.setPosition(pos);		render(text);				if(messageTextPtr == nullptr) return;		text.setString(messageTextPtr->getString());		text.setCharacterSize(messageTextPtr->getCharacterSize());		text.setOrigin(text.getGlobalBounds().width / 2, 0);		text.setColor(offsetColor);		for(const auto& o : offsets) { text.setPosition(messageTextPtr->getPosition() + o); render(text); }		messageTextPtr->setColor(getColorMain());		render(*messageTextPtr);	}
开发者ID:richo,项目名称:SSVOpenHexagon,代码行数:37,


示例20: Antidote

    Physostigmine::Physostigmine(double age, double height, double weight) : Antidote(age, height, weight) {        a = "Physostigmine Antidote Algorithm /n",        b = string("As a secondary treatment of anticholinergic syndrome.  ") + FDA + "/n/n",        c = "";//getRef();        Question *physWarning = new Question(a+b+                                             "Warning: Physostigmine Salicylate Injection should not be used in the " +                                             "presence of asthma, gangrene, diabetes, cardiovascular disease, mechanical " +                                             "obstruction of the intestine or urogenital tract or any vagotonic state, " +                                             "and in patients receiving choline esters and depolarizing neuromuscular " +                                             "blocking agents (decamethonium, succinylcholine).Patient must have normal " +                                             "QRS on ECG to receive physostigmine.");        physWarning->setType("warning");        insertToMap("physWarning", physWarning);                Question *physChildWarning = new Question(a+b+                                                  "Administration of physostigmine in children should reserved for " +                                                  "life-threatening conditions.");        physChildWarning->setType("warning");        insertToMap("physChildWarning", physChildWarning);                string physChild = a+b+        "Recommended dosage is "+toStr(physCalcChild())+"mg (0.02 mg/kg max 2mg) of physostigmine intramuscularly or by " +        "slow intravenous injection, no more than 0.5 mg per minute. If the toxic " +        "effects persist, and there is no sign of cholinergic effects, the dosage may " +        "be repeated at 5 to 10 minute intervals until a therapeutic effect is " +        "obtained or a maximum of 2 mg dosage is attained."+c;        insertToMap("physChild", physChild);                string physAdult = a+b+        "Adult dosing: When administering IV give no faster than 1mg/minute to avoid " +        "adverse events.  Recommended dosage 0.5-2mg IV,IM.  May repeat every 10-30 " +        "minutes until desired response."+c;        insertToMap("physAdult", physAdult);            }
开发者ID:jasonlu,项目名称:libAntidote,代码行数:36,


示例21: assert

void LogicAnalyzerDisplay::populateChannel(const int channel, const Pothos::Packet &packet){    //convert buffer (does not convert when type matches)    const auto numericBuff = packet.payload.convert(typeid(T));    assert(_chData.size() > channel);    _chData[channel] = packet;    _chData[channel].payload = numericBuff;    //load element data into table    for (size_t i = 0; i < numericBuff.elements(); i++)    {        const auto num = numericBuff.as<const T *>()[i];        const auto s = toStr(num, _chBase.at(channel));        auto item = new QTableWidgetItem(s);        auto flags = item->flags();        flags &= ~Qt::ItemIsEditable;        item->setFlags(flags);        item->setTextAlignment(Qt::AlignRight);        _tableView->setItem(channel, i, item);    }    //inspect labels to decorate table    for (const auto &label : packet.labels)    {        const int column = label.index;        assert(column < _tableView->columnCount());        auto item = _tableView->item(channel, column);        //highlight and display label id        item->setBackground(Qt::yellow);        item->setText(QString("%1/n%2")            .arg(item->text())            .arg(QString::fromStdString(label.id)));        _tableView->resizeColumnToContents(column);    }}
开发者ID:m0x72,项目名称:pothos,代码行数:36,


示例22: getTime

SimpleLogger::SimpleLogger(enum LogLevel ll, char const* filename, int line, bool lBreak){    struct OutputSettings settings = outputSettings[ll];    level = ll;    lineBreak = lBreak;    if (settings.enableTime)        ostr << "[" << getTime() << "] ";    if (settings.enableLevel)        ostr << "[" << toStr(ll) << "] ";    if (settings.enableSource)        ostr << filename << ":" << line << " ";    if (logger) {        t = getTime();        std::ostringstream oss;        oss << filename;        if(line >= 0)        {            oss << ":" << line;        }        fname = oss.str();    }}
开发者ID:hnkien,项目名称:sdk,代码行数:24,


示例23: printNode

void printNode(Node * a){	static int startOfList = 1;	if (a == NULL) return ;	switch (a->type) {		case SYMBOL : printf("%s", refer2Str(toSym(a)->name)); 	  break;		case STR    : printf("%s", refer2Str(toStr(a)->name)); 	  break;		case NUMBER : printf("%d", toNum(a)->value); 			  break;		case ATOM	: printf("/'%s", refer2Str(toAtom(a)->name)); break;		case BOOL	: printf("#%c",toBool(a)->value == 0 ? 'f' : 't'); break;		case LIST   : 			if (a == (Node *) &nil) {				printf("()"); 				break; 			}			if (startOfList) printf("(");			startOfList = 1;			printNode(car(a));			startOfList = 0;			if (toList(a)->cdr == &nil) printf(")");			else printf(" "), printNode(cdr(a));			startOfList = 1;			break;		case PAIR   :			printf("(");			printNode(car(a));			printf(" . ");			printNode(cdr(a));			printf(")");			break;		case PROC   :			printf("#<procedure :>" );		default : ;	}}
开发者ID:keroro520,项目名称:Compiler_NirLauncher,代码行数:36,


示例24: getType

void Pragma::dump(std::ostream& out, const clang::SourceManager& sm) const {	out << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/n" <<		   "|~> Pragma: " << getType() << " -> " << std::flush << toStr(sm) << "/n";}
开发者ID:VasiliadisVasilis,项目名称:clomp,代码行数:4,


示例25: toStr

string tensorEntryToExpression::toExpr(const entry &e){    const primitiveEntry &pe=dynamicCast<const primitiveEntry&>(e);    return toStr(tensor(pe.stream()),"tensor");}
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Breeder2.0-libraries-swak4Foam,代码行数:6,



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


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