Changeset 851 for trunk/src/ole32/oString.cpp
- Timestamp:
- Sep 7, 1999, 9:26:19 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ole32/oString.cpp
r784 r851 96 96 97 97 // Initialise to a specified length... 98 oStringA::oStringA(int defLen ) : oStringBase(sizeof(char))98 oStringA::oStringA(int defLen, int fill) : oStringBase(sizeof(char)) 99 99 { 100 100 getBuf( defLen + 1); … … 138 138 } 139 139 140 oStringA::oStringA(const ULONG val) : oStringBase(sizeof(char)) 141 { 142 getBuf( 30); // Incl. terminator... 143 m_strLen = sprintf(m_strBuf, "%lu", val); 144 } 145 146 oStringA::oStringA(const LONG val) : oStringBase(sizeof(char)) 147 { 148 getBuf( 30); // Incl. terminator... 149 m_strLen = sprintf(m_strBuf, "%ld", val); 150 } 151 152 oStringA::oStringA(const USHORT val) : oStringBase(sizeof(char)) 153 { 154 getBuf( 30); // Incl. terminator... 155 m_strLen = sprintf(m_strBuf, "%u", val); 156 } 157 158 oStringA::oStringA(const SHORT val) : oStringBase(sizeof(char)) 159 { 160 getBuf( 30); // Incl. terminator... 161 m_strLen = sprintf(m_strBuf, "%d", val); 162 } 163 140 164 // Return pointer to string... 141 165 oStringA::operator LPSTR() … … 193 217 // Setup new string... 194 218 getBuf( 50); 195 m_strLen = sprintf(m_strBuf, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", 196 rClsId->Data1, 197 rClsId->Data2, 198 rClsId->Data3, 199 rClsId->Data4[0], 200 rClsId->Data4[1], 201 rClsId->Data4[2], 202 rClsId->Data4[3], 203 rClsId->Data4[4], 204 rClsId->Data4[5], 205 rClsId->Data4[6], 206 rClsId->Data4[7]); 219 WINE_StringFromCLSID(rClsId, m_strBuf); 220 m_strLen = strlen(m_strBuf); 221 207 222 return *this; 208 223 } … … 212 227 { 213 228 // two terminators to account for... 214 oStringA product(m_strLen + string.m_strLen - 1 );229 oStringA product(m_strLen + string.m_strLen - 1, 1); 215 230 216 231 memcpy(product.m_strBuf, m_strBuf, m_strLen); … … 226 241 long strLen = m_strLen + strlen(pAscii); 227 242 228 oStringA product(strLen );243 oStringA product(strLen, 1); 229 244 230 245 memcpy(product.m_strBuf, m_strBuf, m_strLen); … … 240 255 long strLen = m_strLen + lstrlenW(pUnicode); 241 256 242 oStringA product(strLen );257 oStringA product(strLen, 1); 243 258 244 259 memcpy(product.m_strBuf, m_strBuf, m_strLen); … … 297 312 298 313 // Initialise to a specified length... 299 oStringW::oStringW(int defLen ) : oStringBase(sizeof(WCHAR))314 oStringW::oStringW(int defLen, int fill) : oStringBase(sizeof(WCHAR)) 300 315 { 301 316 getBuf( defLen + 1); … … 419 434 // Setup new string... 420 435 getBuf( 50); 421 m_strLen = sprintf(tmp, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", 422 rClsId->Data1, 423 rClsId->Data2, 424 rClsId->Data3, 425 rClsId->Data4[0], 426 rClsId->Data4[1], 427 rClsId->Data4[2], 428 rClsId->Data4[3], 429 rClsId->Data4[4], 430 rClsId->Data4[5], 431 rClsId->Data4[6], 432 rClsId->Data4[7]); 436 WINE_StringFromCLSID(rClsId, tmp); 437 m_strLen = strlen(tmp); 433 438 AsciiToUnicode(tmp, (LPWSTR)m_strBuf); 434 439 return *this; … … 439 444 { 440 445 // two terminators to account for... 441 oStringW product(m_strLen + string.m_strLen - 1 );446 oStringW product(m_strLen + string.m_strLen - 1, 1); 442 447 443 448 lstrcpyW((LPWSTR)product.m_strBuf, (LPWSTR)m_strBuf); … … 453 458 long strLen = m_strLen + strlen(pAscii); 454 459 455 oStringW product(strLen );460 oStringW product(strLen, 1); 456 461 457 462 lstrcpyW((LPWSTR)product.m_strBuf, (LPWSTR)m_strBuf); … … 467 472 long strLen = m_strLen + lstrlenW(pUnicode); 468 473 469 oStringW product(strLen );474 oStringW product(strLen, 1); 470 475 471 476 lstrcpyW((LPWSTR)product.m_strBuf, (LPWSTR)m_strBuf); … … 481 486 long strLen = m_strLen + lstrlenW((LPWSTR)pUnicode); 482 487 483 oStringW product(strLen );488 oStringW product(strLen, 1); 484 489 485 490 lstrcpyW((LPWSTR)product.m_strBuf, (LPWSTR)m_strBuf);
Note:
See TracChangeset
for help on using the changeset viewer.