parse.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef VALUE_PARSE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
  2. #define VALUE_PARSE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
  3. #if defined(_MSC_VER) || \
  4. (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
  5. (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
  6. #pragma once
  7. #endif
  8. #include <iosfwd>
  9. #include <string>
  10. #include <vector>
  11. #include "yaml-cpp/dll.h"
  12. namespace YAML {
  13. class Node;
  14. /**
  15. * Loads the input string as a single YAML document.
  16. *
  17. * @throws {@link ParserException} if it is malformed.
  18. */
  19. YAML_CPP_API Node Load(const std::string& input);
  20. /**
  21. * Loads the input string as a single YAML document.
  22. *
  23. * @throws {@link ParserException} if it is malformed.
  24. */
  25. YAML_CPP_API Node Load(const char* input);
  26. /**
  27. * Loads the input stream as a single YAML document.
  28. *
  29. * @throws {@link ParserException} if it is malformed.
  30. */
  31. YAML_CPP_API Node Load(std::istream& input);
  32. /**
  33. * Loads the input file as a single YAML document.
  34. *
  35. * @throws {@link ParserException} if it is malformed.
  36. * @throws {@link BadFile} if the file cannot be loaded.
  37. */
  38. YAML_CPP_API Node LoadFile(const std::string& filename);
  39. /**
  40. * Loads the input string as a list of YAML documents.
  41. *
  42. * @throws {@link ParserException} if it is malformed.
  43. */
  44. YAML_CPP_API std::vector<Node> LoadAll(const std::string& input);
  45. /**
  46. * Loads the input string as a list of YAML documents.
  47. *
  48. * @throws {@link ParserException} if it is malformed.
  49. */
  50. YAML_CPP_API std::vector<Node> LoadAll(const char* input);
  51. /**
  52. * Loads the input stream as a list of YAML documents.
  53. *
  54. * @throws {@link ParserException} if it is malformed.
  55. */
  56. YAML_CPP_API std::vector<Node> LoadAll(std::istream& input);
  57. /**
  58. * Loads the input file as a list of YAML documents.
  59. *
  60. * @throws {@link ParserException} if it is malformed.
  61. * @throws {@link BadFile} if the file cannot be loaded.
  62. */
  63. YAML_CPP_API std::vector<Node> LoadAllFromFile(const std::string& filename);
  64. } // namespace YAML
  65. #endif // VALUE_PARSE_H_62B23520_7C8E_11DE_8A39_0800200C9A66