chromium/third_party/pdfium/xfa/fxfa/parser/cxfa_nodeiteratortemplate.h

// Copyright 2017 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#ifndef XFA_FXFA_PARSER_CXFA_NODEITERATORTEMPLATE_H_
#define XFA_FXFA_PARSER_CXFA_NODEITERATORTEMPLATE_H_

#include <type_traits>
#include "core/fxcrt/unowned_ptr.h"
#include "v8/include/cppgc/macros.h"
#include "v8/include/cppgc/type-traits.h"

template <class NodeType,
          class TraverseStrategy,
          typename HolderType = std::conditional_t<
              cppgc::IsGarbageCollectedOrMixinTypeV<NodeType>,
              NodeType*,
              UnownedPtr<NodeType>>>
class CXFA_NodeIteratorTemplate {
  CPPGC_STACK_ALLOCATED();  // Allows Raw/Unowned |HolderType|.

 public:
  explicit CXFA_NodeIteratorTemplate(NodeType* pRoot)
      :{}

  NodeType* GetRoot() const {}
  NodeType* GetCurrent() const {}

  void Reset() {}
  bool SetCurrent(NodeType* pNode) {}

  NodeType* MoveToPrev() {}

  NodeType* MoveToNext() {}

  NodeType* SkipChildrenAndMoveToNext() {}

 private:
  bool RootReachableFromNode(NodeType* pNode) {}

  NodeType* ParentWithinSubtree(NodeType* pNode) {}

  NodeType* NextSiblingWithinSubtree(NodeType* pNode) {}

  NodeType* PreviousSiblingWithinSubtree(NodeType* pNode) {}

  NodeType* LastChild(NodeType* pNode) {}

  NodeType* LastDescendant(NodeType* pNode) {}

  HolderType m_pRoot;
  HolderType m_pCurrent;
};

#endif  // XFA_FXFA_PARSER_CXFA_NODEITERATORTEMPLATE_H_