Changeset 25596 in vbox
- Timestamp:
- Dec 30, 2009 10:53:20 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56287
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/strformatrt.cpp
r25000 r25596 131 131 * - \%Rfn - Pretty printing of a function or method. It drops the 132 132 * return code and parameter list. 133 * - \%Rbn - Prints the base name. For dropping the path in 134 * order to save space when printing a path name. 133 135 * 134 136 * On other platforms, \%Rw? simply prints the argument in a form of 0xXXXXXXXX. … … 160 162 #include <iprt/time.h> 161 163 #include <iprt/net.h> 164 #include <iprt/path.h> 162 165 #include "internal/string.h" 163 166 … … 568 571 569 572 /* 573 * Base name printing. 574 */ 575 case 'b': 576 { 577 switch (*(*ppszFormat)++) 578 { 579 case 'n': 580 { 581 const char *pszLastSep; 582 const char *psz = pszLastSep = va_arg(*pArgs, const char *); 583 if (!VALID_PTR(psz)) 584 return pfnOutput(pvArgOutput, "<null>", sizeof("<null>") - 1); 585 586 while ((ch = *psz) != '\0') 587 { 588 if (RTPATH_IS_SEP(ch)) 589 { 590 do 591 psz++; 592 while ((ch = *psz) != '\0' && RTPATH_IS_SEP(ch)); 593 if (!ch) 594 break; 595 pszLastSep = psz; 596 } 597 psz++; 598 } 599 600 return pfnOutput(pvArgOutput, pszLastSep, psz - pszLastSep); 601 } 602 603 default: 604 AssertMsgFailed(("Invalid status code format type '%.10s'!\n", pszFormatOrg)); 605 break; 606 } 607 break; 608 } 609 610 611 /* 570 612 * Pretty function / method name printing. 571 613 */ -
trunk/src/VBox/Runtime/testcase/tstRTStrFormat.cpp
r23961 r25596 231 231 CHECK42("%RI8", (int8_t)-128, "-128"); 232 232 233 CHECK42("%Rbn", "file.c", "file.c"); 234 CHECK42("%Rbn", "foo/file.c", "file.c"); 235 CHECK42("%Rbn", "/foo/file.c", "file.c"); 236 CHECK42("%Rbn", "/dir/subdir/", "subdir/"); 237 238 CHECK42("%Rfn", "function", "function"); 239 CHECK42("%Rfn", "void function(void)", "function"); 240 233 241 CHECK42("%RTfile", (RTFILE)127, "127"); 234 242 CHECK42("%RTfile", (RTFILE)12341234, "12341234");
Note:
See TracChangeset
for help on using the changeset viewer.