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.

378 lines
9.5 KiB

  1. #ifndef _CSYNTAX_H_
  2. #define _CSYNTAX_H_
  3. class COleDsSyntax: public CObject
  4. {
  5. public:
  6. COleDsSyntax( );
  7. public:
  8. virtual CString VarToDisplayString( VARIANT&, BOOL bMultiValued, BOOL bUseGetEx );
  9. virtual BOOL DisplayStringToDispParams( CString&, DISPPARAMS&, BOOL bMultiValued, BOOL bUseGetEx );
  10. virtual CString VarToDisplayStringEx( VARIANT&, BOOL bMultiValued );
  11. virtual BOOL DisplayStringToDispParamsEx( CString&, DISPPARAMS&, BOOL bMultiValued );
  12. virtual HRESULT Native2Value ( ADSVALUE*, CString& );
  13. virtual HRESULT Value2Native ( ADSVALUE*, CString& );
  14. virtual void FreeAttrValue ( ADSVALUE* );
  15. void FreeAttrInfo ( ADS_ATTR_INFO* );
  16. HRESULT Native2Value ( ADS_ATTR_INFO*, CString& );
  17. HRESULT Value2Native ( ADS_ATTR_INFO*, CString& );
  18. public:
  19. DWORD m_dwSyntaxID;
  20. protected:
  21. CString GetValueByIndex ( CString&, TCHAR, DWORD );
  22. DWORD GetValuesCount ( CString&, TCHAR );
  23. protected:
  24. VARTYPE m_lType;
  25. };
  26. class COleDsBSTR: public COleDsSyntax
  27. {
  28. public:
  29. COleDsBSTR( );
  30. public:
  31. virtual HRESULT Native2Value ( ADSVALUE*, CString& );
  32. virtual HRESULT Value2Native ( ADSVALUE*, CString& );
  33. virtual void FreeAttrValue ( ADSVALUE* );
  34. };
  35. class COleDsBOOL: public COleDsSyntax
  36. {
  37. public:
  38. COleDsBOOL( );
  39. public:
  40. virtual HRESULT Native2Value ( ADSVALUE*, CString& );
  41. virtual HRESULT Value2Native ( ADSVALUE*, CString& );
  42. };
  43. class COleDsLONG: public COleDsSyntax
  44. {
  45. public:
  46. COleDsLONG( );
  47. public:
  48. virtual HRESULT Native2Value ( ADSVALUE*, CString& );
  49. virtual HRESULT Value2Native ( ADSVALUE*, CString& );
  50. };
  51. class COleDsLargeInteger: public COleDsSyntax
  52. {
  53. public:
  54. COleDsLargeInteger( );
  55. public:
  56. HRESULT Native2Value ( ADSVALUE*, CString& );
  57. HRESULT Value2Native ( ADSVALUE*, CString& );
  58. BOOL DisplayStringToDispParams( CString&, DISPPARAMS&, BOOL, BOOL );
  59. BOOL DisplayStringToDispParamsEx( CString&, DISPPARAMS&, BOOL bMultiValued );
  60. CString VarToDisplayStringEx( VARIANT&, BOOL bMultiValued );
  61. CString VarToDisplayString( VARIANT&, BOOL, BOOL );
  62. };
  63. class COleDsDATE: public COleDsSyntax
  64. {
  65. public:
  66. COleDsDATE( );
  67. public:
  68. virtual HRESULT Native2Value ( ADSVALUE*, CString& );
  69. virtual HRESULT Value2Native ( ADSVALUE*, CString& );
  70. };
  71. class COleDsNDSComplexType: public COleDsSyntax
  72. {
  73. public:
  74. COleDsNDSComplexType ( );
  75. CString VarToDisplayString ( VARIANT&, BOOL, BOOL );
  76. BOOL DisplayStringToDispParams ( CString&, DISPPARAMS&, BOOL, BOOL );
  77. CString VarToDisplayStringEx ( VARIANT&, BOOL bMultiValued );
  78. BOOL DisplayStringToDispParamsEx( CString&, DISPPARAMS&, BOOL bMultiValued );
  79. private:
  80. virtual HRESULT String_2_VARIANT( TCHAR*, VARIANT& ) = 0;
  81. virtual HRESULT VARIANT_2_String( TCHAR*, VARIANT& ) = 0;
  82. };
  83. class COleDsNDSTimeStamp: public COleDsNDSComplexType
  84. {
  85. public:
  86. COleDsNDSTimeStamp ( );
  87. HRESULT Native2Value ( ADSVALUE*, CString& );
  88. HRESULT Value2Native ( ADSVALUE*, CString& );
  89. private:
  90. HRESULT String_2_VARIANT( TCHAR*, VARIANT& );
  91. HRESULT VARIANT_2_String( TCHAR*, VARIANT& );
  92. HRESULT GetComponents ( TCHAR*, DWORD*, DWORD* );
  93. HRESULT GenerateString ( TCHAR*, DWORD, DWORD );
  94. };
  95. class COleDsNDSCaseIgnoreList: public COleDsNDSComplexType
  96. {
  97. public:
  98. COleDsNDSCaseIgnoreList ( );
  99. HRESULT Native2Value ( ADSVALUE*, CString& );
  100. HRESULT Value2Native ( ADSVALUE*, CString& );
  101. void FreeAttrValue ( ADSVALUE* );
  102. private:
  103. HRESULT String_2_VARIANT( TCHAR*, VARIANT& );
  104. HRESULT VARIANT_2_String( TCHAR*, VARIANT& );
  105. };
  106. class COleDsNDSOctetList: public COleDsNDSComplexType
  107. {
  108. public:
  109. COleDsNDSOctetList ( );
  110. HRESULT Native2Value ( ADSVALUE*, CString& );
  111. HRESULT Value2Native ( ADSVALUE*, CString& );
  112. void FreeAttrValue ( ADSVALUE* );
  113. private:
  114. HRESULT String_2_VARIANT( TCHAR*, VARIANT& );
  115. HRESULT VARIANT_2_String( TCHAR*, VARIANT& );
  116. };
  117. class COleDsNDSNetAddress: public COleDsNDSComplexType
  118. {
  119. public:
  120. COleDsNDSNetAddress ( );
  121. HRESULT Native2Value ( ADSVALUE*, CString& );
  122. HRESULT Value2Native ( ADSVALUE*, CString& );
  123. void FreeAttrValue ( ADSVALUE* );
  124. private:
  125. HRESULT String_2_VARIANT( TCHAR*, VARIANT& );
  126. HRESULT VARIANT_2_String( TCHAR*, VARIANT& );
  127. };
  128. class COleDsNDSPostalAddress: public COleDsNDSComplexType
  129. {
  130. public:
  131. COleDsNDSPostalAddress ( );
  132. HRESULT Native2Value ( ADSVALUE*, CString& );
  133. HRESULT Value2Native ( ADSVALUE*, CString& );
  134. void FreeAttrValue ( ADSVALUE* );
  135. private:
  136. HRESULT String_2_VARIANT( TCHAR*, VARIANT& );
  137. HRESULT VARIANT_2_String( TCHAR*, VARIANT& );
  138. };
  139. class COleDsNDSEMail: public COleDsNDSComplexType
  140. {
  141. public:
  142. COleDsNDSEMail( );
  143. HRESULT Native2Value ( ADSVALUE*, CString& );
  144. HRESULT Value2Native ( ADSVALUE*, CString& );
  145. void FreeAttrValue ( ADSVALUE* );
  146. private:
  147. HRESULT String_2_VARIANT( TCHAR*, VARIANT& );
  148. HRESULT VARIANT_2_String( TCHAR*, VARIANT& );
  149. };
  150. class COleDsNDSFaxNumber: public COleDsNDSComplexType
  151. {
  152. public:
  153. COleDsNDSFaxNumber( );
  154. HRESULT Native2Value ( ADSVALUE*, CString& );
  155. HRESULT Value2Native ( ADSVALUE*, CString& );
  156. void FreeAttrValue ( ADSVALUE* );
  157. private:
  158. HRESULT String_2_VARIANT( TCHAR*, VARIANT& );
  159. HRESULT VARIANT_2_String( TCHAR*, VARIANT& );
  160. };
  161. class COleDsNDSBackLink: public COleDsNDSComplexType
  162. {
  163. public:
  164. COleDsNDSBackLink( );
  165. HRESULT Native2Value ( ADSVALUE*, CString& );
  166. HRESULT Value2Native ( ADSVALUE*, CString& );
  167. void FreeAttrValue ( ADSVALUE* );
  168. private:
  169. HRESULT String_2_VARIANT( TCHAR*, VARIANT& );
  170. HRESULT VARIANT_2_String( TCHAR*, VARIANT& );
  171. };
  172. class COleDsNDSPath: public COleDsNDSComplexType
  173. {
  174. public:
  175. COleDsNDSPath( );
  176. HRESULT Native2Value ( ADSVALUE*, CString& );
  177. HRESULT Value2Native ( ADSVALUE*, CString& );
  178. void FreeAttrValue ( ADSVALUE* );
  179. private:
  180. HRESULT String_2_VARIANT( TCHAR*, VARIANT& );
  181. HRESULT VARIANT_2_String( TCHAR*, VARIANT& );
  182. };
  183. class COleDsNDSHold: public COleDsNDSComplexType
  184. {
  185. public:
  186. COleDsNDSHold( );
  187. HRESULT Native2Value ( ADSVALUE*, CString& );
  188. HRESULT Value2Native ( ADSVALUE*, CString& );
  189. void FreeAttrValue ( ADSVALUE* );
  190. private:
  191. HRESULT String_2_VARIANT( TCHAR*, VARIANT& );
  192. HRESULT VARIANT_2_String( TCHAR*, VARIANT& );
  193. };
  194. class COleDsNDSTypedName: public COleDsNDSComplexType
  195. {
  196. public:
  197. COleDsNDSTypedName( );
  198. HRESULT Native2Value ( ADSVALUE*, CString& );
  199. HRESULT Value2Native ( ADSVALUE*, CString& );
  200. void FreeAttrValue ( ADSVALUE* );
  201. private:
  202. HRESULT String_2_VARIANT( TCHAR*, VARIANT& );
  203. HRESULT VARIANT_2_String( TCHAR*, VARIANT& );
  204. };
  205. class COleDsVARIANT: public COleDsSyntax
  206. {
  207. public:
  208. COleDsVARIANT( ){};
  209. public:
  210. CString VarToDisplayString( VARIANT&, BOOL, BOOL );
  211. BOOL DisplayStringToDispParams( CString&, DISPPARAMS&, BOOL, BOOL );
  212. public:
  213. virtual HRESULT Native2Value ( ADSVALUE*, CString& );
  214. virtual HRESULT Value2Native ( ADSVALUE*, CString& );
  215. };
  216. class COleDsOctetString: public COleDsSyntax
  217. {
  218. public:
  219. COleDsOctetString( );
  220. public:
  221. CString VarToDisplayString( VARIANT&, BOOL, BOOL );
  222. BOOL DisplayStringToDispParams( CString&, DISPPARAMS&, BOOL, BOOL );
  223. CString VarToDisplayStringEx( VARIANT&, BOOL bMultiValued );
  224. BOOL DisplayStringToDispParamsEx( CString&, DISPPARAMS&, BOOL bMultiValued );
  225. public:
  226. virtual HRESULT Native2Value ( ADSVALUE*, CString& );
  227. virtual HRESULT Value2Native ( ADSVALUE*, CString& );
  228. virtual void FreeAttrValue ( ADSVALUE* );
  229. private:
  230. BYTE GetByteValue( TCHAR* szString );
  231. };
  232. class COleDsCounter: public COleDsLONG
  233. {
  234. public:
  235. COleDsCounter( ){};
  236. };
  237. class COleDsNetAddress: public COleDsBSTR
  238. {
  239. public:
  240. COleDsNetAddress( ){};
  241. };
  242. class COleDsOleDsPath: public COleDsBSTR
  243. {
  244. public:
  245. COleDsOleDsPath( ){};
  246. };
  247. class COleDsEmailAddress: public COleDsBSTR
  248. {
  249. public:
  250. COleDsEmailAddress( ){};
  251. };
  252. class COleDsInteger: public COleDsLONG
  253. {
  254. public:
  255. COleDsInteger( ){};
  256. };
  257. class COleDsInterval: public COleDsLONG
  258. {
  259. public:
  260. COleDsInterval( ){};
  261. };
  262. class COleDsList: public COleDsVARIANT
  263. {
  264. public:
  265. COleDsList( ){};
  266. };
  267. class COleDsString: public COleDsBSTR
  268. {
  269. public:
  270. COleDsString( ){ };
  271. };
  272. COleDsSyntax* GetSyntaxHandler( ADSTYPE eType, CString& rText );
  273. COleDsSyntax* GetSyntaxHandler( WCHAR* pszSyntax );
  274. #endif