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.

167 lines
5.0 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // Copyright (C) Microsoft Corporation, 1996 - 2000.
  4. //
  5. // File: ixsinfo.hxx
  6. //
  7. // Author:
  8. // 1/24 benholz
  9. //
  10. // Description:
  11. // This files describes the query information that is passed from the
  12. // browser.
  13. //
  14. // History:
  15. // 4/22/96 benholz added query form parsing; removed old stuff
  16. // 7/11/96 bobp added sort/group/match null
  17. // 3/19/97 AlanW modified for IXSSO
  18. //
  19. //-----------------------------------------------------------------------------
  20. #pragma once
  21. // Operator for connecting Cn On Qn terms
  22. #define IMPLIED_QUERY_TERM_OPERATOR L" &"
  23. //-----------------------------------------------------------------------------
  24. // Stucture Info
  25. //-----------------------------------------------------------------------------
  26. // Table of argument strings for http query from browser
  27. typedef enum _QUERYTAGENUM {
  28. qtUnknownTag, //signal an error for unknown tags
  29. qtQuery,
  30. qtColumn,
  31. qtOperator,
  32. qtCatalog,
  33. qtDialect,
  34. qtQueryFullText,
  35. qtStartHit,
  36. qtMaxHits,
  37. qtSort,
  38. qtSortDown,
  39. qtGroup,
  40. qtGroupDown,
  41. qtAllowEnumeration,
  42. qtOptimizeFor,
  43. qtMaxTag,
  44. qtFirstRows //highest enum value
  45. } QUERYTAGTYPE;
  46. typedef struct _QUERYTAGENTRY {
  47. DWORD dwTagName;
  48. QUERYTAGTYPE qtQueryTagType;
  49. } QUERYTAGENTRY;
  50. const QUERYTAGENTRY aQueryTagTable[] = {
  51. 'Q', qtQuery,
  52. 'C', qtColumn,
  53. 'O', qtOperator,
  54. 'QU', qtQueryFullText,
  55. 'SO', qtSort,
  56. 'SD', qtSortDown,
  57. 'GR', qtGroup,
  58. 'GD', qtGroupDown,
  59. 'MH', qtMaxHits,
  60. 'CT', qtCatalog,
  61. 'DI', qtDialect,
  62. 'SH', qtStartHit,
  63. 'AE', qtAllowEnumeration,
  64. 'OP', qtOptimizeFor,
  65. // 'MT', qtMaxTime,
  66. // 'DS', qtDateStart,
  67. // 'DE', qtDateEnd,
  68. // 'NL', qtMatchNull,
  69. // 'IM', qtIndexSequenceMarker,
  70. 'FR', qtFirstRows,
  71. };
  72. const unsigned cQueryTagTable = sizeof aQueryTagTable / sizeof aQueryTagTable[0];
  73. class CQueryInfo
  74. {
  75. public:
  76. CQueryInfo() :
  77. _xpQuery(0),
  78. _xpSort(0),
  79. _xpGroup(0),
  80. _xpCatalog(0),
  81. _xpDialect(0),
  82. _aQueryCol(10),
  83. _aQueryOp(10),
  84. _aQueryVal(10),
  85. _aStartHit(0),
  86. _maxHits(0),
  87. _cFirstRows(0),
  88. _fAllowEnumeration(FALSE),
  89. _fSetAllowEnumeration(FALSE),
  90. _dwOptimizeFor(eOptHitCount) { }
  91. ~CQueryInfo() { }
  92. void SetQueryParameter( WCHAR const * pwszTag,
  93. XPtrST<WCHAR> & pwszValue );
  94. void MakeFinalQueryString();
  95. // Private member access functions
  96. WCHAR * GetQuery() { return _xpQuery.GetPointer(); }
  97. WCHAR * GetSort() { return _xpSort.GetPointer(); }
  98. WCHAR * GetGroup() { return _xpGroup.GetPointer(); }
  99. WCHAR * GetCatalog() { return _xpCatalog.GetPointer(); }
  100. WCHAR * GetDialect() { return _xpDialect.GetPointer(); }
  101. CDynArrayInPlace<LONG> & GetStartHit() { return _aStartHit; }
  102. LONG GetMaxHits() { return _maxHits; }
  103. LONG GetFirstRows() { return _cFirstRows; }
  104. BOOL WasAllowEnumSet() { return _fSetAllowEnumeration; }
  105. BOOL GetAllowEnum() { return _fAllowEnumeration; }
  106. DWORD GetOptimizeFor() { return _dwOptimizeFor; }
  107. WCHAR * AcquireQuery() { return _xpQuery.Acquire(); }
  108. WCHAR * AcquireSort() { return _xpSort.Acquire(); }
  109. WCHAR * AcquireGroup() { return _xpGroup.Acquire(); }
  110. WCHAR * AcquireCatalog() { return _xpCatalog.Acquire(); }
  111. WCHAR * AcquireDialect() { return _xpDialect.Acquire(); }
  112. private:
  113. void AddToParam( XPtrST<WCHAR> & xpParam,
  114. XPtrST<WCHAR> & pwszVal,
  115. WCHAR const * pwszPre = 0,
  116. WCHAR const * pwszPost = 0 );
  117. void SetBuiltupQueryTerm( CDynArray<WCHAR> & apString,
  118. unsigned iTerm,
  119. XPtrST<WCHAR> & pwszValue );
  120. //
  121. // settable string values
  122. //
  123. XPtrST<WCHAR> _xpQuery;
  124. XPtrST<WCHAR> _xpSort;
  125. XPtrST<WCHAR> _xpGroup;
  126. XPtrST<WCHAR> _xpCatalog;
  127. XPtrST<WCHAR> _xpDialect;
  128. //
  129. // Strings for built-up queries.
  130. //
  131. CDynArray<WCHAR> _aQueryCol; //
  132. CDynArray<WCHAR> _aQueryOp; //
  133. CDynArray<WCHAR> _aQueryVal; //
  134. CDynArrayInPlace<LONG> _aStartHit; //
  135. LONG _maxHits;
  136. LONG _cFirstRows;
  137. BOOL _fAllowEnumeration;
  138. BOOL _fSetAllowEnumeration;
  139. DWORD _dwOptimizeFor;
  140. };