forked from teamnwah/openmw-tes3coop
69e8f9c9db
- renamed imp_client/ to clients/ and ditto for servers/ - renamed imp/ to servers/ - renamed stream/input.h to stream/stream.h - renamed Stream::InputStream to Stream::Stream - updated various tests and makefiles - NOT TESTED YET
40 lines
757 B
C++
40 lines
757 B
C++
#include "dummy_vfs.cpp"
|
|
|
|
#include <iostream>
|
|
#include <string.h>
|
|
|
|
using namespace std;
|
|
|
|
void print(FileInfo inf)
|
|
{
|
|
cout << "name: " << inf.name << endl;
|
|
cout << "basename: " << inf.basename << endl;
|
|
cout << "isDir: " << inf.isDir << endl;
|
|
cout << "size: " << inf.size << endl;
|
|
cout << "time: " << inf.time << endl;
|
|
}
|
|
|
|
void print(FileInfoList lst)
|
|
{
|
|
for(int i=0; i<lst.size(); i++)
|
|
print(lst[i]);
|
|
}
|
|
|
|
int main()
|
|
{
|
|
DummyVFS vfs;
|
|
|
|
cout << "Listing all files:\n";
|
|
print(vfs.list());
|
|
cout << "\nStat for single files:\n";
|
|
print(vfs.stat("file1"));
|
|
cout << endl;
|
|
print(vfs.stat("dir/file2"));
|
|
cout << endl;
|
|
print(vfs.stat("dir"));
|
|
|
|
Stream *inp = vfs.open("file1");
|
|
cout << "filesize: " << inp->size() << endl;
|
|
|
|
return 0;
|
|
}
|