Changeset 45391 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Apr 7, 2013 5:15:29 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 84816
- Location:
- trunk/src/VBox/Runtime/common/path
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/path/RTPathParse.cpp
r45390 r45391 50 50 AssertPtrReturn(pszPath, VERR_INVALID_POINTER); 51 51 AssertReturn(*pszPath, VERR_PATH_ZERO_LENGTH); 52 AssertReturn( !(fFlags & ~RTPATHPARSE_FLAGS_VALID_MASK), VERR_INVALID_FLAGS);52 AssertReturn(RTPATH_STR_F_IS_VALID(fFlags, 0), VERR_INVALID_FLAGS); 53 53 54 54 /* 55 55 * Invoke the worker for the selected path style. 56 56 */ 57 switch (fFlags & RTPATH PARSE_FLAGS_STYLE_MASK)57 switch (fFlags & RTPATH_STR_F_STYLE_MASK) 58 58 { 59 59 #if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS) 60 case RTPATH PARSE_FLAGS_STYLE_HOST:60 case RTPATH_STR_F_STYLE_HOST: 61 61 #endif 62 case RTPATH PARSE_FLAGS_STYLE_DOS:62 case RTPATH_STR_F_STYLE_DOS: 63 63 return rtPathParseStyleDos(pszPath, pParsed, cbParsed, fFlags); 64 64 65 65 #if !defined(RT_OS_OS2) && !defined(RT_OS_WINDOWS) 66 case RTPATH PARSE_FLAGS_STYLE_HOST:66 case RTPATH_STR_F_STYLE_HOST: 67 67 #endif 68 case RTPATH PARSE_FLAGS_STYLE_UNIX:68 case RTPATH_STR_F_STYLE_UNIX: 69 69 return rtPathParseStyleUnix(pszPath, pParsed, cbParsed, fFlags); 70 70 71 71 default: 72 AssertFailedReturn(VERR_INVALID_FLAGS); 72 AssertFailedReturn(VERR_INVALID_FLAGS); /* impossible */ 73 73 } 74 74 } -
trunk/src/VBox/Runtime/common/path/RTPathParse.cpp.h
r45389 r45391 48 48 if (RTPATH_IS_SLASH(pszPath[0])) 49 49 { 50 if (fFlags & RTPATH PARSE_FLAGS_NO_START)50 if (fFlags & RTPATH_STR_F_NO_START) 51 51 { 52 52 offCur = 1; … … 58 58 cchPath = 0; 59 59 } 60 #if def RTPATH_STYLE_DOS60 #if RTPATH_STYLE == RTPATH_STR_F_STYLE_DOS 61 61 else if ( RTPATH_IS_SLASH(pszPath[1]) 62 62 && !RTPATH_IS_SLASH(pszPath[2]) … … 84 84 else 85 85 { 86 #if def RTPATH_STYLE_DOS86 #if RTPATH_STYLE == RTPATH_STR_F_STYLE_DOS 87 87 fProps = RTPATH_PROP_ROOT_SLASH | RTPATH_PROP_RELATIVE; 88 88 #else … … 92 92 } 93 93 } 94 #if def RTPATH_STYLE_DOS94 #if RTPATH_STYLE == RTPATH_STR_F_STYLE_DOS 95 95 else if (RT_C_IS_ALPHA(pszPath[0]) && pszPath[1] == ':') 96 96 { … … 115 115 116 116 /* Add it to the component array . */ 117 if (offCur && !(fFlags & RTPATH PARSE_FLAGS_NO_START))117 if (offCur && !(fFlags & RTPATH_STR_F_NO_START)) 118 118 { 119 119 cchPath = offCur; … … 192 192 if (ch) 193 193 { 194 if (!(fFlags & RTPATH PARSE_FLAGS_NO_END))194 if (!(fFlags & RTPATH_STR_F_NO_END)) 195 195 fProps |= RTPATH_PROP_DIR_SLASH; /* (not counted) */ 196 196 else 197 197 fProps |= RTPATH_PROP_EXTRA_SLASHES; 198 198 } 199 else if (!(fFlags & RTPATH PARSE_FLAGS_NO_END))199 else if (!(fFlags & RTPATH_STR_F_NO_END)) 200 200 { 201 201 fProps |= RTPATH_PROP_FILENAME; -
trunk/src/VBox/Runtime/common/path/rtpath-expand-template.cpp.h
r45389 r45391 26 26 */ 27 27 28 #undef RTPATH_DELIMITER 28 29 29 30 /* 30 * The following should move to a helper header!31 * DOS style 31 32 */ 32 #undef RTPATH_DELIMITER 33 34 /* DOS style */ 35 #undef RTPATH_STYLE_UNIX 36 #undef RTPATH_STYLE_DOS 33 #undef RTPATH_STYLE 34 #undef RTPATH_SLASH 37 35 #undef RTPATH_SLASH_STR 38 36 #undef RTPATH_IS_SLASH … … 40 38 #undef RTPATH_STYLE_FN 41 39 42 #define RTPATH_STYLE_DOS 40 #define RTPATH_STYLE RTPATH_STR_F_STYLE_DOS 41 #define RTPATH_SLASH '\\' 43 42 #define RTPATH_SLASH_STR "\\" 44 43 #define RTPATH_IS_SLASH(a_ch) ( (a_ch) == '\\' || (a_ch) == '/' ) … … 47 46 #include RTPATH_TEMPLATE_CPP_H 48 47 49 /* Unix style. */ 50 #undef RTPATH_STYLE_UNIX 51 #undef RTPATH_STYLE_DOS 48 /* 49 * Unix style. 50 */ 51 #undef RTPATH_STYLE 52 #undef RTPATH_SLASH 52 53 #undef RTPATH_SLASH_STR 53 54 #undef RTPATH_IS_SLASH … … 55 56 #undef RTPATH_STYLE_FN 56 57 57 #define RTPATH_STYLE_UNIX 58 #define RTPATH_STYLE RTPATH_STR_F_STYLE_UNIX 59 #define RTPATH_SLASH '/' 58 60 #define RTPATH_SLASH_STR "/" 59 61 #define RTPATH_IS_SLASH(a_ch) ( (a_ch) == '/' ) … … 62 64 #include RTPATH_TEMPLATE_CPP_H 63 65 64 /* Restore original style. */ 66 /* 67 * Clean up and restore the host style. 68 */ 65 69 #undef RTPATH_STYLE_FN 66 70 #if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS) 67 # undef RTPATH_STYLE_UNIX 68 # undef RTPATH_STYLE_DOS 71 # undef RTPATH_STYLE 69 72 # undef RTPATH_SLASH_STR 70 73 # undef RTPATH_IS_SLASH 71 74 # undef RTPATH_IS_VOLSEP 72 # define RTPATH_SLASH_STR "\\" 73 # define RTPATH_IS_SLASH(a_ch) ( (a_ch) == '\\' || (a_ch) == '/' ) 74 # define RTPATH_IS_VOLSEP(a_ch) ( (a_ch) == ':' ) 75 # define RTPATH_STYLE RTPATH_STR_F_STYLE_DOS 76 # define RTPATH_SLASH '\\' 77 # define RTPATH_SLASH_STR "\\" 78 # define RTPATH_IS_SLASH(a_ch) ( (a_ch) == '\\' || (a_ch) == '/' ) 79 # define RTPATH_IS_VOLSEP(a_ch) ( (a_ch) == ':' ) 75 80 #endif 76 81
Note:
See TracChangeset
for help on using the changeset viewer.