openmw-tes3coop/vfs/tests/dummy_test.cpp
Nicolay Korslund 69e8f9c9db Renamed several dirs, files and classes. NOT TESTED.
- 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
2009-12-28 15:55:04 +01:00

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;
}