git-svn-id: svn://db.shs.com.ru/pip@639 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
21
main.cpp
21
main.cpp
@@ -45,13 +45,32 @@ int main() {
|
|||||||
CONNECTU(PICout::Notifier::object(), finished, &a, pcf);
|
CONNECTU(PICout::Notifier::object(), finished, &a, pcf);
|
||||||
PIString buffer = "my buff:";
|
PIString buffer = "my buff:";
|
||||||
PICout(&buffer, 1) << "int 10 ->" << 10 << ", time ->" << PITime::current();*/
|
PICout(&buffer, 1) << "int 10 ->" << 10 << ", time ->" << PITime::current();*/
|
||||||
PISerial ser(PISerial::availableDevices(false)[0], PISerial::S115200);
|
/*PISerial ser(PISerial::availableDevices(false)[0], PISerial::S115200);
|
||||||
piCout << ser.constructFullPath();
|
piCout << ser.constructFullPath();
|
||||||
piCout << ser.open();
|
piCout << ser.open();
|
||||||
ser.startThreadedRead();
|
ser.startThreadedRead();
|
||||||
FOREVER {
|
FOREVER {
|
||||||
piCout << ser.isOpened();
|
piCout << ser.isOpened();
|
||||||
piMSleep(200);
|
piMSleep(200);
|
||||||
|
}*/
|
||||||
|
PIVector<PIFile::FileInfo> fl = PIDir::current().allEntries();
|
||||||
|
PIFile out("out.txt", PIIODevice::ReadWrite);
|
||||||
|
out.clear();
|
||||||
|
piForeachC (PIFile::FileInfo & f, fl) {
|
||||||
|
PIString e = f.extension();
|
||||||
|
PIString comm;
|
||||||
|
if (e == "h") comm = PIString::fromUTF8("Заголовочный файл");
|
||||||
|
if (e == "cpp") comm = PIString::fromUTF8("Файл релизации");
|
||||||
|
if (e == "ui") comm = PIString::fromUTF8("Форма");
|
||||||
|
if (e == "qrc") comm = PIString::fromUTF8("Файл ресурсов");
|
||||||
|
if (comm.isEmpty()) continue;
|
||||||
|
out << "\n\n" << comm << ": " << f.name() << "\n";
|
||||||
|
PIFile file(f.name(), PIIODevice::ReadOnly);
|
||||||
|
while (!file.isEnd()) {
|
||||||
|
PIString line = file.readLine(), tl = line.trimmed();
|
||||||
|
if (tl.isEmpty() || tl.startsWith("//")) continue;
|
||||||
|
out << line << "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
/*}
|
/*}
|
||||||
|
|||||||
@@ -118,7 +118,10 @@ public:
|
|||||||
// //! Returns pointer to \a missedPackets() count. Useful for output to PIConsole
|
// //! Returns pointer to \a missedPackets() count. Useful for output to PIConsole
|
||||||
const ullong * missedPackets_ptr() const {return &missed_packets;}
|
const ullong * missedPackets_ptr() const {return &missed_packets;}
|
||||||
|
|
||||||
|
//! Add data to extractor, raise \a packetReceived() if packet is ready
|
||||||
void appendData(const void * d, int s) {threadedRead(const_cast<uchar*>((const uchar *)d), s);}
|
void appendData(const void * d, int s) {threadedRead(const_cast<uchar*>((const uchar *)d), s);}
|
||||||
|
|
||||||
|
//! Add data to extractor, raise \a packetReceived() if packet is ready
|
||||||
void appendData(const PIByteArray & data) {appendData(data.data(), data.size_s());}
|
void appendData(const PIByteArray & data) {appendData(data.data(), data.size_s());}
|
||||||
|
|
||||||
EVENT2(packetReceived, uchar * , data, int, size)
|
EVENT2(packetReceived, uchar * , data, int, size)
|
||||||
|
|||||||
Reference in New Issue
Block a user