Subversion Repositories spk

Rev

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

Rev 102 Rev 124
Line 50... Line 50...
50
	int err = catfile.Open ( filename, "", CATREAD_CATDECRYPT );
50
	int err = catfile.Open ( filename, "", CATREAD_CATDECRYPT );
51
 
51
 
52
	if ( err == CATERR_NONE )
52
	if ( err == CATERR_NONE )
53
	{
53
	{
54
		printf ( "Opened file\n" );
54
		printf ( "Opened file\n" );
55
		for ( int i = 0; i < catfile.GetNumFiles(); i++ )
55
		for (unsigned int i = 0; i < catfile.GetNumFiles(); i++)
56
		{
56
		{
57
			SInCatFile *file = catfile.GetFile ( i );
57
			SInCatFile *file = catfile.GetFile ( i );
58
 
58
 
59
			if ( !searchmask.Empty() )
59
			if ( !searchmask.Empty() )
60
			{
60
			{
Line 93... Line 93...
93
	}
93
	}
94
 
94
 
95
	// all files
95
	// all files
96
	if ( filemask == "*" )
96
	if ( filemask == "*" )
97
	{
97
	{
98
		for ( int i = 0; i < cat.GetNumFiles(); i++ )
98
		for (unsigned int i = 0; i < cat.GetNumFiles(); i++)
99
		{
99
		{
100
			SInCatFile *f = cat.GetFile(i);
100
			SInCatFile *f = cat.GetFile(i);
101
			if ( !cat.ExtractFile ( f, to ) )
101
			if ( !cat.ExtractFile ( f, to ) )
102
				printf ( "Error: %s\n", cat.GetErrorString().c_str() );
102
				printf ( "Error: %s\n", cat.getErrorString().c_str() );
103
			else
103
			else
104
				printf ( "File has been written (%s)\n", cat.ErrorString().c_str() );
104
				printf ( "File has been written (%s)\n", cat.errorString().c_str() );
105
		}
105
		}
106
 
106
 
107
		return;
107
		return;
108
	}
108
	}
109
 
109
 
Line 120... Line 120...
120
 
120
 
121
	for ( SStringList *fl = fileList->Head(); fl; fl = fl->next )
121
	for ( SStringList *fl = fileList->Head(); fl; fl = fl->next )
122
	{
122
	{
123
		CyString file = fl->str;
123
		CyString file = fl->str;
124
		if ( !cat.ExtractFile ( file, to, preserve ) )
124
		if ( !cat.ExtractFile ( file, to, preserve ) )
125
			printf ( "Error: %s\n", cat.GetErrorString().c_str() );
125
			printf ( "Error: %s\n", cat.getErrorString().c_str() );
126
		else
126
		else
127
			printf ( "File has been written (%s)\n", cat.ErrorString().c_str() );
127
			printf ( "File has been written (%s)\n", cat.errorString().c_str() );
128
	}
128
	}
129
 
129
 
130
	delete fileList;
130
	delete fileList;
131
}
131
}
132
 
132
 
Line 203... Line 203...
203
	{
203
	{
204
		printf ( "Unable to find %s in cat file\n", remfile.c_str() );
204
		printf ( "Unable to find %s in cat file\n", remfile.c_str() );
205
		return;
205
		return;
206
	}
206
	}
207
 
207
 
208
	if ( cat.RemoveFile ( f ) )
208
	if (cat.removeFile(f))
209
		printf ( "File has been removed from archive\n" );
209
		printf ( "File has been removed from archive\n" );
210
}
210
}
211
 
211
 
212
void UnpackFile ( CyString file, CyString tofile )
212
void UnpackFile ( CyString file, CyString tofile )
213
{
213
{