Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fileutil.h
Go to the documentation of this file.
1 #ifndef __FILEUTIL_H
2 #define __FILEUTIL_H
3 
4 #include <string>
5 #include <vector>
6 #include "networking/const.h"
7 #include "vsfilesystem.h"
8 
9 using namespace VSFileSystem;
10 using std::string;
11 using std::vector;
12 
13 #ifdef CRYPTO
14 #include <crypto++/sha.h>
15 using namespace CryptoPP;
16 #endif
17 
18 namespace FileUtil
19 {
20 //Returns 2 strings -> vector[0] = xml unit, vector[1] = player save
21 vector< string >GetSaveFromBuffer( NetBuffer &buffer );
22 void WriteSaveFiles( string savestr, string xmlstr, string name );
23 
24 extern bool use_crypto;
25 #ifdef CRYPTO
26 extern HASHMETHOD Hash;
27 #endif
28 void displayHash( unsigned char *hash, unsigned int length );
29 int HashCompare( string filename, unsigned char *hashdigest, VSFileType type );
30 int HashFileCompute( string filename, unsigned char *hashdigest, VSFileType type );
31 int HashCompute( const char *filename, unsigned char *digest, VSFileType type );
32 int HashStringCompute( std::string buffer, unsigned char *digest );
33 }
34 
35 #endif
36