Changeset 45400 in vbox
- Timestamp:
- Apr 8, 2013 12:08:00 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
-
include/iprt/mangling.h (modified) (2 diffs)
-
include/iprt/path.h (modified) (3 diffs)
-
src/VBox/Runtime/Makefile.kmk (modified) (2 diffs)
-
src/VBox/Runtime/common/path/RTPathParsedReassemble.cpp (added)
-
src/VBox/Runtime/common/path/RTPathSplitReassemble.cpp (added)
-
src/VBox/Runtime/testcase/tstRTPath.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/mangling.h
r45394 r45400 939 939 # define RTPathJoinEx RT_MANGLER(RTPathJoinEx) 940 940 # define RTPathParse RT_MANGLER(RTPathParse) 941 # define RTPathParsedReassemble RT_MANGLER(RTPathParsedReassemble) 941 942 # define RTPathParseSimple RT_MANGLER(RTPathParseSimple) 942 943 # define RTPathQueryInfo RT_MANGLER(RTPathQueryInfo) … … 956 957 # define RTPathSplitATag RT_MANGLER(RTPathSplitATag) 957 958 # define RTPathSplitFree RT_MANGLER(RTPathSplitFree) 959 # define RTPathSplitReassemble RT_MANGLER(RTPathSplitReassemble) 958 960 # define RTPathStartsWith RT_MANGLER(RTPathStartsWith) 959 961 # define RTPathStartsWithRoot RT_MANGLER(RTPathStartsWithRoot) -
trunk/include/iprt/path.h
r45394 r45400 611 611 * @sa RTPathSplit, RTPathSplitA. 612 612 */ 613 RTDECL(int) RTPathParse(const char *pszPath, PRTPATHPARSED pParsed, size_t cbParsed, uint32_t fFlags); 613 RTDECL(int) RTPathParse(const char *pszPath, PRTPATHPARSED pParsed, size_t cbParsed, uint32_t fFlags); 614 615 /** 616 * Reassembles a path parsed by RTPathParse. 617 * 618 * This will be more useful as more APIs manipulating the RTPATHPARSED output 619 * are added. 620 * 621 * @returns IPRT status code. 622 * @retval VERR_BUFFER_OVERFLOW if @a cbDstPath is less than or equal to 623 * RTPATHPARSED::cchPath. 624 * 625 * @param pszSrcPath The source path. 626 * @param pParsed The parser output for @a pszSrcPath. 627 * @param fFlags Combination of RTPATH_STR_F_STYLE_XXX. 628 * Most users will pass 0. 629 * @param pszDstPath Pointer to the buffer where the path is to be 630 * reassembled. 631 * @param cbDstPath The size of the output buffer. 632 */ 633 RTDECL(int) RTPathParsedReassemble(const char *pszSrcPath, PRTPATHPARSED pParsed, uint32_t fFlags, 634 char *pszDstPath, size_t cbDstPath); 635 614 636 615 637 /** … … 691 713 * @sa RTPathSplitFree, RTPathSplit, RTPathParse. 692 714 */ 693 #define RTPathSplitA(pszPath, ppSplit, fFlags)RTPathSplitATag(pszPath, ppSplit, fFlags, RTPATH_TAG)715 #define RTPathSplitA(pszPath, ppSplit, fFlags) RTPathSplitATag(pszPath, ppSplit, fFlags, RTPATH_TAG) 694 716 695 717 /** … … 720 742 RTDECL(void) RTPathSplitFree(PRTPATHSPLIT pSplit); 721 743 744 /** 745 * Reassembles a path parsed by RTPathSplit. 746 * 747 * This will be more useful as more APIs manipulating the RTPATHSPLIT output are 748 * added. 749 * 750 * @returns IPRT status code. 751 * @retval VERR_BUFFER_OVERFLOW if @a cbDstPath is less than or equal to 752 * RTPATHSPLIT::cchPath. 753 * 754 * @param pParsed The parser output for @a pszSrcPath. 755 * @param fFlags Combination of RTPATH_STR_F_STYLE_XXX. 756 * Most users will pass 0. 757 * @param pszDstPath Pointer to the buffer where the path is to be 758 * reassembled. 759 * @param cbDstPath The size of the output buffer. 760 */ 761 RTDECL(int) RTPathSplitReassemble(PRTPATHSPLIT pSplit, uint32_t fFlags, char *pszDstPath, size_t cbDstPath); 722 762 723 763 /** -
trunk/src/VBox/Runtime/Makefile.kmk
r45394 r45400 363 363 common/path/RTPathJoinEx.cpp \ 364 364 common/path/RTPathParse.cpp \ 365 common/path/RTPathParsedReassemble.cpp \ 365 366 common/path/RTPathParseSimple.cpp \ 366 367 common/path/RTPathRealDup.cpp \ … … 368 369 common/path/RTPathSplit.cpp \ 369 370 common/path/RTPathSplitA.cpp \ 371 common/path/RTPathSplitReassemble.cpp \ 370 372 common/path/RTPathStartsWithRoot.cpp \ 371 373 common/path/RTPathStripExt.cpp \ -
trunk/src/VBox/Runtime/testcase/tstRTPath.cpp
r45394 r45400 87 87 }; 88 88 89 char szPath1[RTPATH_MAX]; 89 90 union 90 91 { … … 116 117 s_aTests[i].offSuffix, u.Parsed.offSuffix, 117 118 s_aTests[i].cchPath, u.Parsed.cchPath); 119 } 120 else 121 { 122 rc = RTPathParsedReassemble(s_aTests[i].pszPath, &u.Parsed, s_aTests[i].fFlags & ~RTPATH_STR_F_MIDDLE, 123 szPath1, sizeof(szPath1)); 124 if (rc == VINF_SUCCESS) 125 { 126 RTTESTI_CHECK_MSG(strlen(szPath1) == s_aTests[i].cchPath, ("%s\n", szPath1)); 127 if ( !(u.Parsed.fProps & RTPATH_PROP_EXTRA_SLASHES) 128 && (s_aTests[i].fFlags & RTPATH_STR_F_STYLE_MASK) != RTPATH_STR_F_STYLE_DOS) 129 RTTESTI_CHECK_MSG(strcmp(szPath1, s_aTests[i].pszPath) == 0, ("%s\n", szPath1)); 130 } 131 else 132 RTTestIFailed("RTPathParsedReassemble -> %Rrc", rc); 118 133 } 119 134 } … … 162 177 RTPathSplitFree(pSplit); 163 178 } 179 180 rc = RTPathSplitReassemble(&u.Split, s_aTests[i].fFlags & ~RTPATH_STR_F_MIDDLE, szPath1, sizeof(szPath1)); 181 if (rc == VINF_SUCCESS) 182 { 183 RTTESTI_CHECK_MSG(strlen(szPath1) == s_aTests[i].cchPath, ("%s\n", szPath1)); 184 if ( !(u.Parsed.fProps & RTPATH_PROP_EXTRA_SLASHES) 185 && (s_aTests[i].fFlags & RTPATH_STR_F_STYLE_MASK) != RTPATH_STR_F_STYLE_DOS) 186 RTTESTI_CHECK_MSG(strcmp(szPath1, s_aTests[i].pszPath) == 0, ("%s\n", szPath1)); 187 } 188 else 189 RTTestIFailed("RTPathSplitReassemble -> %Rrc", rc); 164 190 } 165 191 }
Note:
See TracChangeset
for help on using the changeset viewer.

