Added song streamingh endpoint and removed redundant making oatpp::String shared when it already is a shared object #61

This commit is contained in:
kdeng00
2019-09-08 18:48:14 -04:00
parent 949abf8244
commit 19ddb9be0b
6 changed files with 83 additions and 102 deletions
+27
View File
@@ -0,0 +1,27 @@
#ifndef STREAMCALLBACK_H_
#define STREAMCALLBACK_H_
#include <string>
#include "oatpp/core/data/stream/FileStream.hpp"
#include "oatpp/web/protocol/http/outgoing/ChunkedBody.hpp"
namespace callback
{
class StreamCallback : public oatpp::data::stream::ReadCallback
{
public:
StreamCallback();
StreamCallback(const std::string&);
oatpp::data::v_io_size read(void*, oatpp::data::v_io_size);
private:
std::string m_songPath;
long m_bytesRead;
long m_counter;
long m_fileSize;
};
}
#endif