Changeset 3369 for trunk/src/comctl32/CCBase.cpp
- Timestamp:
- Apr 12, 2000, 6:39:00 PM (25 years ago)
- File:
-
- 1 edited
-
trunk/src/comctl32/CCBase.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/CCBase.cpp
r3280 r3369 1 /* $Id: CCBase.cpp,v 1. 6 2000-03-30 15:39:08 cbratschi Exp $ */1 /* $Id: CCBase.cpp,v 1.7 2000-04-12 16:38:58 cbratschi Exp $ */ 2 2 /* 3 3 * COMCTL32 Base Functions and Macros for all Controls … … 8 8 */ 9 9 10 #include <string.h> 11 #include <wcstr.h> 10 12 #include "winbase.h" 11 13 #include "comctl32.h" … … 320 322 return res; 321 323 } 324 325 INT lstrcmpAW(WCHAR *textA,BOOL textaunicode,WCHAR *textB,BOOL textbunicode) 326 { 327 if (textaunicode) 328 { 329 if (textbunicode) 330 { 331 return lstrcmpW(textA,textB); 332 } else 333 { 334 return lstrcmpAtoW((LPSTR)textB,textA); 335 } 336 } else 337 { 338 if (textbunicode) 339 { 340 return lstrcmpAtoW((LPSTR)textA,textB); 341 } else 342 { 343 return lstrcmpA((LPSTR)textA,(LPSTR)textB); 344 } 345 } 346 } 347 348 CHAR* lstrstrA(CHAR *text,CHAR *subtext) 349 { 350 return strstr(text,subtext); 351 } 352 353 WCHAR* lstrstrW(WCHAR *text,WCHAR *subtext) 354 { 355 return (WCHAR*)wcswcs((const wchar_t*)text,(wchar_t*)subtext); 356 } 357 358 //NOTE: less information in ASCII subtext 359 CHAR* lstrstrAtoW(CHAR *text,WCHAR *subtext) 360 { 361 INT len; 362 CHAR *tmp,*res; 363 364 len = lstrlenW(subtext); 365 if (len > 0) 366 { 367 len++; 368 tmp = (CHAR*)COMCTL32_Alloc(len); 369 lstrcpyWtoA(tmp,subtext); 370 } else tmp = NULL; 371 372 res = strstr(text,tmp); 373 374 if (tmp) COMCTL32_Free(tmp); 375 return res; 376 } 377 378 WCHAR* lstrstrWtoA(WCHAR *text,CHAR *subtext) 379 { 380 INT len; 381 WCHAR *tmp,*res; 382 383 len = lstrlenA(subtext); 384 if (len > 0) 385 { 386 len++; 387 tmp = (WCHAR*)COMCTL32_Alloc(len*sizeof(WCHAR)); 388 lstrcpyAtoW(tmp,subtext); 389 } else tmp = NULL; 390 391 res = (WCHAR*)wcswcs((const wchar_t*)text,(wchar_t*)tmp); 392 393 if (tmp) COMCTL32_Free(tmp); 394 return res; 395 } 396 397 WCHAR* lstrstrAW(WCHAR *text,BOOL textunicode,WCHAR *subtext,BOOL subtextunicode) 398 { 399 if (textunicode) 400 { 401 if (subtextunicode) 402 { 403 return lstrstrW(text,subtext); 404 } else 405 { 406 return lstrstrWtoA(text,(LPSTR)subtext); 407 } 408 } else 409 { 410 if (subtextunicode) 411 { 412 return (WCHAR*)lstrstrAtoW((LPSTR)text,subtext); 413 } else 414 { 415 return (WCHAR*)lstrstrA((LPSTR)text,(LPSTR)subtext); 416 } 417 } 418 }
Note:
See TracChangeset
for help on using the changeset viewer.
