cesium-native  0.41.0
JsonHandler.h
1 #pragma once
2 
3 #include "IJsonHandler.h"
4 #include "IgnoreValueJsonHandler.h"
5 #include "Library.h"
6 
7 #include <cstdint>
8 #include <string>
9 
10 namespace CesiumJsonReader {
11 class CESIUMJSONREADER_API JsonHandler : public IJsonHandler {
12 public:
13  JsonHandler() noexcept;
14  virtual IJsonHandler* readNull() override;
15  virtual IJsonHandler* readBool(bool b) override;
16  virtual IJsonHandler* readInt32(int32_t i) override;
17  virtual IJsonHandler* readUint32(uint32_t i) override;
18  virtual IJsonHandler* readInt64(int64_t i) override;
19  virtual IJsonHandler* readUint64(uint64_t i) override;
20  virtual IJsonHandler* readDouble(double d) override;
21  virtual IJsonHandler* readString(const std::string_view& str) override;
22  virtual IJsonHandler* readObjectStart() override;
23  virtual IJsonHandler* readObjectKey(const std::string_view& str) override;
24  virtual IJsonHandler* readObjectEnd() override;
25  virtual IJsonHandler* readArrayStart() override;
26  virtual IJsonHandler* readArrayEnd() override;
27 
28  virtual void reportWarning(
29  const std::string& warning,
30  std::vector<std::string>&& context = std::vector<std::string>()) override;
31 
32 protected:
33  void reset(IJsonHandler* pParent);
34 
35  IJsonHandler* parent();
36 
41 
47 
48 private:
49  IJsonHandler* _pParent = nullptr;
50  IgnoreValueJsonHandler _ignore;
51 };
52 
53 } // namespace CesiumJsonReader
IJsonHandler * ignoreAndContinue()
Ignore a single value and the continue processing more tokens with this handler.
IJsonHandler * ignoreAndReturnToParent()
Ignore a single value and then return to the parent handler.
Classes for reading JSON.