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