MCPcopy Create free account
hub / github.com/SpartanJ/eepp / create

Method create

src/eepp/system/pak.cpp:20–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20bool Pak::create( const std::string& path ) {
21 if ( !FileSystem::fileExists( path ) ) {
22 pakFile Pak;
23
24 Pak.header.head[0] = 'P';
25 Pak.header.head[1] = 'A';
26 Pak.header.head[2] = 'C';
27 Pak.header.head[3] = 'K';
28
29 Pak.header.dir_offset = sizeof( Pak.header.head ) + 1;
30 Pak.header.dir_length = 1;
31
32 eeSAFE_DELETE( mPak.fs );
33
34 mPak.fs = IOStreamFile::New( path, "wb" ); // Open the PAK file
35
36 mPak.fs->write( reinterpret_cast<const char*>( &Pak.header ), sizeof( Pak.header ) );
37
38 eeSAFE_DELETE( mPak.fs );
39
40 open( path );
41
42 return true;
43 } else {
44 return open( path );
45 }
46
47 return false;
48}
49
50bool Pak::open( const std::string& path ) {
51 if ( FileSystem::fileExists( path ) ) {

Callers 6

onCreateMethod · 0.45
createCustomCursorMethod · 0.45

Calls 2

NewFunction · 0.50
writeMethod · 0.45

Tested by

no test coverage detected