espcontext.hpp 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #ifndef _ESPCONTEXT_HPP__
  14. #define _ESPCONTEXT_HPP__
  15. /*#ifndef ESP_BUILTIN
  16. #ifdef _WIN32
  17. #define ESP_CONTEXT_API DECL_EXPORT
  18. #endif
  19. #endif
  20. #ifndef ESP_CONTEXT_API
  21. #define ESP_CONTEXT_API
  22. #endif*/
  23. #include "esp.hpp"
  24. #include "esphttp.hpp"
  25. interface IEspSecureContext;
  26. ESPHTTP_API IEspContext* createEspContext(IEspSecureContext* secureContext = NULL);
  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 LogLevel getTxSummaryLevel();
  41. ESPHTTP_API bool getTxSummaryResourceReq();
  42. ESPHTTP_API unsigned getSlowProcessingTime();
  43. ESPHTTP_API void ESPLOG(IEspContext* ctx, LogLevel level, const char* fmt, ...) __attribute__((format(printf, 3, 4)));
  44. ESPHTTP_API void ESPLOG(LogLevel level, const char* fmt, ...) __attribute__((format(printf, 2, 3)));
  45. ESPHTTP_API void setEspContainer(IEspContainer* container);
  46. ESPHTTP_API IEspContainer* getESPContainer();
  47. ESPHTTP_API void setCFD(const char* cfd);
  48. ESPHTTP_API const char* getCFD();
  49. ESPHTTP_API void setBuildVersion(const char* buildVersion);
  50. ESPHTTP_API const char* getBuildVersion();
  51. ESPHTTP_API void setBuildLevel(const char* buildLevel);
  52. ESPHTTP_API const char* getBuildLevel();
  53. #endif