// This file was generated by generate-gltf-classes.
// DO NOT EDIT THIS FILE!
#pragma once

#include "CameraOrthographicJsonHandler.h"
#include "CameraPerspectiveJsonHandler.h"
#include "CesiumGltf/Camera.h"
#include "CesiumGltf/ReaderContext.h"
#include "NamedObjectJsonHandler.h"

namespace CesiumGltf {
struct ReaderContext;
struct Camera;

class CameraJsonHandler : public NamedObjectJsonHandler {
public:
  using ValueType = Camera;

  CameraJsonHandler(const ReaderContext& context) noexcept;
  void reset(IJsonHandler* pParentHandler, Camera* pObject);

  virtual IJsonHandler* readObjectKey(const std::string_view& str) override;

protected:
  IJsonHandler* readObjectKeyCamera(
      const std::string& objectType,
      const std::string_view& str,
      Camera& o);

private:
  class TypeJsonHandler : public CesiumJsonReader::JsonHandler {
  public:
    TypeJsonHandler() noexcept : CesiumJsonReader::JsonHandler() {}
    void reset(CesiumJsonReader::IJsonHandler* pParent, Camera::Type* pEnum);
    virtual CesiumJsonReader::IJsonHandler*
    readString(const std::string_view& str) override;

  private:
    Camera::Type* _pEnum = nullptr;
  };

  Camera* _pObject = nullptr;
  CameraOrthographicJsonHandler _orthographic;
  CameraPerspectiveJsonHandler _perspective;
  TypeJsonHandler _type;
};
} // namespace CesiumGltf
