mirror of
https://github.com/libretro/Mu.git
synced 2026-07-19 23:26:21 +00:00
47 lines
847 B
C++
47 lines
847 B
C++
#include "userio.h"
|
|
|
|
UserIO::UserIO(QObject* parent) : QObject(parent){
|
|
|
|
}
|
|
|
|
bool UserIO::stringAvailableJs(){
|
|
return !cxxStrings.empty();
|
|
}
|
|
|
|
QString UserIO::readStringJs(){
|
|
if(!cxxStrings.empty()){
|
|
QString currentString = cxxStrings[0];
|
|
cxxStrings.erase(cxxStrings.begin() + 0);
|
|
return currentString;
|
|
}
|
|
|
|
return "";
|
|
}
|
|
|
|
void UserIO::writeStringJs(QString data){
|
|
jsStrings.push_back(data);
|
|
}
|
|
|
|
bool UserIO::stringAvailableCxx(){
|
|
return !jsStrings.empty();
|
|
}
|
|
|
|
QString UserIO::readStringCxx(){
|
|
if(!jsStrings.empty()){
|
|
QString currentString = jsStrings[0];
|
|
jsStrings.erase(jsStrings.begin() + 0);
|
|
return currentString;
|
|
}
|
|
|
|
return "";
|
|
}
|
|
|
|
void UserIO::writeStringCxx(QString data){
|
|
cxxStrings.push_back(data);
|
|
}
|
|
|
|
void UserIO::resetStrings(){
|
|
jsStrings.clear();
|
|
cxxStrings.clear();
|
|
}
|