txNodeSetAdaptor.h 950 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef txNodeSetAdaptor_h__
  6. #define txNodeSetAdaptor_h__
  7. #include "txINodeSet.h"
  8. #include "txNodeSet.h"
  9. #include "txXPathObjectAdaptor.h"
  10. /**
  11. * Implements an XPCOM wrapper around an XPath NodeSet.
  12. */
  13. class txNodeSetAdaptor : public txXPathObjectAdaptor,
  14. public txINodeSet
  15. {
  16. public:
  17. txNodeSetAdaptor();
  18. explicit txNodeSetAdaptor(txNodeSet* aNodeSet);
  19. nsresult Init();
  20. NS_DECL_ISUPPORTS_INHERITED
  21. NS_DECL_TXINODESET
  22. protected:
  23. ~txNodeSetAdaptor() {}
  24. private:
  25. txNodeSet* NodeSet()
  26. {
  27. return static_cast<txNodeSet*>(mValue.get());
  28. }
  29. bool mWritable;
  30. };
  31. #endif // txNodeSetAdaptor_h__