pitextstream starts
This commit is contained in:
27
main.cpp
27
main.cpp
@@ -1,5 +1,7 @@
|
||||
#include "pip.h"
|
||||
#include "pibinarystream.h"
|
||||
#include "pitextstream.h"
|
||||
#include "piiostream.h"
|
||||
//#include "stream.h"
|
||||
//#include "ccm.h"
|
||||
//#include "pisystemmonitor_.h"
|
||||
@@ -33,8 +35,23 @@ PICout operator << (PICout c, const TS & v) {c << '{' << v.i << ", " << v.f << '
|
||||
template<typename P> inline PIBinaryStream<P> & operator <<(PIBinaryStream<P> & s, const TS & v) {s << v.i; return s;}
|
||||
template<typename P> inline PIBinaryStream<P> & operator >>(PIBinaryStream<P> & s, TS & v) {s >> v.i; return s;}
|
||||
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
PIByteArray ba;
|
||||
PIFile f;
|
||||
f.open("_", PIIODevice::ReadWrite);
|
||||
f.clear();
|
||||
PIIOBinaryStream ios(&f);
|
||||
auto ts = createPITextStream(&ios);
|
||||
|
||||
ts << "hello" << uchar('1');
|
||||
ts.space();
|
||||
(ts << PIString::fromUTF8("№") << 123).space() << -0.1f;
|
||||
ts.newLine();
|
||||
|
||||
piCout << PIString(ba);
|
||||
//PIIOByteArray ioba(&ba);
|
||||
//PIIOBinaryStream stream(&ioba);
|
||||
/*ProcessStatsFixed_ ps;
|
||||
ba << ps;
|
||||
piCout << "s" << ba.data;*/
|
||||
@@ -53,7 +70,8 @@ int main(int argc, char * argv[]) {
|
||||
ba >> vi;
|
||||
piCout << "res" << vi;
|
||||
piCout << "r" << ba.data;*/
|
||||
PIMap<PIIODevice::DeviceMode, PIStringList> map;
|
||||
|
||||
/*PIMap<PIIODevice::DeviceMode, PIStringList> map;
|
||||
map[PIIODevice::ReadOnly] = {"str0", PIString::fromUTF8("русский!")};
|
||||
piMSleep(100);
|
||||
map[PIIODevice::ReadWrite] = {""};
|
||||
@@ -61,13 +79,14 @@ int main(int argc, char * argv[]) {
|
||||
map[PIIODevice::WriteOnly] = {PIString::fromUTF8("русский!"), "", "1234567890", "qwertyuiop[]"};
|
||||
piCout << map;
|
||||
|
||||
ba << map;
|
||||
stream << map;
|
||||
piCout << ba;
|
||||
map.clear();
|
||||
|
||||
ba >> map;
|
||||
ioba.seekToBegin();
|
||||
stream >> map;
|
||||
piCout << map;
|
||||
piCout << ba;
|
||||
piCout << ba;*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user