Kodi Development 22.0
for Binary and Script based Add-Ons
 
Loading...
Searching...
No Matches
WsgiInputStream.h
1/*
2 * Copyright (C) 2015-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#pragma once
10
11#include "interfaces/legacy/AddonClass.h"
12
13#include <vector>
14
15struct HTTPPythonRequest;
16
17namespace XBMCAddon
18{
19 namespace xbmcwsgi
20 {
21
22 // Iterator for the wsgi.input stream.
23 class WsgiInputStreamIterator : public AddonClass
24 {
25 public:
27 ~WsgiInputStreamIterator() override;
28
29#ifdef DOXYGEN_SHOULD_USE_THIS
38 read(...);
39#else
40 String read(unsigned long size = 0) const;
41#endif
42
43#ifdef DOXYGEN_SHOULD_USE_THIS
53 read(...);
54#else
55 String readline(unsigned long size = 0) const;
56#endif
57
58#ifdef DOXYGEN_SHOULD_USE_THIS
68 read(...);
69#else
70 std::vector<String> readlines(unsigned long sizehint = 0) const;
71#endif
72
73#if !defined SWIG && !defined DOXYGEN_SHOULD_SKIP_THIS
74 WsgiInputStreamIterator(const String& data, bool end = false);
75
76 WsgiInputStreamIterator& operator++();
77 bool operator==(const WsgiInputStreamIterator& rhs);
78 bool operator!=(const WsgiInputStreamIterator& rhs);
79 String& operator*();
80 inline bool end() const { return m_remaining <= 0; }
81
82 protected:
83 String m_data;
84 mutable unsigned long m_offset = 0;
85 mutable unsigned long m_remaining = 0;
86
87 private:
88 String m_line;
89#endif
90 };
91
102 {
103 public:
105 ~WsgiInputStream() override;
106
107#if !defined SWIG && !defined DOXYGEN_SHOULD_SKIP_THIS
110
114 void SetRequest(HTTPPythonRequest* request);
115
116 HTTPPythonRequest* m_request;
117#endif
118 };
119 }
120}
Definition WsgiInputStream.h:102
Definition WsgiInputStream.h:24