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

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

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

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

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

示例1: pointerDump

void Value::deepDump(PrintStream& out) const{    out.print(m_type, " ", *this, " = ", m_opcode);    out.print("(");    CommaPrinter comma;    for (Value* child : children())        out.print(comma, pointerDump(child));    if (m_origin)        out.print(comma, m_origin);    {        StringPrintStream stringOut;        dumpMeta(stringOut);        CString string = stringOut.toCString();        if (string.length())            out.print(comma, string);    }    {        CString string = toCString(effects());        if (string.length())            out.print(comma, string);    }    out.print(")");}
开发者ID:happyyang,项目名称:webkit,代码行数:28,


示例2: run

 bool run() {     ASSERT(m_graph.m_form == SSA);          // Liveness is a backwards analysis; the roots are the blocks that     // end in a terminal (Return/Throw/ThrowReferenceError). For now, we     // use a fixpoint formulation since liveness is a rapid analysis with     // convergence guaranteed after O(connectivity).          // Start by assuming that everything is dead.     for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {         BasicBlock* block = m_graph.block(blockIndex);         if (!block)             continue;         block->ssa->liveAtHead.clear();         block->ssa->liveAtTail.clear();     }          do {         m_changed = false;         for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;)             process(blockIndex);     } while (m_changed);          if (!m_graph.block(0)->ssa->liveAtHead.isEmpty()) {         DFG_CRASH(             m_graph, nullptr,             toCString(                 "Bad liveness analysis result: live at root is not empty: ",                 nodeListDump(m_graph.block(0)->ssa->liveAtHead)).data());     }          return true; }
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:34,


示例3: toCString

OsFile& OsFile::operator <<(float value){	char buf[128];	toCString(value, buf, lengthOf(buf), 7);	write(buf, stringLength(buf));	return *this;}
开发者ID:Fergus1986,项目名称:LumixEngine,代码行数:7,


示例4: parseMetaInformation

/* * Constructs a SegmentMeta object from a given sequence identifier * Returns TRUE if the sequence identifier could successfully be parsed * and FALSE otherwise. */bool parseMetaInformation(SegmentMeta& segMeta, seqan::CharString const & idString) {    std::stringstream s(std::string(toCString(idString)));    std::string text;    // (1) Parse the gene name    if (!std::getline(s, text, '|'))        return false;    segMeta.geneName = text;    // (2) Parse the segment type    if (!std::getline(s, text, '|'))        return false;    segMeta.segType = text;    // (3) Parse the segment id    if (!std::getline(s, text, '|'))        return false;    segMeta.segId = text;    // (4) Parse the allel    if (!std::getline(s, text, '|'))        return false;    segMeta.allel = text;    // (5) Parse the motif position    if (!std::getline(s, text, '|'))        return false;    char *t = new char[text.size()+1];    std::strcpy(t, text.c_str());    segMeta.motifPos = static_cast<unsigned>(std::atoi(t));    delete[] t;    return true;}
开发者ID:hammerlab,项目名称:imseq,代码行数:39,


示例5: toCString

OsFile& OsFile::operator <<(u32 value){	char buf[20];	toCString(value, buf, lengthOf(buf));	write(buf, stringLength(buf));	return *this;}
开发者ID:gunsafighter,项目名称:LumixEngine,代码行数:7,


示例6: writeBlockComma

void JsonSerializer::serializeArrayItem(int64_t value){	writeBlockComma();	char tmp[30];	toCString(value, tmp, 30);	m_file.write(tmp, (int32_t)strlen(tmp));	m_is_first_in_block = false;}
开发者ID:HoRangDev,项目名称:LumixEngine,代码行数:8,


示例7: writeBlockComma

void JsonSerializer::serializeArrayItem(float value){	writeBlockComma();	char tmp[20];	toCString(value, tmp, 20, 8);	m_file.write(tmp, stringLength(tmp));	m_is_first_in_block = false;}
开发者ID:Ghost-yc,项目名称:LumixEngine,代码行数:8,


示例8: v8utfstr

/* * convert Tizen style string form a V8 String<br> * if failed then return null.<br> * * caller must free */Tizen::Base::String* Util::toTizenStringN(const v8::Local<v8::String>& value) {    if ( value->Length() == 0 ) {        return new Tizen::Base::String();    }    v8::String::Utf8Value v8utfstr( value->ToObject() );    const char *pValue = toCString( v8utfstr );    return new Tizen::Base::String( pValue );}
开发者ID:bylee,项目名称:cantata-jsbind,代码行数:15,


示例9: reportException

// from:        https://github.com/v8/v8-git-mirror/blob/master/samples/shell.cc// v3.15 from:  https://chromium.googlesource.com/v8/v8.git/+/3.14.5.9/samples/shell.ccvoid reportException(v8::TryCatch* _tryCatch){	v8::HandleScope handle_scope;	v8::String::Utf8Value exception(_tryCatch->Exception());	char const* exceptionString = toCString(exception);	v8::Handle<v8::Message> message = _tryCatch->Message();	// V8 didn't provide any extra information about this error; just	// print the exception.	if (message.IsEmpty())		printf("%s/n", exceptionString);	else	{		// Print (filename):(line number): (message).		v8::String::Utf8Value filename(message->GetScriptResourceName());		char const* filenameString = toCString(filename);		int linenum = message->GetLineNumber();		printf("%s:%i: %s/n", filenameString, linenum, exceptionString);		// Print line of source code.		v8::String::Utf8Value sourceline(message->GetSourceLine());		char const* sourcelineString = toCString(sourceline);		printf("%s/n", sourcelineString);		// Print wavy underline (GetUnderline is deprecated).		int start = message->GetStartColumn();		for (int i = 0; i < start; i++)			printf(" ");		int end = message->GetEndColumn();		for (int i = start; i < end; i++)			printf("^");		printf("/n");		v8::String::Utf8Value stackTrace(_tryCatch->StackTrace());		if (stackTrace.length() > 0)		{			char const* stackTraceString = toCString(stackTrace);			printf("%s/n", stackTraceString);		}	}}
开发者ID:Matt90o,项目名称:cpp-ethereum,代码行数:46,


示例10: toCString

void Compilation::setJettisonReason(JettisonReason jettisonReason, const FireDetail* detail){    if (m_jettisonReason != NotJettisoned)        return; // We only care about the original jettison reason.    m_jettisonReason = jettisonReason;    if (detail)        m_additionalJettisonReason = toCString(*detail);    else        m_additionalJettisonReason = CString();}
开发者ID:mjparme,项目名称:openjdk-jfx,代码行数:11,


示例11: MasonIOException

void VcfMaterializer::init(){    if (!empty(vcfFileName))    {        // Open VCF stream.        if (!open(vcfFileIn, toCString(vcfFileName)))            throw MasonIOException("Could not open VCF stream.");        // Read header.        readHeader(vcfHeader, vcfFileIn);        // Read first VCF record.        if (!atEnd(vcfFileIn))            readRecord(vcfRecord, vcfFileIn);        // Get number of haplotypes in VCF file.        SEQAN_ASSERT_NOT(empty(vcfRecord.genotypeInfos));        seqan::StringSet<seqan::CharString> xs;        seqan::DirectionIterator<seqan::CharString const, seqan::Input>::Type inputIter =                directionIterator(vcfRecord.genotypeInfos[0], seqan::Input());        numHaplotypes = 1;        for (; !atEnd(inputIter); ++inputIter)            numHaplotypes += (*inputIter == '|' || *inputIter == '/');    }    else    {        numHaplotypes = 1;    }    // Open input FASTA file and FAI.    if (!open(faiIndex, toCString(fastaFileName)))    {        if (!build(faiIndex, toCString(fastaFileName)))            throw MasonIOException("Could not build FAI index.");        seqan::CharString faiPath = fastaFileName;        append(faiPath, ".fai");        if (!save(faiIndex, toCString(faiPath)))            throw MasonIOException("Could not write FAI index.");    }    // Open methylation FASTA FAI file if given.    if (!empty(methFastaFileName))    {        if (!open(methFaiIndex, toCString(methFastaFileName)))        {            if (!build(methFaiIndex, toCString(methFastaFileName)))                throw MasonIOException("Could not build methylation levels FAI index.");            seqan::CharString faiPath = methFastaFileName;            append(faiPath, ".fai");            if (!save(methFaiIndex, toCString(faiPath)))                throw MasonIOException("Could not write methylation levels FAI index.");        }    }}
开发者ID:IsmailM,项目名称:seqan,代码行数:56,


示例12: FINALIZE_DFG_CODE

bool JITFinalizer::finalize(){    m_jitCode->initializeCodeRef(        FINALIZE_DFG_CODE(*m_linkBuffer, ("DFG JIT code for %s", toCString(CodeBlockWithJITType(m_plan.codeBlock.get(), JITCode::DFGJIT)).data())),        MacroAssemblerCodePtr());        m_plan.codeBlock->setJITCode(m_jitCode);        finalizeCommon();        return true;}
开发者ID:B-Stefan,项目名称:webkit,代码行数:12,


示例13: RELEASE_ASSERT

bool JITFinalizer::finalizeFunction(){    RELEASE_ASSERT(!m_withArityCheck.isEmptyValue());    m_jitCode->initializeCodeRef(        FINALIZE_DFG_CODE(*m_linkBuffer, ("DFG JIT code for %s", toCString(CodeBlockWithJITType(m_plan.codeBlock.get(), JITCode::DFGJIT)).data())),        m_withArityCheck);    m_plan.codeBlock->setJITCode(m_jitCode);        finalizeCommon();        return true;}
开发者ID:B-Stefan,项目名称:webkit,代码行数:12,


示例14: m_code

PhaseScope::PhaseScope(Code& code, const char* name)    : m_code(code)    , m_name(name){    if (shouldDumpIRAtEachPhase()) {        dataLog("Air after ", code.lastPhaseName(), ", before ", name, ":/n");        dataLog(code);    }    if (shouldSaveIRBeforePhase())        m_dumpBefore = toCString(code);}
开发者ID:happyyang,项目名称:webkit,代码行数:12,


示例15: help

	std::string help(Namespace *ns) const {		if (ns == NULL) {			return "";		}		std::stringstream sstr;		if(ns!=getGlobal()->getGlobalNamespace()){			sstr <<"/tNamespace " << ns->name() << " consists of: /n";		}		printSubBlockInfo(ns->subspaces(), "Namespaces", sstr);		if(not ns->subspaces().empty()){			sstr <<"/t/t/tFor more information on a nested namespace, type help(<namespacename>)/n";		}		printSubBlockInfo(ns->vocabularies(), "Vocabularies", sstr);		printSubBlockInfo(ns->theories(), "Theories", sstr);		printSubBlockInfo(ns->structures(), "Structures", sstr);		printSubBlockInfo(ns->terms(), "Terms", sstr);		printSubBlockInfo(ns->queries(), "Queries", sstr);		// FIXME additional blocks are not detected automatically!		// Printing procedures		std::map<std::string, std::string> procedures;		// Get text for each internal procedure in the given namespace		for (auto i = getAllInferences().cbegin(); i < getAllInferences().cend(); ++i) {			if ((*i)->getNamespace() == ns->name()) {				std::vector<std::string> args;				for (auto j = (*i)->getArgumentTypes().cbegin(); j < (*i)->getArgumentTypes().cend(); ++j) {					args.push_back(toCString(*j));				}				auto text = printProcedure((*i)->getName(), args, (*i)->getDescription());				procedures.insert({text, ""});			}		}		// Get text for each user defined procedure in the given namespace		for (auto it = ns->procedures().cbegin(); it != ns->procedures().cend(); ++it) {			auto text = printProcedure(it->first, it->second->args(), it->second->description());			procedures.insert({text, ""});		}		if (procedures.empty()) {			if (ns->isGlobal()) {				sstr << "/t/tThere are no procedures in the global namespace/n";			} else {				sstr << "/t/tThere are no procedures in namespace ";				ns->putName(sstr);				sstr << '/n';			}		} else {			printSubBlockInfo(procedures, "Procedures", sstr);		}		return sstr.str();	}
开发者ID:KULeuven-KRR,项目名称:IDP,代码行数:52,


示例16: constructEmptyObject

JSValue Bytecodes::toJS(ExecState* exec) const{    VM& vm = exec->vm();    JSObject* result = constructEmptyObject(exec);        result->putDirect(vm, vm.propertyNames->bytecodesID, jsNumber(m_id));    result->putDirect(vm, vm.propertyNames->inferredName, jsString(exec, String::fromUTF8(m_inferredName)));    result->putDirect(vm, vm.propertyNames->sourceCode, jsString(exec, String::fromUTF8(m_sourceCode)));    result->putDirect(vm, vm.propertyNames->hash, jsString(exec, String::fromUTF8(toCString(m_hash))));    result->putDirect(vm, vm.propertyNames->instructionCount, jsNumber(m_instructionCount));    addSequenceProperties(exec, result);        return result;}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:14,


示例17: main

int main(int argc, char const ** argv){    // Parse the command line.    seqan::ArgumentParser parser;    MasonGenomeOptions options;    seqan::ArgumentParser::ParseResult res = parseCommandLine(options, argc, argv);    // If there was an error parsing or built-in argument parser functionality    // was triggered then we exit the program.  The return code is 1 if there    // were errors and 0 if there were none.    if (res != seqan::ArgumentParser::PARSE_OK)        return res == seqan::ArgumentParser::PARSE_ERROR;    std::cout << "MASON GENOME SIMULATOR/n"              << "======================/n/n";        // Print the command line arguments back to the user.    if (options.verbosity > 0)    {        std::cout << "__OPTIONS____________________________________________________________________/n"                  << '/n'                  << "VERBOSITY  /t" << options.verbosity << '/n'                  << "/n"                  << "SEED       /t" << options.seed << '/n'                  << "/n"                  << "OUTPUT FILE/t" << options.outputFilename << "/n"                  << "CONTIG LENS/t";        for (unsigned i = 0; i < length(options.contigLengths); ++i)        {            if (i > 0)                std::cout << ", ";            std::cout << options.contigLengths[i];        };        std::cout << "/n/n";    }    // Perform genome simulation.    std::cout << "__SIMULATING GENOME__________________________________________________________/n"              << "/n";    MasonSimulateGenomeOptions simOptions;    simOptions.contigLengths = options.contigLengths;    simOptions.seed = options.seed;    if (simulateGenome(toCString(options.outputFilename), simOptions) != 0)        return 1;    std::cerr << "/nDone./n";        return 0;}
开发者ID:pombredanne,项目名称:mason2,代码行数:49,


示例18: getScriptDefaultPath

			void getScriptDefaultPath(Entity e, char* path, char* full_path, int length, const char* ext)			{				char tmp[30];				toCString(e.index, tmp, 30);				copyString(full_path, length, m_engine.getBasePath());				catCString(full_path, length, "e");				catCString(full_path, length, tmp);				catCString(full_path, length, ".");				catCString(full_path, length, ext);				copyString(path, length, "e");				catCString(path, length, tmp);				catCString(path, length, ".");				catCString(path, length, ext);			}
开发者ID:Garfield-Chen,项目名称:LumixEngine,代码行数:16,


示例19: toCString

bool toCString(int64 value, char* output, int length){	char* c = output;	if (length > 0)	{		if (value < 0)		{			value = -value;			--length;			*c = '-';			++c;		}		return toCString((uint64)value, c, length);	}	return false;}
开发者ID:NextGenIntelligence,项目名称:LumixEngine,代码行数:16,


示例20: check_cutted_frags

void check_cutted_frags(CharString frag, std::vector<table_entry*> &links,                         map<unsigned long long, string> &chains, unsigned int min_length){    if(length(frag) > min_length){	        std::queue<int> l_link;        std::queue<int> r_link;        Pattern<CharString, ShiftOr > pattern(frag);        for(unsigned int i=0; i<links.size(); ++i){            CharString text = links[i]->get_short_read()->get_RNA_seq_sequence();            Finder<CharString> finder(text);            find(finder,pattern);            if(beginPosition(finder) < min_length){                //std::cout << "L link " << i << ::std::endl;                l_link.push(i);            }            if(endPosition(finder) > length(text) - min_length){                //std::cout << "R link" << ::std::endl;                r_link.push(i);            }        }                if(l_link.size() != 0 && r_link.size() != 0){            string head;            assign(head,frag);            for(unsigned int z=0; z<min_length*2 - length(frag);++z){                head.append("A");            }	    if(chains.find(fingerprint(head)) == chains.end()){            	chains[fingerprint(head)] = toCString(frag);		//std::cerr << "CUT: " << frag << " " << length(frag) << std::endl;	    }else{		//std::cerr << "Problem:" << std::endl;		//std::cerr << chains[fingerprint(head)] << std::endl;		//std::cerr << toCString(frag) << std::endl;	    }                        //::std::cout << toCString(frag) << ::std::endl;            while(!l_link.empty()){                links[l_link.front()]->push_D_link(fingerprint(head));                l_link.pop();            }            while(!r_link.empty()){                links[r_link.front()]->push_A_link(fingerprint(head));                r_link.pop();            }        }            }}
开发者ID:hjanime,项目名称:RNA-seq-Graph,代码行数:47,


示例21: regexpToSourceString

static CString regexpToSourceString(const RegExp* regExp){    char postfix[7] = { '/', 0, 0, 0, 0, 0, 0 };    int index = 1;    if (regExp->global())        postfix[index++] = 'g';    if (regExp->ignoreCase())        postfix[index++] = 'i';    if (regExp->multiline())        postfix[index] = 'm';    if (regExp->dotAll())        postfix[index++] = 's';    if (regExp->unicode())        postfix[index++] = 'u';    if (regExp->sticky())        postfix[index++] = 'y';    return toCString("/", regExp->pattern().impl(), postfix);}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:19,


示例22: getSVLen

int getSVLen(seqan::CharString const & str){    seqan::DirectionIterator<seqan::CharString const, seqan::Input>::Type inputIter =            directionIterator(str, seqan::Input());    // Parse out key/value pairs and interpret SVLEN.    seqan::CharString key, val;    enum { IN_KEY, IN_VALUE } state = IN_KEY;    for (; !atEnd(inputIter); ++inputIter)    {        if (*inputIter == '=')        {            state = IN_VALUE;            continue;        }        else if (*inputIter == ';')        {            if (key == "SVLEN")                return seqan::lexicalCast<int>(val);            clear(val);            clear(key);            state = IN_KEY;            continue;        }        else if (state == IN_KEY)        {            appendValue(key, *inputIter);        }        else  // (state == IN_VALUE)        {            appendValue(val, *inputIter);        }    }    if (key == "SVLEN")        return seqan::lexicalCast<int>(val);    SEQAN_FAIL("Missing INFO SVLEN %s", toCString(str));    return 0;}
开发者ID:IsmailM,项目名称:seqan,代码行数:41,


示例23: dumpChildren

void Value::deepDump(PrintStream& out) const{    out.print(m_type, " ", *this, " = ", m_opcode);    out.print("(");    CommaPrinter comma;    dumpChildren(comma, out);    if (m_origin)        out.print(comma, m_origin);    dumpMeta(comma, out);    {        CString string = toCString(effects());        if (string.length())            out.print(comma, string);    }    out.print(")");}
开发者ID:sailei1,项目名称:webkit,代码行数:21,


示例24: resize

void IlluminaSequencingSimulator::_initModel(){    // Compute mismatch probabilities, piecewise linear function.    resize(model->mismatchProbabilities, illuminaOptions.readLength);    // Compute probability at raise point.    double y_r = 2 * illuminaOptions.probabilityMismatch - illuminaOptions.positionRaise * illuminaOptions.probabilityMismatchBegin - illuminaOptions.probabilityMismatchEnd + illuminaOptions.probabilityMismatchEnd * illuminaOptions.positionRaise;    if (illuminaOptions.verbosity >= 2)    {        std::cerr << "Illumina error curve:/n"                  << "  (0, " << illuminaOptions.probabilityMismatchBegin << ") -- (" << illuminaOptions.positionRaise << ", " << y_r << ") -- (1, " << illuminaOptions.probabilityMismatchEnd << ")/n";    }    // std::cout << "y_r = " << y_r << std::endl;    // Compute mismatch probability at each base.    if (!empty(illuminaOptions.probabilityMismatchFile))    {        // Open file.        std::fstream file;        file.open(toCString(illuminaOptions.probabilityMismatchFile), std::ios_base::in);        if (!file.is_open())        {            std::cerr << "Failed to load mismatch probabilities from " << illuminaOptions.probabilityMismatchFile << std::endl;            // return 1;        }        // Load probabilities.        double x;        file >> x;        unsigned i;        for (i = 0; i < illuminaOptions.readLength && !file.eof(); ++i) {            model->mismatchProbabilities[i] = x;            file >> x;        }        if (i != illuminaOptions.readLength)        {            std::cerr << "Not enough mismatch probabilites in " << illuminaOptions.probabilityMismatchFile << " (" << i << " < " << illuminaOptions.readLength << ")!" << std::endl;            // return 1;        }    } else {
开发者ID:joergi-w,项目名称:seqan,代码行数:37,


示例25: while

void StackTree::printCallstack(StackNode* node){	while (node)	{		HANDLE process = GetCurrentProcess();		uint8 symbol_mem[sizeof(SYMBOL_INFO) + 256 * sizeof(char)];		SYMBOL_INFO* symbol = reinterpret_cast<SYMBOL_INFO*>(symbol_mem);		memset(symbol_mem, 0, sizeof(symbol_mem));		symbol->MaxNameLen = 255;		symbol->SizeOfStruct = sizeof(SYMBOL_INFO);		BOOL success = SymFromAddr(process, (DWORD64)(node->m_instruction), 0, symbol);		if (success)		{			IMAGEHLP_LINE line;			DWORD offset;			if (SymGetLineFromAddr(process, (DWORD64)(node->m_instruction), &offset, &line))			{				OutputDebugString("/t");				OutputDebugString(line.FileName);				OutputDebugString("(");				char tmp[20];				toCString((uint32)line.LineNumber, tmp, sizeof(tmp));				OutputDebugString(tmp);				OutputDebugString("):");			}			OutputDebugString("/t");			OutputDebugString(symbol->Name);			OutputDebugString("/n");		}		else		{			OutputDebugString("/tN/A/n");		}		node = node->m_parent;	}}
开发者ID:badkangaroo,项目名称:LumixEngine,代码行数:36,



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


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