1 /* 2 * Copyright 2017, Andrew Lindesay <apl@lindesay.co.nz> 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _JSON_EVENT_LISTENER_H 6 #define _JSON_EVENT_LISTENER_H 7 8 9 #include "JsonEvent.h" 10 11 #include <String.h> 12 13 14 /*! This constant line number can be used in raising an error where the 15 client raising the error does not know on which line the error arose. 16 */ 17 18 #define JSON_EVENT_LISTENER_ANY_LINE -1 19 20 namespace BPrivate { 21 22 class BJsonEventListener { 23 public: 24 BJsonEventListener(); 25 virtual ~BJsonEventListener(); 26 27 virtual bool Handle(const BJsonEvent& event) = 0; 28 virtual void HandleError(status_t status, int32 line, 29 const char* message) = 0; 30 virtual void Complete() = 0; 31 }; 32 33 } // namespace BPrivate 34 35 using BPrivate::BJsonEventListener; 36 37 #endif // _JSON_EVENT_LISTENER_H 38