Changeset 35128 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Dec 15, 2010 12:38:41 PM (14 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/ministring.cpp
r33605 r35128 212 212 213 213 return npos; 214 } 215 216 void MiniString::findReplace(char cFind, char cReplace) 217 { 218 for (size_t i = 0; i < length(); ++i) 219 { 220 char *p = &m_psz[i]; 221 if (*p == cFind) 222 *p = cReplace; 223 } 214 224 } 215 225 -
trunk/src/VBox/Runtime/r3/xml.cpp
r33835 r35128 831 831 { 832 832 str = pAttr->getValue(); 833 return true; 834 } 835 836 return false; 837 } 838 839 /** 840 * Like getAttributeValue (ministring variant), but makes sure that all backslashes 841 * are converted to forward slashes. 842 * @param pcszMatch 843 * @param str 844 * @return 845 */ 846 bool ElementNode::getAttributeValuePath(const char *pcszMatch, iprt::MiniString &str) const 847 { 848 if (getAttributeValue(pcszMatch, str)) 849 { 850 str.findReplace('\\', '/'); 833 851 return true; 834 852 } … … 1054 1072 1055 1073 /** 1074 * Like setAttribute (ministring variant), but replaces all backslashes with forward slashes 1075 * before calling that one. 1076 * @param pcszName 1077 * @param strValue 1078 * @return 1079 */ 1080 AttributeNode* ElementNode::setAttributePath(const char *pcszName, const iprt::MiniString &strValue) 1081 { 1082 iprt::MiniString strTemp(strValue); 1083 strTemp.findReplace('\\', '/'); 1084 return setAttribute(pcszName, strTemp.c_str()); 1085 } 1086 1087 /** 1056 1088 * Sets the given attribute; overloaded version for int32_t. 1057 1089 *
Note:
See TracChangeset
for help on using the changeset viewer.