mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 07:56:38 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			39 lines
		
	
	
	
		
			815 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
	
		
			815 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #include "dummy_vfs.cpp"
 | |
| #include "../clients/ogre_archive.hpp"
 | |
| #include <iostream>
 | |
| 
 | |
| using namespace Ogre;
 | |
| using namespace std;
 | |
| 
 | |
| void print(StringVectorPtr lst)
 | |
| {
 | |
|   int s = lst->size();
 | |
| 
 | |
|   for(int i=0; i<s; i++)
 | |
|     {
 | |
|       cout << "  " << (*lst)[i] << endl;
 | |
|     }
 | |
| }
 | |
| 
 | |
| int main()
 | |
| {
 | |
|   VFSPtr vfs(new DummyVFS());
 | |
|   MangleArchive arc(vfs, "dummy");
 | |
| 
 | |
|   cout << "Case: " << arc.isCaseSensitive() << endl;
 | |
|   cout << "Name: " << arc.getName() << endl;
 | |
|   cout << "Type: " << arc.getType() << endl;
 | |
|   cout << "All files:\n";
 | |
|   print(arc.list());
 | |
|   cout << "Non-recursive:\n";
 | |
|   print(arc.list(false, false));
 | |
|   cout << "Dirs:\n";
 | |
|   print(arc.list(false, true));
 | |
| 
 | |
|   DataStreamPtr file = arc.open("file1");
 | |
| 
 | |
|   cout << "filesize: " << file->size() << endl;
 | |
|   cout << "contents: " << file->getAsString() << endl;
 | |
| 
 | |
|   return 0;
 | |
| }
 |