这篇教程C++ tell函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中tell函数的典型用法代码示例。如果您正苦于以下问题:C++ tell函数的具体用法?C++ tell怎么用?C++ tell使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了tell函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: tellint cBoblight::close(){ if(m_boblight != 0) { tell(1, "Destroying boblight"); boblight_destroy(m_boblight); // calls delete *void m_boblight = 0; } // set pointer to 0 return success;}
开发者ID:chriszero,项目名称:vdr-plugin-boblight,代码行数:9,
示例2: lengthOffset length( Descriptor file ){ if( file == InvalidDescriptor ) return InvalidOffset; Offset curPosition = tell( file ); Offset length = seekToEnd( file ); seek( file, curPosition, seekFromStart ); return length;}
开发者ID:AzanovAA,项目名称:frl,代码行数:9,
示例3: whilevoid JsonIn::uneat_whitespace(){ while (tell() > 0) { stream->seekg(-1, std::istream::cur); if (!is_whitespace(peek())) { break; } }}
开发者ID:9600bauds,项目名称:Cataclysm-DDA,代码行数:9,
示例4: begin/** /fn begin /brief Mark the beginning of a subchunk*/bool riffWritter::begin(const char *subchunk){ _begin=tell(); write32((_fcc)); write32((uint32_t) 0); // size write32((fourCC::get((uint8_t *) subchunk))); return 1;}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:13,
示例5: throw_errnohime_lsize_t PosixStream::seek(hime_lpos_t offset, IO::SeekOrigin org){ static int whence[] = { SEEK_SET, SEEK_CUR, SEEK_END }; if (fseeko((FILE*)m_file, offset, whence[org]) != 0) throw_errno(m_path.c_str()); return tell();}
开发者ID:kona4kona,项目名称:HiME,代码行数:9,
示例6: VERIFYvoid IWriter::close_chunk(){ VERIFY(!chunk_pos.empty()); int pos = tell(); seek(chunk_pos.top()); w_u32(pos - chunk_pos.top() - 4); seek(pos); chunk_pos.pop();}
开发者ID:BubbaXXX,项目名称:xray-16,代码行数:10,
示例7: ValueError types::str file::read(int size) { if (not is_open) throw ValueError("I/O operation on closed file"); if (mode.find_first_of("r+") == -1) throw IOError("File not open for reading"); if (size == 0 or (feof(**data) && mode.find_first_of("ra") == -1)) return types::str(); int curr_pos = tell(); seek(0, SEEK_END); size = size < 0 ? tell() - curr_pos : size; seek(curr_pos); char *content = new char[size + 1]; // This part needs a new implementation of types::str(char*) to avoid // unnecessary copy. types::str res(content, fread(content, sizeof(char), size, **data)); delete[] content; return res; }
开发者ID:artas360,项目名称:pythran,代码行数:19,
示例8: tellInt64 FileInputStream::getSize(){#ifdef ANDROID return m_file->getSize();#else if (m_file) { Int64 position = tell(); std::fseek(m_file, 0, SEEK_END); Int64 size = tell(); seek(position); return size; } else { return -1; }#endif}
开发者ID:CastBart,项目名称:AndroidTesting,代码行数:19,
示例9: strlenint LmcCom::responseP(char*& result){ // LogDuration ld("response", 0); int status = fail; char* buf = 0; result = 0; // wait op to 30 seconds to receive answer .. if (look(30000) == success && (buf = readln())) { char* p = buf + strlen(escId) +1; if ((p = strstr(p, lastCommand)) && strlen(p) >= strlen(lastCommand)) { p += strlen(lastCommand); while (*p && *p == ' ') // skip leading blanks p++; if (strcmp(p, "?") != 0) result = strdup(p); if (loglevel >= eloDebug) tell(eloDebug2, "<- (response %d bytes) [%s]", strlen(buf), unescape(p)); status = success; } else { tell(eloAlways, "Got unexpected answer for '%s' [%s]", lastCommand, buf); status = fail; } } free(buf); return status;}
开发者ID:horchi,项目名称:vdr-plugin-squeezebox,代码行数:43,
示例10: tellint LmcCom::execute(const char* command, const char* par){ LmcLock; tell(eloDetail, "Exectuting '%s' with '%s'", command, par); request(command, par); write("/n"); return response();}
开发者ID:horchi,项目名称:vdr-plugin-squeezebox,代码行数:10,
示例11: ifu64 File::size(){#define E do { if (error()) return 0; } while (false) const auto prev_pos = tell(); E; seek(0, Seek::End); E; const auto ret = tell(); E; seek(prev_pos, Seek::Begin); return ret;#undef E}
开发者ID:Asunaya,项目名称:RefinedGunz,代码行数:19,
示例12: mainvoid main(void) { int handle; char buffer[512]; int bytes_read; if ((handle = open("//CONFIG.SYS", O_RDONLY)) == -1) printf("Error opening //CONFIG.SYS/n"); else { printf("Current file position %ld/n", tell(handle)); while (bytes_read = read(handle, buffer, sizeof(buffer))) write(1, buffer, bytes_read); printf("Current file position %ld/n", tell(handle)); close(handle); } }
开发者ID:moyuanming,项目名称:Train,代码行数:19,
示例13: getoptint getopt(int nargc, char **nargv, char *ostr){ static char *place = EMSG; /* option letter processing */ static char *lastostr = (char *) 0; register char *oli; /* option letter list index */ /* LANCE PATCH: dynamic reinitialization */ if (ostr != lastostr) { lastostr = ostr; place = EMSG; } if(!*place) { /* update scanning pointer */ if((optind >= nargc) || (*(place = nargv[optind]) != '-') || ! *++place) { place = EMSG; return(EOF); } if (*place == '-') { /* found "--" */ ++optind; return(EOF); } } /* option letter okay? */ if ((optopt = (int)*place++) == (int)':' || !(oli = strchr(ostr,optopt))) { if(!*place) ++optind; tell(": illegal option -- "); } if (*++oli != ':') { /* don't need argument */ optarg = NULL; if (!*place) ++optind; } else { /* need an argument */ if (*place) optarg = place; /* no white space */ else if (nargc <= ++optind) { /* no arg */ place = EMSG; tell(": option requires an argument -- "); } else optarg = nargv[optind]; /* white space */ place = EMSG; ++optind; } return(optopt); /* dump back option letter */}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-e-f_fw-20-10-7-5,代码行数:42,
示例14: tellssize_t BufferedFile::read(void *ptr, size_t count){ ssize_t ret = 0; ssize_t offset = tell(); ret = fread(ptr, count, 1, m_fp) * count; if( IDBLogger::isEnabled() ) IDBLogger::logRW("read", m_fname, this, offset, count, ret); return ret;}
开发者ID:demonlife,项目名称:infinidb,代码行数:11,
示例15: tellboolNoSeekFile::seek(std::streampos pos){#ifdef GNASH_NOSEEK_FD_WARN_SEEKSBACK if (pos < tell()) { std::cerr << boost::format("Warning: seek backward requested " "(%ld from %ld)") % pos % tell() << std::endl; }#endif fill_cache(pos); if (std::fseek(_cache, pos, SEEK_SET) == -1) { std::cerr << "Warning: fseek failed" << std::endl; return false; } return true;}
开发者ID:BrandRegard,项目名称:gnash,代码行数:20,
示例16: tellvoid zip_archive_stream_blob::read(unsigned char* buffer, size_t length) const{ if (!length) return; // First, make sure we have enough blob to satisfy the requested stream length. const size_t length_available = m_size - tell(); if (length_available < length) throw zip_error("There is not enough stream left to fill requested length."); memcpy(buffer, m_cur, length);}
开发者ID:jvsg,项目名称:orcus,代码行数:11,
示例17: file_sizeunsigned long file_size(void){ llong fpos, fsize; if (load_fd < 0) return 0; /* save current position */ fpos=tell(load_fd); /* go to end of file and get position */ seek_io(load_fd, -1); fsize=tell(load_fd); /* go back to old position */ seek_io(load_fd, 0); seek_io(load_fd, fpos); return fsize;}
开发者ID:tycho,项目名称:openbios,代码行数:20,
示例18: QFileSizeunsigned long QFileSize( f_handle file )/**************************************/{ unsigned long curpos; unsigned long size; curpos = tell( file ); size = lseek( file, 0L, SEEK_END ); lseek( file, curpos, SEEK_SET ); return( size );}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:11,
示例19: tellsf::Int64 FileStream::seek(sf::Int64 position){ if (m_file) { std::fseek(m_file, static_cast<std::size_t>(position), SEEK_SET); return tell(); } else { return -1; }}
开发者ID:kenoyer130,项目名称:xvso,代码行数:12,
示例20: tellsf_count_t SoundFile::Memory::read(void* ptr, sf_count_t count, void* user){ Memory* memory = static_cast<Memory*>(user); sf_count_t position = tell(user); if (position + count >= memory->size) count = memory->size - position; std::memcpy(ptr, memory->current, static_cast<std::size_t>(count)); memory->current += count; return count;}
开发者ID:AlexLusitania,项目名称:Stickman-project,代码行数:12,
示例21: seekinline BOOL ByteStreamInFile::seek(const I64 position){ if (tell() != position) {#ifdef _WIN32 return !(_fseeki64(file, position, SEEK_SET));#else return !(fseeko(file, (off_t)position, SEEK_SET));#endif } return TRUE;}
开发者ID:PulseWaves,项目名称:PulseWaves,代码行数:12,
示例22: tell int tell(TreeNode *a, int v,int ind){ if(a==NULL) return -1; if(a->val == v){ arr1[ind] = a->val; x=ind;//cout<<x<<" "<<ind<<"haha"; return ind; } arr1[ind] = a->val; if(a->left){ int ans = tell(a->left, v, ind+1); if(ans !=-1) return ans; } if(a->right){ int ans = tell(a->right, v, ind+1); if(ans !=-1) return ans; } return -1; }
开发者ID:prakhar3agrwal,项目名称:Online-Programming-Codes,代码行数:21,
示例23: finalWriteListsint GFFFile::finalWriteLists(void){ if(seek(offlistidx)) return errcode; for(uint32 i=0;i<lists.size();i++) { listoffs.push_back(tell()-offlistidx); if(binWrite((uint32) lists[i].size())) return errcode; for(uint32 j=0;j<lists[i].size();j++) if(binWrite(lists[i][j])) return errcode; } return errcode = 0;}
开发者ID:EffWun,项目名称:xoreos-tools,代码行数:12,
示例24: find_chunk//---------------------------------------------------// base streamIReader* IReader::open_chunk(u32 ID){ BOOL bCompressed; u32 dwSize = find_chunk(ID, &bCompressed); if (dwSize != 0) { if (bCompressed) { BYTE* dest; unsigned dest_sz; _decompressLZ(&dest, &dest_sz, pointer(), dwSize); return xr_new<CTempReader>(dest, dest_sz, tell() + dwSize); } else { return xr_new<IReader>(pointer(), dwSize, tell() + dwSize); } } else return 0;};
开发者ID:BubbaXXX,项目名称:xray-16,代码行数:23,
示例25: tellint64 FileOutputStream::seek(int64 position){ if (mFile) { std::fseek(mFile, static_cast<std::size_t>(position), SEEK_SET); return tell(); } else { return -1; }}
开发者ID:rockerBOO,项目名称:nex,代码行数:12,
注:本文中的tell函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ tell_log函数代码示例 C++ tegra_pinmux_config_table函数代码示例 |