Source code of Windows XP (NT5)
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.

74 lines
1.4 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: SqlTree.hxx
  7. //
  8. // History: 16-Dec-96 Felix Wong Created.
  9. //
  10. //----------------------------------------------------------------------------
  11. #ifndef _SQLTREE_HXX
  12. #define _SQLTREE_HXX
  13. #define QUERY_STRING 0
  14. #define BAIL_ON_FAILURE(hr) \
  15. if (FAILED(hr)) { \
  16. goto error; \
  17. }\
  18. class CSQLString
  19. {
  20. public:
  21. CSQLString();
  22. ~CSQLString();
  23. HRESULT Append(LPWSTR szAppend);
  24. HRESULT AppendAtBegin(LPWSTR szAppend);
  25. LPWSTR _szString;
  26. private:
  27. DWORD _dwSize;
  28. DWORD _dwSizeMax;
  29. };
  30. class CSQLNode
  31. {
  32. public:
  33. CSQLNode();
  34. CSQLNode(
  35. DWORD dwType,
  36. CSQLNode *pLQueryNode,
  37. CSQLNode *pRQueryNode
  38. );
  39. ~CSQLNode();
  40. HRESULT SetToString(LPWSTR szValue);
  41. HRESULT GenerateLDAPString(CSQLString *pString);
  42. HRESULT MapTokenToChar(DWORD dwToken, LPWSTR *pszToken);
  43. DWORD _dwType;
  44. private:
  45. LPWSTR _szValue;
  46. CSQLNode *_pLQueryNode;
  47. CSQLNode *_pRQueryNode;
  48. };
  49. // Helper functions
  50. HRESULT MakeNode(
  51. DWORD dwType,
  52. CSQLNode *pLQueryNode,
  53. CSQLNode *pRQueryNode,
  54. CSQLNode **ppQueryNodeReturn
  55. );
  56. HRESULT MakeLeaf(
  57. LPWSTR szValue,
  58. CSQLNode **ppQuerynNodeReturn
  59. );
  60. #endif