Team Fortress 2 Source Code as on 22/4/2020
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.

67 lines
1.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef IGCSQLQUERY_H
  8. #define IGCSQLQUERY_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. // the type of the parameter
  13. enum EGCSQLType
  14. {
  15. k_EGCSQLTypeInvalid = -1,
  16. // Variable length types
  17. k_EGCSQLType_Blob,
  18. k_EGCSQLType_String,
  19. // fixed length types
  20. k_EGCSQLType_int8, // also uint8
  21. k_EGCSQLType_int16, // also uint16
  22. k_EGCSQLType_int32, // also uint32
  23. k_EGCSQLType_int64, // also uint64
  24. k_EGCSQLType_float,
  25. k_EGCSQLType_double,
  26. k_EGCSQLType_Binary, // raw binary data of fixed size (i.e. a C struct).
  27. k_EGCSQLType_Image,
  28. k_EGCSQLType_bool,
  29. };
  30. class IGCSQLResultSetList;
  31. class IGCSQLQuery
  32. {
  33. protected:
  34. // call Destroy() instead of deleting this object directly
  35. virtual ~IGCSQLQuery() {}
  36. public:
  37. // returns the number of statements in the transaction
  38. // represented by this query object
  39. virtual uint32 GetStatementCount() = 0;
  40. // returns a string that represents where in the GC this
  41. // query came from. Usually this is FILE_AND_LINE.
  42. virtual const char *PchName() = 0;
  43. // get the null-terminated query string itself
  44. virtual const char *PchCommand( uint32 unStatement ) = 0;
  45. // gets the parameter data
  46. virtual uint32 CnParams( uint32 unStatement ) = 0;
  47. virtual EGCSQLType EParamType( uint32 unStatement, uint32 uIndex ) = 0;
  48. virtual byte *PubParam( uint32 unStatement, uint32 uIndex ) = 0;
  49. virtual uint32 CubParam( uint32 unStatement, uint32 uIndex ) = 0;
  50. // reports the result
  51. virtual void SetResults( IGCSQLResultSetList *pResults ) = 0;
  52. };
  53. #endif // IGCSQLQUERY_H