PageRenderTime 50ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/xhp/xhp_preprocess.hpp

http://github.com/facebook/xhp
C++ Header | 45 lines | 24 code | 6 blank | 15 comment | 0 complexity | 0957f54a20c941526cd1db16e805d3b0 MD5 | raw file
Possible License(s): MIT, MPL-2.0-no-copyleft-exception
  1. /*
  2. +----------------------------------------------------------------------+
  3. | XHP |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 2009 - 2010 Facebook, Inc. (http://www.facebook.com) |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE.PHP, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. */
  16. #pragma once
  17. #include <iostream>
  18. #include <string>
  19. #include <stdint.h>
  20. enum XHPResult {
  21. XHPDidNothing,
  22. XHPRewrote,
  23. XHPErred
  24. };
  25. struct xhp_flags_t {
  26. bool asp_tags;
  27. bool short_tags;
  28. bool idx_expr;
  29. bool include_debug;
  30. bool eval;
  31. bool emit_namespaces;
  32. };
  33. XHPResult xhp_preprocess(std::istream &in, std::string &out, bool isEval,
  34. std::string &errDescription, uint32_t &errLineno);
  35. XHPResult xhp_preprocess(std::string &in, std::string &out, bool isEval,
  36. std::string &errDescription, uint32_t &errLineno);
  37. XHPResult xhp_preprocess(std::string &in, std::string &out,
  38. std::string &errDescription, uint32_t &errLineno,
  39. const xhp_flags_t &flags);