|  |  | @ -6,14 +6,12 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <iostream> |  |  |  | #include <iostream> | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <iomanip> |  |  |  | #include <iomanip> | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <integers.h> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <vector> |  |  |  | #include <vector> | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <algorithm> |  |  |  | #include <algorithm> | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <sstream> |  |  |  | #include <sstream> | 
			
		
	
		
		
			
				
					
					|  |  |  | using namespace std; |  |  |  | using namespace std; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <DFTypes.h> |  |  |  | #include <DFHack.h> | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | #include <DFHackAPI.h> |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | // returns a lower case version of the string 
 |  |  |  | // returns a lower case version of the string 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | string tolower (const string & s) |  |  |  | string tolower (const string & s) | 
			
		
	
	
		
		
			
				
					|  |  | @ -49,9 +47,11 @@ uint32_t endian_swap(uint32_t x) | 
			
		
	
		
		
			
				
					
					|  |  |  | int main (void) |  |  |  | int main (void) | 
			
		
	
		
		
			
				
					
					|  |  |  | { |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  |     DFHack::ContextManager DF("Memory.xml"); |  |  |  |     DFHack::ContextManager DF("Memory.xml"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     DFHack::Context * C; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     DFHack::Translation * Tran; | 
			
		
	
		
		
			
				
					
					|  |  |  |     try |  |  |  |     try | 
			
		
	
		
		
			
				
					
					|  |  |  |     { |  |  |  |     { | 
			
		
	
		
		
			
				
					
					|  |  |  |         DF.Attach(); |  |  |  |         C = DF.getSingleContext(); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     catch (exception& e) |  |  |  |     catch (exception& e) | 
			
		
	
		
		
			
				
					
					|  |  |  |     { |  |  |  |     { | 
			
		
	
	
		
		
			
				
					|  |  | @ -62,15 +62,20 @@ int main (void) | 
			
		
	
		
		
			
				
					
					|  |  |  |         return 1; |  |  |  |         return 1; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     vector< vector<string> > englishWords; |  |  |  |     Tran = C->getTranslation(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     vector< vector<string> > foreignWords; |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     if(!DF.InitReadNameTables(englishWords,foreignWords)) |  |  |  |     if(!Tran->Start()) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     { |  |  |  |     { | 
			
		
	
		
		
			
				
					
					|  |  |  |         cerr << "Could not get Names" << endl; |  |  |  |         cerr << "Could not get Names" << endl; | 
			
		
	
		
		
			
				
					
					|  |  |  |         return 1; |  |  |  |         return 1; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     DFHack::Dicts dicts = *(Tran->getDicts()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     DFHack::DFDict & englishWords = dicts.translations; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     DFHack::DFDict & foreignWords = dicts.foreign_languages; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     C->Detach(); | 
			
		
	
		
		
			
				
					
					|  |  |  |     string input; |  |  |  |     string input; | 
			
		
	
		
		
			
				
					
					|  |  |  |     DF.ForceResume(); |  |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     cout << "\nSelect Name to search or q to Quit" << endl; |  |  |  |     cout << "\nSelect Name to search or q to Quit" << endl; | 
			
		
	
		
		
			
				
					
					|  |  |  |     getline (cin, input); |  |  |  |     getline (cin, input); | 
			
		
	
		
		
			
				
					
					|  |  |  |     while(input != "q"){ |  |  |  |     while(input != "q"){ | 
			
		
	
	
		
		
			
				
					|  |  | @ -96,11 +101,8 @@ int main (void) | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         DF.Resume(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         getline(cin,input); |  |  |  |         getline(cin,input); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     DF.Detach(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     DF.FinishReadNameTables(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     #ifndef LINUX_BUILD |  |  |  |     #ifndef LINUX_BUILD | 
			
		
	
		
		
			
				
					
					|  |  |  |         cout << "Done. Press any key to continue" << endl; |  |  |  |         cout << "Done. Press any key to continue" << endl; | 
			
		
	
		
		
			
				
					
					|  |  |  |         cin.ignore(); |  |  |  |         cin.ignore(); | 
			
		
	
	
		
		
			
				
					|  |  | 
 |