这篇教程C++ strm函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中strm函数的典型用法代码示例。如果您正苦于以下问题:C++ strm函数的具体用法?C++ strm怎么用?C++ strm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了strm函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: init_loggingvoid init_logging(){ init_factories(); std::istringstream strm(settings); logging::init_from_stream(strm);}
开发者ID:Adikteev,项目名称:rtbkit-deps,代码行数:7,
示例2: strmfloat CHelperXMLAttributes::getValueAsFloat(const String& attrName, float def) const{ if (!exists(attrName)) { return def; } float val; std::istringstream strm(getValue(attrName).c_str()); strm >> val; // success? if (strm.fail()) { char szException[MAX_PATH] = {0}; _snprintf(szException, MAX_PATH, "CHelperXMLAttributes::getValueAsInteger - failed to convert attribute '%s' with value '%s' to float.", attrName.c_str(), getValue(attrName).c_str()); throw std::exception(szException); } return val;}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:26,
示例3: strmFileSkeleton::FileSkeleton(const std::string &filename){ ifstream strm(filename.c_str()); if(!strm.is_open()) { Debugging::out() << "Error opening file " << filename << endl; return; } while(!strm.eof()) { vector<string> line = readWords(strm); if(line.size() < 5) continue; //error Vector3 p; sscanf(line[1].c_str(), "%lf", &(p[0])); sscanf(line[2].c_str(), "%lf", &(p[1])); sscanf(line[3].c_str(), "%lf", &(p[2])); if(line[4] == "-1") line[4] = std::string(); makeJoint(line[0], p * 2., line[4]); } initCompressed();}
开发者ID:imclab,项目名称:KinectPuppeteering,代码行数:27,
示例4: VerifyCorrectWorkIstreamOperatorvoid VerifyCorrectWorkIstreamOperator(std::string const &str){ std::istringstream strm(str); CMyString myStr; strm >> myStr; BOOST_CHECK_EQUAL(myStr.GetStringData(), str);}
开发者ID:Smi1le,项目名称:OOP,代码行数:7,
示例5: strm// Output hexdump to a QStringQString QWSHexDump::toString() { QString result; QTextStream strm(&result, QFile::WriteOnly); outstrm = &strm; hexDump(); return result;}
开发者ID:adesurya,项目名称:Open-DPI-Detector,代码行数:8,
示例6: str// staticvoid LLFloaterProperties::onClickCopy(void* user_data){ LLFloaterProperties* floaterp = (LLFloaterProperties*)user_data; if(floaterp) { LLViewerInventoryItem* item = (LLViewerInventoryItem*)floaterp->findItem(); if(item) { std::string str(floaterp->childGetValue("item_text").asString()); std::string::size_type pos; while((pos = str.find(" ")) != std::string::npos) { str.replace(pos, 4, "/t"); } std::istringstream strm(str); LLViewerInventoryItem* temp = new LLViewerInventoryItem(); temp->importLegacyStream(strm); std::ostringstream strm2; temp->exportLegacyStream(strm2, TRUE); LLWString wstr(utf8str_to_wstring(strm2.str())); gClipboard.copyFromSubstring(wstr, 0, wstr.length()); //delete temp; } }}
开发者ID:IamusNavarathna,项目名称:SingularityViewer,代码行数:29,
示例7: stream_clientvoid stream_client(){ try { std::cout << "Connecting to " << url << std::endl; saga::stream::stream strm (url); strm.connect (); std::cout << "Connected!" << std::endl; std::string msg ("test from client/n"); std::cout << "Sending : " << msg; strm.write (saga::buffer (msg)); char buff[255]; saga::ssize_t read_bytes = strm.read (saga::buffer (buff)); std::cout << "Received: " << std::string (buff, read_bytes) << std::endl; } catch ( saga::exception const & e ) { std::cerr << "saga::exception caught: " << e.what () << std::endl; ++exit_code; }}
开发者ID:saga-project,项目名称:saga-cpp,代码行数:26,
示例8: line_parser/////////////////////////////////////////////////////////////////////////// Load the distributed UAI filebool line_parser(graph_type& graph, const std::string& filename, const std::string& textline) { std::stringstream strm(textline); graphlab::vertex_id_type vid; vertex_data vdata; vdata.dual_contrib = 0.0; string type; strm >> type; if(type == "v") { vdata.factor_type = VAR; vdata.nvars = 1; vdata.cards.resize(1); strm>>vid; strm >> vdata.cards[0]; vdata.potentials.resize(vdata.cards[0]); //vdata.beliefs.setOnes(vdata.cards[0]); //vdata.beliefs /= vdata.cards[0]; vdata.beliefs.setConstant(vdata.cards[0], 0.5); vdata.unary_degree.resize(vdata.cards[0], 0); //for(int i=0; i< vdata.cards[0]; i++){ // strm>>vdata.potentials[i]; // vdata.potentials[i] = log10(vdata.potentials[i]); // } // vdata.potentials.maxCoeff(&vdata.best_configuration); graph.add_vertex(vid,vdata); }
开发者ID:3upperm2n,项目名称:PowerGraph,代码行数:29,
示例9: strmvoid QuantityManager::read(const std::string & data) { std::stringstream strm(data); std::string line; while (getline(strm,line)) { IBK::trim(line); if (line.empty() || line[0] == '#') continue; Quantity qd; try { qd.read(line); } catch (IBK::Exception & ex) { throw IBK::Exception(ex, IBK::FormatString("Cannot read quantity definition from line '%1'.") .arg(line), "[QuantityManager::read]"); } // check if we already have such a quantity int idx = index(qd); if (idx != -1) { // replace quantity IBK::IBK_Message(IBK::FormatString("Replacing quantity '%1::%2' with new definition./n") .arg(Quantity::type2string(qd.m_type)) .arg(qd.m_name), IBK::MSG_PROGRESS, "QuantityManager::read" ,1); m_quantities[idx] = qd; } else { // add quantity to list m_quantities.push_back(qd); // add new reference to global index map m_globalIndexMap[ std::make_pair(qd.m_type, qd.m_name)]= m_quantities.size()-1; } }}
开发者ID:ghorwin,项目名称:OpenHAM,代码行数:31,
示例10: mainint main(int argc, char* argv[]) { string alignmentFileName, geneDBFileName; if (argc < 3) { cout << "usage: printDuplicates alignemntFile genedb " << endl; exit(1); } alignmentFileName = argv[1]; geneDBFileName = argv[2]; GeneDB genedb; genedb.Read(geneDBFileName); genedb.IndexChromosomes(); ifstream alignmentIn; CrucialOpen(alignmentFileName, alignmentIn, std::ios::in); while(alignmentIn) { string line; getline(alignmentIn, line); if (line == "###") { // found the end of an entry } else { string chrName, genome, source; int start, end, identity; char a, strand, b; string annotationString; stringstream strm(line); strm >> chrName >> genome >> source >> start >> end >> a >> strand >> b >> annotationString; vector<string> annotations; if (source != "exon") { continue; } ParseSeparatedList(annotationString, annotations, ';'); GeneDBChromosome *chromosomePtr; chromosomePtr = genedb.Find(chrName); if (chromosomePtr == NULL) { cout << "chromosome " << chromosomePtr << " not found in database." << endl; continue; } int exonIndex; if ( chromosomePtr->LookupIndexByStart(start, exonIndex) ) { if (chromosomePtr->exons[exonIndex].start <= start and chromosomePtr->exons[exonIndex].end >= end) { chromosomePtr->exons[exonIndex].Print(cout); } } else { } } }}
开发者ID:BioinformaticsArchive,项目名称:blasr,代码行数:59,
示例11: qDebugvoid MainWindow::onCellChanged(int row, int col) { //Determine if user caused this signal if(ui->tableWidget->selectedItems().contains(ui->tableWidget->item(row, col))) { qDebug() << "onCellChanged row="<<row<<" col="<<col; //Determine which column was updated if(col == 1 && network != NULL) { //Address field changed NetNode* node = network->getNode(ui->tableWidget->item(row, 0)->text()); QString addrText = ui->tableWidget->item(row, col)->text(); //Check for address formatting error si_address address; if(address.parseString(addrText.toAscii().data()) != 0) { //Formating error qDebug() << "ERROR - Invalid address! [" << addrText<<"]"; addrText = node->getAddress().toString().c_str(); ui->tableWidget->item(row, col)->setText(addrText); } else { qDebug() << "Read new address "<<address.toString().c_str(); node->setAddress(address); network->computeAddresses(); } } else if(col == 2 && network != NULL) { //Automatic address field changed NetNode* node = network->getNode(ui->tableWidget->item(row, 0)->text()); node->setAutoAddress(ui->tableWidget->item(row, 2)->checkState() == Qt::Checked); network->computeAddresses(); } else if(col == 3 && network != NULL) { //MMT Enable field changed NetNode* node = network->getNode(ui->tableWidget->item(row, 0)->text()); node->setMmtEnable(ui->tableWidget->item(row, 3)->checkState() == Qt::Checked); } else if(col == 4 && network != NULL) { //MMT UID field changed NetNode* node = network->getNode(ui->tableWidget->item(row, 0)->text()); int value = ui->tableWidget->item(row, 4)->text().toInt(); if(value < 0 || network->isMmtUidUsed(value)) { QString mmtUidStr; QTextStream strm(&mmtUidStr); strm << node->getMmtUid(); ui->tableWidget->item(row, 4)->setText(mmtUidStr); } else { node->setMmtUid(value); } } }}
开发者ID:sevenbitbyte,项目名称:fctdev,代码行数:59,
示例12: bcast void bcast(const size_t& root, T& elem) {#ifdef HAS_MPI // Get the mpi rank and size if(mpi_tools::rank() == root) { // serialize the object graphlab::charstream cstrm(128); graphlab::oarchive oarc(cstrm); oarc << elem; cstrm.flush(); char* send_buffer = cstrm->c_str(); int send_buffer_size = cstrm->size(); assert(send_buffer_size >= 0); // send the ammount to send int error = MPI_Bcast(&send_buffer_size, // Send buffer 1, // send count MPI_INT, // send type root, // root rank MPI_COMM_WORLD); assert(error == MPI_SUCCESS); // send the actual data error = MPI_Bcast(send_buffer, // Send buffer send_buffer_size, // send count MPI_BYTE, // send type root, // root rank MPI_COMM_WORLD); assert(error == MPI_SUCCESS); } else { int recv_buffer_size(-1); // recv the ammount the required buffer size int error = MPI_Bcast(&recv_buffer_size, // recvbuffer 1, // recvcount MPI_INT, // recvtype root, // root rank MPI_COMM_WORLD); assert(error == MPI_SUCCESS); assert(recv_buffer_size >= 0); std::vector<char> recv_buffer(recv_buffer_size); error = MPI_Bcast(&(recv_buffer[0]), // recvbuffer recv_buffer_size, // recvcount MPI_BYTE, // recvtype root, // root rank MPI_COMM_WORLD); assert(error == MPI_SUCCESS); // construct the local element namespace bio = boost::iostreams; typedef bio::stream<bio::array_source> icharstream; icharstream strm(&(recv_buffer[0]), recv_buffer.size()); graphlab::iarchive iarc(strm); iarc >> elem; }#else logstream(LOG_FATAL) << "MPI not installed!" << std::endl;#endif } // end of bcast
开发者ID:Bhushan1002,项目名称:SFrame,代码行数:59,
示例13: BaseMatrix /** Takes an initializer list of vectors with a length of /b vector_length and constructs a matrix where each of these vectors represents a set in the matrix. @param values - the list of vectors to construct the matrix from @throws std::invalid_argument - if the number of values in /b values is not equal to /b n_vectors */ BaseMatrix(const std::initializer_list<BaseMatrix<T, vector_length, 1>> &values) { if (values.size() != n_vectors) { throw DevaInvalidInputException( "Tried to create matrix with " + strm(n_vectors) + " columns, but passed " + strm(values.size())); } auto val_i = values.begin(); for (int i = 0;i <= n_vectors;i++) { for (int j = 0;j <= vector_length - 1;j++) { data[i * vector_length + j] = (*val_i)(0, j); } val_i++; } }
开发者ID:Stealthmate,项目名称:deva-framework,代码行数:25,
示例14: strmvoid OSCSender::sendMessage(std::string msg){ char buff[128]; osc::OutboundPacketStream strm(buff, 128); strm << osc::BeginBundleImmediate; strm << osc::BeginMessage(msg.c_str()) << osc::EndMessage; strm << osc::EndBundle; transmitSocket.Send(strm.Data(), strm.Size());}
开发者ID:julietbrown84,项目名称:devart-template,代码行数:8,
示例15: ktup_comparison_haschint ktup_comparison_hasch ( char *i_seq1, char *i_seq2, const int ktup){ /*Ktup comparison adapted from Rob Edgar, NAR, vol32, No1, 381, 2004*/ /*1: hasch sequence 1 2: Count the number of seq2 ktup found in seq1 */ char c; int key; static HaschT*H1; static char *pseq; Hasch_entry *e; char *s; int l, ls; int p, a, max_dist=-1; double score=0; if (!strm (i_seq1, pseq)) { if (H1) { hdestroy (H1, declare_ktup_hasch_data, free_ktup_hasch_data); string2key (NULL, NULL); } H1=hasch_sequence ( i_seq1, ktup); vfree (pseq);pseq=(char*)vcalloc ( strlen (i_seq1)+1, sizeof (char)); sprintf ( pseq, "%s", i_seq1); } ls=l=strlen (i_seq2); s=i_seq2; p=0; while (ls>ktup) { c=s[ktup];s[ktup]='/0'; key=string2key (s, NULL); e=hsearch (H1,key,FIND, declare_ktup_hasch_data, free_ktup_hasch_data); if ( e==NULL); else if ( max_dist==-1)score++; else { for ( a=1; a<=(e->data)->list[1]; a++) if (FABS((p-(e->data)->list[a]))<=max_dist) {score++; break;} } s[ktup]=c;s++;p++;ls--; } score/=(l-ktup); score=(log(0.1+score)-log(0.1))/(log(1.1)-log(0.1)); if ( score>100) score=100; return (int)(score*100);}
开发者ID:cbcrg,项目名称:tcoffee,代码行数:57,
示例16: _tmainint _tmain(int argc, _TCHAR* argv[]){ _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); signals::IBlock* devices[1]; int numDevices = DRIVER_HpsdrEthernet.Discover(devices, _countof(devices)); std::cout << numDevices << " devices found" << std::endl; signals::IBlock* hpsdr = devices[0]; ASSERT(hpsdr != NULL); typedef std::list<CAttrObserver*> TObservList; TObservList obsList; signals::IAttributes* attrs = hpsdr->Attributes(); { unsigned count = attrs->Itemize(NULL, 0); signals::IAttribute** attrList = new signals::IAttribute*[count]; VERIFY(attrs->Itemize(attrList, count) == count); for(unsigned i = 0; i < count; i++) { obsList.push_back(new CAttrObserver("", attrList[i])); } delete [] attrList; } signals::IAttribute* recvSpeed = attrs->GetByName("recvRate"); ASSERT(recvSpeed); long newSpeed = 48000; recvSpeed->setValue(&newSpeed); unsigned numOut = hpsdr->Outgoing(NULL, 0); signals::IOutEndpoint** outEPs = new signals::IOutEndpoint*[numOut]; VERIFY(hpsdr->Outgoing(outEPs, numOut) == numOut); signals::IOutEndpoint* recv1 = outEPs[2]; signals::IEPBuffer* buff = recv1->CreateBuffer(); recv1->Connect(buff); { CStreamObserver<signals::etypComplex> strm(buff); hpsdr->Start(); Sleep(30000); hpsdr->Stop(); } for(TObservList::iterator trans = obsList.begin(); trans != obsList.end(); trans++) { delete *trans; } buff->Release(); delete [] outEPs; VERIFY(!hpsdr->Release()); std::cout << numPackets << " entries received" << std::endl; Sleep(30000); return 0;}
开发者ID:mstramb,项目名称:modHpsdr,代码行数:57,
示例17: whilevoid dc_stream_receive::process_buffer(bool outsidelocked) { // if barrier is set. we should not process anything if (barrier) return; if (outsidelocked || bufferlock.try_lock()) { // only makes sense to process if we at least have // a header while (size_t(buffer.size()) >= sizeof(packet_hdr)) { // read the header packet_hdr hdr; buffer.peek((char*)(&hdr), sizeof(hdr)); #ifdef DC_RECEIVE_DEBUG logstream(LOG_INFO) << "peeked packet header. Has length " << hdr.len << std::endl; #endif //do we have enough to extract a single packet // if not, quit now! if (size_t(buffer.size()) < sizeof(packet_hdr) + hdr.len) break; buffer.skip(sizeof(packet_hdr)); if ((hdr.packet_type_mask & CONTROL_PACKET) == 0) { bytesreceived += hdr.len; } if (hdr.packet_type_mask & BARRIER) { #ifdef DC_RECEIVE_DEBUG logstream(LOG_INFO) << "Comm barrier" << std::endl; #endif ASSERT_EQ(hdr.len, 0); // barrier packets cannot contain data // barrier only makes sense if we have incomplete calls barrier = pending_calls.value > 0; // ok. we do have incomplete calls. quit processing. if (barrier) break; } else if ((hdr.packet_type_mask & FAST_CALL) || (hdr.packet_type_mask & REPLY_PACKET)) { // if it is a fast call, dispatch the function immediately. replies are also fast tracked #ifdef DC_RECEIVE_DEBUG if (hdr.packet_type_mask & REPLY_PACKET) logstream(LOG_INFO) << "Is reply" << std::endl; else logstream(LOG_INFO) << "Is fast call" << std::endl; #endif boost::iostreams::stream<circular_char_buffer_source> strm(buffer,hdr.len); dc->exec_function_call(hdr.src,hdr, strm); } else if (hdr.packet_type_mask & STANDARD_CALL) { #ifdef DC_RECEIVE_DEBUG logstream(LOG_INFO) << "Is deferred call" << std::endl; #endif // not a fast call. so read out the buffer char* tmpbuf = new char[hdr.len]; buffer.read(tmpbuf, hdr.len); pending_calls.inc(); dc->deferred_function_call(hdr.src,hdr, tmpbuf, hdr.len); } } if (!outsidelocked) bufferlock.unlock(); }}
开发者ID:greeness,项目名称:graphlab_CMU,代码行数:57,
示例18: is_dynamic_memoryint is_dynamic_memory ( void *array){ Memcontrol *p; if (array==NULL)return 0; p=(Memcontrol *)array; p-=2; if ( strm (p[0].check, "dy"))return 1; return 0;}
开发者ID:dalehamel,项目名称:birch-native-sources,代码行数:9,
示例19: ReadCompressedImagevoid Image::LoadImage(wxString image, bool remove,wxFileSystem *filesystem){ m_compressedImage.Clear(); m_scaledBitmap.Create (1,1); if (filesystem) { wxFSFile *fsfile = filesystem->OpenFile(image); if (fsfile) { // open successful wxInputStream *istream = fsfile->GetStream(); m_compressedImage = ReadCompressedImage(istream); } // Closing and deleting fsfile is important: If this line is missing // opening .wxmx files containing hundreds of images might lead to a // "too many open files" error. delete fsfile; } else { wxFile file(image); if(file.IsOpened()) { wxFileInputStream strm(file); bool ok=strm.IsOk(); if(ok) m_compressedImage = ReadCompressedImage(&strm); file.Close(); if(ok && remove) wxRemoveFile (image); } } wxImage Image; if(m_compressedImage.GetDataLen()>0) { wxMemoryInputStream istream(m_compressedImage.GetData(),m_compressedImage.GetDataLen()); Image.LoadFile(istream); } m_extension = wxFileName(image).GetExt(); if(Image.Ok()) { m_originalWidth = Image.GetWidth(); m_originalHeight = Image.GetHeight(); } else { // Leave space for an image showing an error message m_originalWidth = 400; m_originalHeight = 250; } ViewportSize(m_viewportWidth,m_viewportHeight,m_scale);}
开发者ID:andrejv,项目名称:wxmaxima,代码行数:57,
示例20: loadFile /// Load a RINEX clock file; may set the drift and accel flags. bool loadFile(const std::string& filename) throw(Exception) { try { // open the input stream RinexClockStream strm(filename.c_str()); if(!strm.is_open()) { Exception e("File " + filename + " could not be opened"); GPSTK_THROW(e); } strm.exceptions(std::ios::failbit); //cout << "Opened file " << filename << endl; // declare header and data RinexClockHeader head; RinexClockData data; // read the RINEX clock header try { strm >> head; } catch(Exception& e) { e.addText("Error reading header of file " + filename); GPSTK_RETHROW(e); } //cout << "Read header" << endl; head.dump(); // save in FileStore clkFiles.addFile(filename, head); // read data try { while(strm >> data) { //data.dump(cout); if(data.datatype == std::string("AS")) { // add this data ClockRecord rec; rec.bias = data.bias; rec.sig_bias = data.sig_bias, rec.drift = data.drift; rec.sig_drift = data.sig_drift, rec.accel = data.accel; rec.sig_accel = data.sig_accel; addClockRecord(data.sat, data.time, rec); } } } catch(Exception& e) { e.addText("Error reading data of file " + filename); GPSTK_RETHROW(e); } // close strm.close(); } catch(Exception& e) { GPSTK_RETHROW(e); } } // end RinexClockStore::loadFile()
开发者ID:Milfhunter,项目名称:gpstk,代码行数:57,
示例21: edge_loader/////////////////////////////////////////////////////////////////////////// Edge Loader (used to read the adjacency list and add edges to the graph)bool edge_loader(graph_type& graph, const std::string& fname, const std::string& textline){ if ( textline.length() == 0 || textline[0] == '#' ) return true; // empty or comment line, return std::stringstream strm(textline); graphlab::vertex_id_type vid; // first entry in the line is a vertex ID strm >> vid; if (opts.verbose > 0) logstream(LOG_EMPH) << "Here's the input: " << textline << "/n" << vid << "/n"; // Line should contain at least 1 more number (degree of node) if (!strm.good()) { logstream(LOG_ERROR) << "The following ajacency list line is incomplete(check adj_list standard):/n" << textline << std::endl; return EXIT_FAILURE; } // second entry is the out-degree int outdeg; strm >> outdeg; graphlab::vertex_id_type other_vid; for (int i=0; i!=outdeg; ++i) { // Line should contain more numbers (id of neighbours) if (!strm.good()) { logstream(LOG_ERROR) << "The following ajacency list line is incomplete(check adj_list standard):/n" << textline << std::endl; return EXIT_FAILURE; } strm >> other_vid; // only add edges in one direction if (other_vid < vid) continue; if (opts.verbose > 0) logstream(LOG_EMPH) << "Adding edge: (" << vid << "," << other_vid << ")/n"; edge_data edata; edata.empty = false; graph.add_edge(vid,other_vid,edata); } return true;}
开发者ID:Alienfeel,项目名称:graphlab,代码行数:57,
示例22: strmvoid distributed_glshared_manager::invalidate(size_t entry, const std::string &value, bool incache) { if (incache) {// read_synchronize(entry, false); std::stringstream strm(value); iarchive iarc(strm); glsharedobjs[entry]->load(iarc); } else { glsharedobjs[entry]->invalidated = true; }}
开发者ID:greeness,项目名称:graphlab_CMU,代码行数:11,
示例23: snakeInitLevelbool snakeInitLevel(const std::string& levelFile, SnakeGameInfo& state){ std::ifstream strm(levelFile.c_str()); if(!strm.is_open()) return false; std::string line; while(std::getline(strm, line)){ state.level.push_back(line); } state.levelWidth = state.level[0].length(); state.levelHeight = state.level.size(); return true;}
开发者ID:Madsy,项目名称:GameAutomata,代码行数:12,
示例24: strmvoid filelist::writeback(const std::map<std::string, int64_t>& data){ std::string backingtmp = backingfile + ".new"; std::ofstream strm(backingtmp); if(!strm) return; for(auto& i : data) if(i.second != 0) strm << i.second << " " << i.first << std::endl; strm.close(); directory::rename_overwrite(backingtmp.c_str(), backingfile.c_str());}
开发者ID:bentley,项目名称:lsnes,代码行数:12,
示例25: operator //! Composition operator void operator() (record_type const& rec, insertion_list& insertions) const { std::size_t size = m_Formatters.size(); insertions.resize(size); for (std::size_t i = 0; i < size; ++i) { log::aux::basic_ostringstreambuf< char_type > buf(insertions[i]); stream_type strm(&buf); m_Formatters[i](strm, rec); strm.flush(); } }
开发者ID:nairboon,项目名称:anarchnet,代码行数:13,
示例26: strm//---------------------------------------------------------------------------void __fastcall TClockDlg::OKButtonClick( TObject */*Sender*/ ){ bigClockCorr = correction; // and save the correction to the correction file std::ofstream strm( ".//Configuration//time.correction", std::ios::trunc | std::ios::binary ); if ( strm ) { // date_correction is already in seconds strm << long( bigClockCorr * dtg::daySecs ) << std::endl; } Close();}
开发者ID:BackupTheBerlios,项目名称:minos-svn,代码行数:14,
示例27: getSizeOfFileunsigned int getSizeOfFile( const char *filename ){ unsigned int fsize( 0 ); TFileStream strm( filename ); if( !( strm.isOpen() ) ) return( fsize ); // of 0 fsize = strm.Size(); strm.Close(); return( fsize );}
开发者ID:x1nixmzeng,项目名称:z3-tools,代码行数:13,
示例28: parse_config_file basic_parsed_options<charT> parse_config_file(const char* filename, const options_description& desc, bool allow_unregistered) { // Parser return char strings std::basic_ifstream< charT > strm(filename); if (!strm) { pdalboost::throw_exception(reading_file(filename)); } return parse_config_file(strm, desc, allow_unregistered); }
开发者ID:xhy20070406,项目名称:PDAL,代码行数:13,
注:本文中的strm函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ strmake函数代码示例 C++ strlwr函数代码示例 |