- Timestamp:
- Dec 10, 2010 5:18:30 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/vfs.h
r34786 r34964 479 479 * @sa RTVfsFileToIoStream 480 480 */ 481 RTDECL(RTVFSFILE) RTVfsIoStrmToFile(RTVFSIOSTREAM hVfsIos);481 RTDECL(RTVFSFILE) RTVfsIoStrmToFile(RTVFSIOSTREAM hVfsIos); 482 482 483 483 /** … … 490 490 * @sa RTFileQueryInfo 491 491 */ 492 RTDECL(int) RTVfsIoStrmQueryInfo(RTVFSIOSTREAM hVfsIos, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr);492 RTDECL(int) RTVfsIoStrmQueryInfo(RTVFSIOSTREAM hVfsIos, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr); 493 493 494 494 /** … … 520 520 * RTSocketRead 521 521 */ 522 RTDECL(int) RTVfsIoStrmRead(RTVFSIOSTREAM hVfsIos, void *pvBuf, size_t cbToRead, bool fBlocking, size_t *pcbRead);522 RTDECL(int) RTVfsIoStrmRead(RTVFSIOSTREAM hVfsIos, void *pvBuf, size_t cbToRead, bool fBlocking, size_t *pcbRead); 523 523 524 524 /** … … 538 538 * RTSocketWrite 539 539 */ 540 RTDECL(int) RTVfsIoStrmWrite(RTVFSIOSTREAM hVfsIos, const void *pvBuf, size_t cbToWrite, bool fBlocking, size_t *pcbWritten);540 RTDECL(int) RTVfsIoStrmWrite(RTVFSIOSTREAM hVfsIos, const void *pvBuf, size_t cbToWrite, bool fBlocking, size_t *pcbWritten); 541 541 542 542 /** … … 610 610 * @sa RTVfsFilePoll, RTPollSetAdd, RTPoll, RTPollNoResume. 611 611 */ 612 RTDECL(int) RTVfsIoStrmPoll(RTVFSIOSTREAM hVfsIos, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr,613 uint32_t *pfRetEvents);612 RTDECL(int) RTVfsIoStrmPoll(RTVFSIOSTREAM hVfsIos, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr, 613 uint32_t *pfRetEvents); 614 614 /** 615 615 * Tells the current I/O stream position. … … 647 647 */ 648 648 RTDECL(bool) RTVfsIoStrmIsAtEnd(RTVFSIOSTREAM hVfsIos); 649 650 /** 651 * Process the rest of the stream, checking if it's all valid UTF-8 encoding. 652 * 653 * @returns VBox status cod.e 654 * 655 * @param hVfsIos The VFS I/O stream handle. 656 */ 657 RTDECL(int) RTVfsIoStrmValidateUtf8Encoding(RTVFSIOSTREAM hVfsIos); 658 649 659 /** @} */ 650 660 -
trunk/src/VBox/Runtime/common/vfs/vfsbase.cpp
r34786 r34964 2254 2254 2255 2255 2256 RTDECL(int) RTVfsIoStrmValidateUtf8Encoding(RTVFSIOSTREAM hVfsIos) 2257 { 2258 char achBuf[1024 + 1]; 2259 size_t cbUsed = 0; 2260 int rc; 2261 for (;;) 2262 { 2263 /* 2264 * Fill the buffer 2265 */ 2266 size_t cbRead = 0; 2267 rc = RTVfsIoStrmRead(hVfsIos, &achBuf[cbUsed], sizeof(achBuf) - cbUsed - 1, true /*fBlocking*/, &cbRead); 2268 if (RT_FAILURE(rc)) 2269 break; 2270 cbUsed += cbRead; 2271 if (!cbUsed) 2272 { 2273 Assert(rc == VINF_EOF); 2274 break; 2275 } 2276 2277 /* 2278 * Process the data in the buffer, maybe leaving the final chars till 2279 * the next round. 2280 */ 2281 /** @todo implement this */ 2282 } 2283 2284 return rc == VINF_EOF ? VINF_SUCCESS : rc; 2285 } 2286 2256 2287 2257 2288
Note:
See TracChangeset
for help on using the changeset viewer.