1 /* 2 * Copyright 2017, Andrew Lindesay <apl@lindesay.co.nz>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef STANDARD_META_DATA_JSON_EVENT_LISTENER_H 6 #define STANDARD_META_DATA_JSON_EVENT_LISTENER_H 7 8 #include "StandardMetaData.h" 9 10 #include <JsonEventListener.h> 11 #include <String.h> 12 #include <StringList.h> 13 14 15 class SmdStackedEventListener; 16 17 18 class StandardMetaDataJsonEventListener : public BJsonEventListener { 19 friend class SmdStackedEventListener; 20 public: 21 StandardMetaDataJsonEventListener( 22 const BString& jsonPath, 23 StandardMetaData& metaData); 24 virtual ~StandardMetaDataJsonEventListener(); 25 26 bool Handle(const BJsonEvent& event); 27 void HandleError(status_t status, int32 line, 28 const char* message); 29 void Complete(); 30 status_t ErrorStatus(); 31 32 protected: 33 void SetStackedListener(SmdStackedEventListener *listener); 34 35 private: 36 void SetJsonPath(const BString& jsonPath); 37 StandardMetaData* MetaData(); 38 39 BStringList fJsonPathObjectNames; 40 StandardMetaData* fMetaData; 41 status_t fErrorStatus; 42 SmdStackedEventListener* 43 fStackedListener; 44 }; 45 46 47 #endif // STANDARD_META_DATA_JSON_EVENT_LISTENER_H