Skip to content

Commit eb8c662

Browse files
committed
code cleanups
1 parent ac8c9ad commit eb8c662

19 files changed

Lines changed: 151 additions & 175 deletions

‎JSON/include/Poco/JSON/Array.h‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,28 @@
3535
// DEALINGS IN THE SOFTWARE.
3636
//
3737

38+
3839
#ifndef JSON_Array_INCLUDED
3940
#define JSON_Array_INCLUDED
4041

4142

42-
#include <vector>
43-
#include <sstream>
44-
4543
#include "Poco/JSON/JSON.h"
4644
#include "Poco/SharedPtr.h"
4745
#include "Poco/Dynamic/Var.h"
46+
#include <vector>
47+
#include <sstream>
48+
4849

4950
namespace Poco {
5051
namespace JSON {
5152

53+
5254
class Object;
5355

5456

5557
class JSON_API Array
5658
{
5759
public:
58-
5960
typedef std::vector<Dynamic::Var> ValueVector;
6061
typedef SharedPtr<Array> Ptr;
6162

@@ -199,6 +200,7 @@ inline void Array::remove(unsigned int index)
199200
namespace Poco {
200201
namespace Dynamic {
201202

203+
202204
template <>
203205
class VarHolderImpl<JSON::Array::Ptr>: public VarHolder
204206
{
@@ -337,6 +339,7 @@ class VarHolderImpl<JSON::Array::Ptr>: public VarHolder
337339
JSON::Array::Ptr _val;
338340
};
339341

342+
340343
}} // namespace Poco::JSON
341344

342345

‎JSON/include/Poco/JSON/DefaultHandler.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
// DEALINGS IN THE SOFTWARE.
3636
//
3737

38+
3839
#ifndef JSON_DefaultHandler_INCLUDED
3940
#define JSON_DefaultHandler_INCLUDED
4041

@@ -154,4 +155,5 @@ inline void DefaultHandler::null()
154155

155156
}} // namespace Poco::JSON
156157

158+
157159
#endif // JSON_DefaultHandler_INCLUDED

‎JSON/include/Poco/JSON/Handler.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@
3535
// DEALINGS IN THE SOFTWARE.
3636
//
3737

38+
3839
#ifndef JSON_Handler_INCLUDED
3940
#define JSON_Handler_INCLUDED
4041

4142

42-
#include "Poco/Dynamic/Var.h"
4343
#include "Poco/JSON/JSON.h"
44+
#include "Poco/Dynamic/Var.h"
45+
4446

4547
namespace Poco {
4648
namespace JSON {
@@ -95,4 +97,5 @@ class JSON_API Handler
9597

9698
}} // namespace Poco::JSON
9799

100+
98101
#endif // JSON_Handler_INCLUDED

‎JSON/include/Poco/JSON/JSONException.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
// DEALINGS IN THE SOFTWARE.
3636
//
3737

38+
3839
#ifndef JSON_JSONException_INCLUDED
3940
#define JSON_JSONException_INCLUDED
4041

@@ -46,8 +47,10 @@
4647
namespace Poco {
4748
namespace JSON {
4849

50+
4951
POCO_DECLARE_EXCEPTION(JSON_API, JSONException, Poco::Exception)
5052

53+
5154
}} // namespace Poco::JSON
5255

5356

‎JSON/include/Poco/JSON/Object.h‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,30 +35,29 @@
3535
// DEALINGS IN THE SOFTWARE.
3636
//
3737

38+
3839
#ifndef JSON_Object_INCLUDED
3940
#define JSON_Object_INCLUDED
4041

4142

43+
#include "Poco/JSON/JSON.h"
44+
#include "Poco/JSON/Array.h"
45+
#include "Poco/SharedPtr.h"
46+
#include "Poco/Dynamic/Var.h"
4247
#include <map>
4348
#include <vector>
4449
#include <iostream>
4550
#include <sstream>
4651

47-
#include "Poco/SharedPtr.h"
48-
#include "Poco/Dynamic/Var.h"
49-
50-
#include "Poco/JSON/JSON.h"
51-
#include "Poco/JSON/Array.h"
5252

5353
namespace Poco {
5454
namespace JSON {
5555

5656

5757
class JSON_API Object
58-
/// Represents a JSON object
58+
/// Represents a JSON object.
5959
{
6060
public:
61-
6261
typedef SharedPtr<Object> Ptr;
6362

6463
Object();
@@ -344,6 +343,7 @@ class VarHolderImpl<JSON::Object::Ptr>: public VarHolder
344343
JSON::Object::Ptr _val;
345344
};
346345

346+
347347
}} // namespace Poco::JSON
348348

349349

‎JSON/include/Poco/JSON/Parser.h‎

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,68 +35,66 @@
3535
// DEALINGS IN THE SOFTWARE.
3636
//
3737

38+
3839
#ifndef JSON_JSONParser_INCLUDED
3940
#define JSON_JSONParser_INCLUDED
4041

4142

42-
#include <istream>
43-
#include <sstream>
44-
45-
#include "Poco/Dynamic/Var.h"
46-
#include "Poco/StreamTokenizer.h"
47-
4843
#include "Poco/JSON/JSON.h"
4944
#include "Poco/JSON/Object.h"
5045
#include "Poco/JSON/Array.h"
5146
#include "Poco/JSON/Handler.h"
47+
#include "Poco/Dynamic/Var.h"
48+
#include "Poco/StreamTokenizer.h"
49+
#include <istream>
50+
#include <sstream>
51+
5252

5353
namespace Poco {
5454
namespace JSON {
5555

5656

5757
class JSON_API Parser
58-
/// A class for passing JSON strings or streams
58+
/// A class for passing JSON strings or streams.
5959
{
6060
public:
6161

6262
Parser();
63-
/// Constructor
63+
/// Constructor.
6464

6565
virtual ~Parser();
66-
/// Destructor
66+
/// Destructor.
6767

6868
void parse(const std::string& source);
69-
/// Parses a string
69+
/// Parses a string.
7070

7171
void parse(std::istream& in);
72-
/// Parses a JSON from the input stream
72+
/// Parses a JSON from the input stream.
7373

7474
void setHandler(Handler* handler);
75-
/// Set the handler
75+
/// Set the handler.
7676

7777
Handler* getHandler();
78-
/// Returns the handler
78+
/// Returns the handler.
7979

8080
private:
81-
8281
const Token* nextToken();
83-
/// Returns the next token
82+
/// Returns the next token.
8483

8584
void readObject();
86-
/// Starts reading an object
87-
85+
/// Starts reading an object.
8886

8987
void readArray();
90-
/// Starts reading an array
88+
/// Starts reading an array.
9189

9290
bool readRow(bool firstCall = false);
9391
/// Reads a property value pair. Returns true when a next row is expected.
9492

9593
void readValue(const Token* token);
96-
/// Read a value from the token
94+
/// Read a value from the token.
9795

9896
bool readElements(bool firstCall = false);
99-
/// Read all elements of an array
97+
/// Read all elements of an array.
10098

10199
StreamTokenizer _tokenizer;
102100
Handler* _handler;

‎JSON/include/Poco/JSON/Stringifier.h‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@
3535
// DEALINGS IN THE SOFTWARE.
3636
//
3737

38+
3839
#ifndef JSON_JSONStringifier_INCLUDED
3940
#define JSON_JSONStringifier_INCLUDED
4041

4142

42-
#include <iostream>
43-
4443
#include "Poco/Dynamic/Var.h"
4544
#include "Poco/JSON/JSON.h"
45+
#include <ostream>
46+
4647

4748
namespace Poco {
4849
namespace JSON {
@@ -52,7 +53,6 @@ class JSON_API Stringifier
5253
/// Helper class for creating a String from a JSON object or array
5354
{
5455
public:
55-
5656
static void stringify(const Dynamic::Var& any, std::ostream& out, unsigned int indent = 0);
5757
/// Writes a String representation of the value to the output stream.
5858
/// When indent is 0, the String will be created as small as possible.
@@ -61,4 +61,5 @@ class JSON_API Stringifier
6161

6262
}} // namespace Poco::JSON
6363

64+
6465
#endif // JSON_JSONStringifier_INCLUDED

0 commit comments

Comments
 (0)