streamReader_ext.h 904 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * PANDA 3D SOFTWARE
  3. * Copyright (c) Carnegie Mellon University. All rights reserved.
  4. *
  5. * All use of this software is subject to the terms of the revised BSD
  6. * license. You should have received a copy of this license along
  7. * with this source code in a file named "LICENSE."
  8. *
  9. * @file streamReader_ext.h
  10. * @author rdb
  11. * @date 2013-12-09
  12. */
  13. #ifndef STREAMREADER_EXT_H
  14. #define STREAMREADER_EXT_H
  15. #include "dtoolbase.h"
  16. #ifdef HAVE_PYTHON
  17. #include "extension.h"
  18. #include "streamReader.h"
  19. #include "py_panda.h"
  20. /**
  21. * This class defines the extension methods for StreamReader, which are called
  22. * instead of any C++ methods with the same prototype.
  23. */
  24. template<>
  25. class Extension<StreamReader> : public ExtensionBase<StreamReader> {
  26. public:
  27. PyObject *extract_bytes(size_t size);
  28. PyObject *readline();
  29. PyObject *readlines();
  30. };
  31. #endif // HAVE_PYTHON
  32. #endif // STREAMREADER_EXT_H