|
35 | 35 | // DEALINGS IN THE SOFTWARE. |
36 | 36 | // |
37 | 37 |
|
| 38 | + |
38 | 39 | #ifndef JSON_JSONParser_INCLUDED |
39 | 40 | #define JSON_JSONParser_INCLUDED |
40 | 41 |
|
41 | 42 |
|
42 | | -#include <istream> |
43 | | -#include <sstream> |
44 | | - |
45 | | -#include "Poco/Dynamic/Var.h" |
46 | | -#include "Poco/StreamTokenizer.h" |
47 | | - |
48 | 43 | #include "Poco/JSON/JSON.h" |
49 | 44 | #include "Poco/JSON/Object.h" |
50 | 45 | #include "Poco/JSON/Array.h" |
51 | 46 | #include "Poco/JSON/Handler.h" |
| 47 | +#include "Poco/Dynamic/Var.h" |
| 48 | +#include "Poco/StreamTokenizer.h" |
| 49 | +#include <istream> |
| 50 | +#include <sstream> |
| 51 | + |
52 | 52 |
|
53 | 53 | namespace Poco { |
54 | 54 | namespace JSON { |
55 | 55 |
|
56 | 56 |
|
57 | 57 | class JSON_API Parser |
58 | | - /// A class for passing JSON strings or streams |
| 58 | + /// A class for passing JSON strings or streams. |
59 | 59 | { |
60 | 60 | public: |
61 | 61 |
|
62 | 62 | Parser(); |
63 | | - /// Constructor |
| 63 | + /// Constructor. |
64 | 64 |
|
65 | 65 | virtual ~Parser(); |
66 | | - /// Destructor |
| 66 | + /// Destructor. |
67 | 67 |
|
68 | 68 | void parse(const std::string& source); |
69 | | - /// Parses a string |
| 69 | + /// Parses a string. |
70 | 70 |
|
71 | 71 | void parse(std::istream& in); |
72 | | - /// Parses a JSON from the input stream |
| 72 | + /// Parses a JSON from the input stream. |
73 | 73 |
|
74 | 74 | void setHandler(Handler* handler); |
75 | | - /// Set the handler |
| 75 | + /// Set the handler. |
76 | 76 |
|
77 | 77 | Handler* getHandler(); |
78 | | - /// Returns the handler |
| 78 | + /// Returns the handler. |
79 | 79 |
|
80 | 80 | private: |
81 | | - |
82 | 81 | const Token* nextToken(); |
83 | | - /// Returns the next token |
| 82 | + /// Returns the next token. |
84 | 83 |
|
85 | 84 | void readObject(); |
86 | | - /// Starts reading an object |
87 | | - |
| 85 | + /// Starts reading an object. |
88 | 86 |
|
89 | 87 | void readArray(); |
90 | | - /// Starts reading an array |
| 88 | + /// Starts reading an array. |
91 | 89 |
|
92 | 90 | bool readRow(bool firstCall = false); |
93 | 91 | /// Reads a property value pair. Returns true when a next row is expected. |
94 | 92 |
|
95 | 93 | void readValue(const Token* token); |
96 | | - /// Read a value from the token |
| 94 | + /// Read a value from the token. |
97 | 95 |
|
98 | 96 | bool readElements(bool firstCall = false); |
99 | | - /// Read all elements of an array |
| 97 | + /// Read all elements of an array. |
100 | 98 |
|
101 | 99 | StreamTokenizer _tokenizer; |
102 | 100 | Handler* _handler; |
|
0 commit comments