Subversion Repositories spk

Rev

Rev 1 | Rev 52 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 41
Line 77... Line 77...
77
}
77
}
78
 
78
 
79
 
79
 
80
void ExtractFile ( CyString filename, CyString to, bool preserve )
80
void ExtractFile ( CyString filename, CyString to, bool preserve )
81
{
81
{
-
 
82
	//TEST
-
 
83
	char file1[10];
-
 
84
	char file2[10];
-
 
85
	FILE *id = fopen("d:/hull.bob", "rb");
-
 
86
	if ( id ) {
-
 
87
		fread(file1, sizeof(char), 10, id);
-
 
88
		fclose(id);
-
 
89
	}
-
 
90
	id = fopen("c:/extracted/hull.bob", "rb");
-
 
91
	if ( id ) {
-
 
92
		fread(file2, sizeof(char), 10, id);
-
 
93
		fclose(id);
-
 
94
	}
-
 
95
 
82
	if ( !filename.IsIn ( "::" ) )
96
	if ( !filename.IsIn ( "::" ) )
83
		return;
97
		return;
84
 
98
 
85
	CyString catfile = filename.GetToken ( "::", 1, 1 );
99
	CyString catfile = filename.GetToken ( "::", 1, 1 );
86
	CyString filemask = filename.GetToken ( "::", 2, 2 );
100
	CyString filemask = filename.GetToken ( "::", 2, 2 );
Line 106... Line 120...
106
		}
120
		}
107
 
121
 
108
		return;
122
		return;
109
	}
123
	}
110
 
124
 
-
 
125
	//TODO: add proper file mask for extracting
111
	CyStringList *fileList = FindFiles(filemask);
126
	//CyStringList *fileList = FindFiles(filemask);
-
 
127
	CyStringList *fileList = new CyStringList;
-
 
128
	fileList->PushBack(filemask);
112
	if ( !fileList && fileList->Empty() )
129
	if ( !fileList || fileList->Empty() )
113
	{
130
	{
-
 
131
		if ( fileList ) delete fileList;
114
		printf ( "Error: unable to find any files matching: %s\n", filemask.c_str() );
132
		printf ( "Error: unable to find any files matching: %s\n", filemask.c_str() );
115
		return;
133
		return;
116
	}
134
	}
117
 
135
 
118
	for ( SStringList *fl = fileList->Head(); fl; fl = fl->next )
136
	for ( SStringList *fl = fileList->Head(); fl; fl = fl->next )