Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. stringar.hxx
  5. Abstract:
  6. This module contains the definitions for the STRING_ARRAY class.
  7. STRING_ARRAY is used only to store strings, and it provides a
  8. method to sort the strings in ascending or descending order.
  9. The sort methods uses the qsort() function of the C run time
  10. library.
  11. Author:
  12. Jaime F. Sasson (jaimes) 01-May-1991
  13. Environment:
  14. ULIB, User Mode
  15. --*/
  16. #if ! defined( _STRING_ARRAY_ )
  17. #define _STRING_ARRAY_
  18. //
  19. // Default values for an STRING_ARRAY object.
  20. //
  21. // - Capacity is the total number of elemnts that can be stored in an STRING_ARRAY
  22. // - CapacityIncrement is the number of elemnts that the STRING_ARRAY's Capacity
  23. // will be increased by when it's Capacity is exceeded
  24. //
  25. CONST CHNUM DefaultPosition = 0;
  26. // CONST ULONG DefaultCapacity = 50;
  27. // CONST ULONG DefaultCapacityIncrement = 25;
  28. class STRING_ARRAY : public ARRAY {
  29. public:
  30. ULIB_EXPORT
  31. DECLARE_CONSTRUCTOR( STRING_ARRAY );
  32. NONVIRTUAL
  33. ULIB_EXPORT
  34. BOOLEAN
  35. Initialize (
  36. IN CHNUM Position DEFAULT DefaultPosition,
  37. IN ULONG Capacity DEFAULT DefaultCapacity,
  38. IN ULONG CapacityIncrement DEFAULT DefaultCapacityIncrement
  39. );
  40. NONVIRTUAL
  41. ULIB_EXPORT
  42. BOOLEAN
  43. Sort(
  44. IN BOOLEAN Ascending
  45. );
  46. private:
  47. static
  48. NONVIRTUAL
  49. int __cdecl
  50. StringCompare(
  51. IN const void * String1,
  52. IN const void * String2
  53. );
  54. static CHNUM _Position;
  55. static BOOLEAN _Ascending;
  56. };
  57. #endif // _STRING_ARRAY_