Subversion Repositories spk

Rev

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

Rev 158 Rev 178
Line 226... Line 226...
226
			printf("Error: unable to open file: %s\n", filename.c_str() );
226
			printf("Error: unable to open file: %s\n", filename.c_str() );
227
		else
227
		else
228
		{
228
		{
229
			f.UnPCKFile();
229
			f.UnPCKFile();
230
			if ( tofile.Empty() )
230
			if ( tofile.Empty() )
231
				f.ChangeFileExt("xml");
231
				f.changeFileExt("xml");
232
			else if ( tofile.Left(2) == "*." )
232
			else if ( tofile.Left(2) == "*." )
233
				f.ChangeFileExt(tofile.Right(3));
233
				f.changeFileExt(CFileIO(tofile).extension());
234
			else
234
			else
235
				f.SetFilename(tofile);
235
				f.setFilename(tofile.ToString());
236
 
236
 
237
			if ( !f.writeFilePointer() )
237
			if ( !f.writeFilePointer() )
238
				printf("Error: unable to write file: %s\n", tofile.c_str() );
238
				printf("Error: unable to write file: %s\n", tofile.c_str() );
239
			else
239
			else
240
				printf("%s has been unpacked to %s\n", file.c_str(), f.filename().c_str() );
240
				printf("%s has been unpacked to %s\n", file.c_str(), f.filename().c_str() );
Line 264... Line 264...
264
			printf("Error: unable to pack file: %s\n", filename.c_str() );
264
			printf("Error: unable to pack file: %s\n", filename.c_str() );
265
		else
265
		else
266
		{
266
		{
267
			if ( tofile.Empty() )
267
			if ( tofile.Empty() )
268
			{
268
			{
269
				if ( f.CheckFileExt("bob") )
269
				if ( f.checkFileExt("bob") )
270
					f.ChangeFileExt("pbb");
270
					f.changeFileExt("pbb");
271
				else if ( f.CheckFileExt("bod") )
271
				else if ( f.checkFileExt("bod") )
272
					f.ChangeFileExt("pbd");
272
					f.changeFileExt("pbd");
273
				else
273
				else
274
					f.ChangeFileExt("pck");
274
					f.changeFileExt("pck");
275
			}
275
			}
276
			else if ( tofile.Left(2) == "*." )
276
			else if ( tofile.Left(2) == "*." )
277
				f.ChangeFileExt(tofile.Right(3));
277
				f.changeFileExt(tofile.Right(3).ToString());
278
			else
278
			else
279
				f.SetFilename(tofile);
279
				f.setFilename(tofile.ToString());
280
 
280
 
281
			if ( !f.writeFilePointer() )
281
			if ( !f.writeFilePointer() )
282
				printf("Error: unable to write file: %s\n", tofile.c_str() );
282
				printf("Error: unable to write file: %s\n", tofile.c_str() );
283
			else
283
			else
284
				printf("%s has been packed to %s\n", file.c_str(), f.filename().c_str() );
284
				printf("%s has been packed to %s\n", file.c_str(), f.filename().c_str() );