* Parses the stream this parser was created on until EOF. * @throw parse_exception if there are errors in parsing */
| 1891 | * @throw parse_exception if there are errors in parsing |
| 1892 | */ |
| 1893 | std::shared_ptr<table> parse() |
| 1894 | { |
| 1895 | std::shared_ptr<table> root = make_table(); |
| 1896 | |
| 1897 | table* curr_table = root.get(); |
| 1898 | |
| 1899 | while (detail::getline(input_, line_)) |
| 1900 | { |
| 1901 | line_number_++; |
| 1902 | auto it = line_.begin(); |
| 1903 | auto end = line_.end(); |
| 1904 | consume_whitespace(it, end); |
| 1905 | if (it == end || *it == '#') |
| 1906 | continue; |
| 1907 | if (*it == '[') |
| 1908 | { |
| 1909 | curr_table = root.get(); |
| 1910 | parse_table(it, end, curr_table); |
| 1911 | } |
| 1912 | else |
| 1913 | { |
| 1914 | parse_key_value(it, end, curr_table); |
| 1915 | consume_whitespace(it, end); |
| 1916 | eol_or_comment(it, end); |
| 1917 | } |
| 1918 | } |
| 1919 | return root; |
| 1920 | } |
| 1921 | |
| 1922 | private: |
| 1923 | #if defined _MSC_VER |
nothing calls this directly
no test coverage detected