espcontext.hpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*##############################################################################
  2. Copyright (C) 2011 HPCC Systems.
  3. All rights reserved. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ############################################################################## */
  14. #ifndef _ESPCONTEXT_HPP__
  15. #define _ESPCONTEXT_HPP__
  16. /*#ifndef ESP_BUILTIN
  17. #ifdef _WIN32
  18. #define ESP_CONTEXT_API __declspec(dllexport)
  19. #endif
  20. #endif
  21. #ifndef ESP_CONTEXT_API
  22. #define ESP_CONTEXT_API
  23. #endif*/
  24. #include "esp.hpp"
  25. #include "esphttp.hpp"
  26. ESPHTTP_API IEspContext* createEspContext();
  27. // Get URL parameters (include these from Content)
  28. // Return: a=b&c=d format.
  29. ESPHTTP_API bool getUrlParams(IProperties *props, StringBuffer& params);
  30. // Only the original URL (not these from Content: URL form encoded)
  31. // Also remove these params that start with dot (.).
  32. // Return: a=b&c=d format.
  33. ESPHTTP_API void getEspUrlParams(IEspContext& ctx, StringBuffer& params, const char* excludeParams[]);
  34. ESPHTTP_API void addEspNativeArray(StringBuffer& schema, const char* xsdType, const char* arrayType);
  35. ESPHTTP_API void checkRequest(IEspContext& ctx);
  36. ESPHTTP_API LogLevel getEspLogLevel(IEspContext* );
  37. ESPHTTP_API LogLevel getEspLogLevel();
  38. ESPHTTP_API bool getEspLogRequests();
  39. ESPHTTP_API bool getEspLogResponses();
  40. ESPHTTP_API void ESPLOG(IEspContext* ctx, LogLevel level, const char* fmt, ...);
  41. ESPHTTP_API void ESPLOG(LogLevel level, const char* fmt, ...);
  42. ESPHTTP_API void setEspContainer(IEspContainer* container);
  43. ESPHTTP_API IEspContainer* getESPContainer();
  44. ESPHTTP_API void setCFD(const char* cfd);
  45. ESPHTTP_API const char* getCFD();
  46. ESPHTTP_API void setBuildVersion(const char* buildVersion);
  47. ESPHTTP_API const char* getBuildVersion();
  48. ESPHTTP_API void setBuildLevel(const char* buildLevel);
  49. ESPHTTP_API const char* getBuildLevel();
  50. #endif