This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/swig/android/streamer.h
Vitor Santos Costa 2a93f1da99 swig streamer
2017-11-30 01:16:52 +00:00

28 lines
578 B
C++

//
// Created by vsc on 7/6/17.
//
#ifndef YAPDROID_MAIN_H
#define YAPDROID_MAIN_H
#include <cstdio>
#include <iostream>
#include <string>
#include <sstream>
struct AndroidStreamer {
virtual void display(std::string text) const = 0;
virtual ~AndroidStreamer() {}
void bind();
};
void setStreamer(AndroidStreamer* streamer);
AndroidStreamer& getStreamer();
template<typename T> AndroidStreamer& operator<<(AndroidStreamer& stream, T const& val) {
std::ostringstream s;
s << val;
stream.display(s.str());
return stream;
};
#endif //YAPDROID_MAIN_H