Commit Graph

53 Commits

Author SHA1 Message Date
Chris Danford 1fcfc22981 CString -> RString
const string params where possible for easier debug stepping
2005-12-28 03:59:52 +00:00
Glenn Maynard 636369ba4b remove deprecated RageFileDriverZip ctor 2005-12-18 20:18:32 +00:00
Glenn Maynard c2b70be5cb implement GetGlobalComment 2005-12-13 03:07:48 +00:00
Chris Danford ec51af900e CString -> RString for files used by smpackage 2005-12-10 08:15:44 +00:00
Glenn Maynard 7c7c547131 missing headers 2005-09-03 21:26:04 +00:00
Glenn Maynard 19ff272c01 perms fixes 2005-05-22 23:46:39 +00:00
Glenn Maynard e157d52a76 expose FileInfo
expose file permissions
2005-05-22 22:45:15 +00:00
Glenn Maynard 8f68a555a6 Load() methods, to allow error checking 2005-05-21 00:40:18 +00:00
Glenn Maynard 209040e02d clean up file drivers: drivers now always receive paths with trailing slashes;
this makes handling the relative "root" directory not a special case (".").
mountpoints now always begin with a slash.  before, "/foo" and "foo" were
in two separate namespaces, which was weird and confusing; the two now
mean the same thing.  there are no more special "default mountpoints"; just
mount to "/".  "@path" mounts are now "/@path", and they do show up in
GetDirListing("/") (but, as before, opening "/@foo/bar" will never create
a "@foo/bar" path in a non-"@foo" mountpoint)
2005-05-20 22:26:54 +00:00
Glenn Maynard 0986e61f3d rewrite ZIP parsing. only a tiny bit of code was used from InfoZIP, causing
us to have to lug around a proportionately unreasonably big chunk of
licensing text.  (this code is smaller, too.)
2005-05-18 06:44:24 +00:00
Glenn Maynard 382db74f8f generalize zip reading 2005-03-24 09:40:56 +00:00
Glenn Maynard a9c73de5b6 fix ZIP thread-safety? 2005-02-24 06:07:49 +00:00
Glenn Maynard ea79ec3e1b add RageFileDriverSlice::DeleteFileWhenFinished 2004-12-12 04:07:22 +00:00
Glenn Maynard d171b8e306 don't always free pFile from ~RageFileObjInflate 2004-12-11 22:57:03 +00:00
Glenn Maynard 4059c657ca split out deflate compression layer; this could also be used with gzip 2004-12-11 08:03:39 +00:00
Glenn Maynard 3e1bc98856 move some ZIP handling code into RageFileDriverSlice 2004-12-11 06:35:41 +00:00
Glenn Maynard 752d4ecdb8 simplify: use RageFileObjZipStored to create an abstract "file" within the ZIP, which is them simply passed to RageFileObjZipDeflate if it's compressed. 2004-12-11 04:48:16 +00:00
Glenn Maynard 1552944b98 generalize/cleanup 2004-12-11 04:23:48 +00:00
Glenn Maynard de0eed990d generalize/cleanup 2004-12-11 04:16:49 +00:00
Glenn Maynard a946c220bc whitespace cleanups (prefer tabs over spaces) 2004-12-11 02:30:24 +00:00
Glenn Maynard ae92b86b34 RageFileBasic 2004-12-11 02:25:38 +00:00
Glenn Maynard 7bb2cec302 simplify RageFileObjZipStored 2004-12-11 01:18:27 +00:00
Glenn Maynard 47994102b3 vc fix? 2004-12-10 13:13:14 +00:00
Glenn Maynard 8915e3944a simplify; use RageBasicFile instead of RageFileObj 2004-12-10 10:04:32 +00:00
Glenn Maynard 287a150db7 Move buffering logic from RageFile into RageFileObj.
Common file interface class, RageBasicFile, shared by RageFile
and RageFileObj.  This makes most uses of these objects interchangeable.
RageFile is now just a simple wrapper for RageFileObj, to create
files in FILEMAN's namespace; file objects can also be created
independently.  This means that, for example, IniFile can be used
to write a file to a CString, without having to jump through hoops,
and without having to use a separate file access wrapper; just do
something like:

RageFileObjMem string_file;
ini.WriteFile( string );
const CString &sString = string_file.GetString();
2004-12-10 08:48:18 +00:00
Glenn Maynard a526d09e3a seek fix 2004-12-10 03:25:28 +00:00
Glenn Maynard e2ea72dbac internalize RageFileObj implementation functions 2004-12-10 03:14:01 +00:00
Glenn Maynard ec22ffec62 stop passing ugly back-references to the RageFile to RageFileObj 2004-12-09 11:47:20 +00:00
Glenn Maynard 6761eb7a51 remove Rewind() 2004-12-09 10:44:07 +00:00
Glenn Maynard ea820c77b2 Avoid RageFileObj::Seek; handle rewinds in Seek(). 2004-12-09 10:38:42 +00:00
Glenn Maynard fa2719a2c1 Remove RageFile::SeekCur(). It's just as easy to call Seek(Tell()), and
separating "seek from current position" doesn't do anything useful for
file drivers.
2004-12-09 08:36:08 +00:00
Glenn Maynard 6558f6f7de This comment is incorrect. deflateReset() doesn't leak; it resets the
object to a just-initialized state.  deflateEnd() is correct (no comment
needed for that; it's obvious, I don't know why I used deflateReset to
begin with).

zlib doesn't appear to do anything special with allocations; running
the following:

#include <zlib.h>
main()
{
	z_stream z; z.zalloc = NULL; z.zfree = NULL;
	inflateInit2( &z, -MAX_WBITS ); inflateReset( &z );
}

under Valgrind shows:

==17033== 7080 bytes in 1 blocks are possibly lost in loss record 1 of 1
==17033==    at 0x1B904EDD: malloc (vg_replace_malloc.c:131)
==17033==    by 0x1B91D4B4: zcalloc (in /usr/lib/libz.so.1.2.1.2)
==17033==    by 0x1B91D608: inflateInit2_ (in /usr/lib/libz.so.1.2.1.2)
==17033==    by 0x80485A4: main (in /home/glenn/a.out)
2004-12-09 04:07:14 +00:00
Charles Lohr 9a93860c6a Major memory leak fix regarding packages.
The reason that only some people were experiencing a major memory leak
was that it had to do with packages, a lot of devs don't use packages.

This leak could not be found through conventional methods, as zlib's ram
seems to be allocated from the global ram.
2004-12-09 02:09:32 +00:00
Glenn Maynard 3da657bfc8 simplify 2004-09-05 03:43:05 +00:00
Glenn Maynard cbea6c75bc use GetFilePriv 2004-09-05 03:41:40 +00:00
Glenn Maynard 57b6bd4ceb fix RageFileObjZipStored::Copy 2004-09-05 03:37:34 +00:00
Glenn Maynard db0fa11b51 use NullFilenameDB 2004-09-05 03:35:49 +00:00
Glenn Maynard 463c81d7f1 const 2004-08-30 04:49:57 +00:00
Glenn Maynard 33a04b79de beginning GPL->X11 license transition
The conventions I'm using are to put the entire copyright notice at the bottom
of each file, and to put the summary of the source file's use at the top of the
header.

Putting the license text in each file avoids confusion, and is normal practice
for many projects.  Putting it at the bottom gets it out of the way; it's a
ton of clutter to put at the top.

The description is in the header.  People who don't know what a class is for,
or how to use it, are probably looking at the header to see the interface,
not the implementation, so let's put the description in there.  Keep it brief
(one line); any substantial implementation notes should go in the source file.
2004-05-06 00:42:06 +00:00
Glenn Maynard 485354928f fix error reporting 2004-04-21 04:16:31 +00:00
Steve Checkoway 20a8bab45c Clean up includes. 2004-04-05 05:22:32 +00:00
Steve Checkoway ec6039769c Work around stupid #include bug. 2004-02-17 00:24:56 +00:00
Glenn Maynard a7b2a73889 fix for very small ZIPs 2004-02-11 20:58:02 +00:00
Glenn Maynard 1b69bfdff9 allow VFS drivers to register themselves 2004-02-10 23:39:45 +00:00
Manu Evans ce888de237 fixed some xbox build errors :/ 2004-01-17 05:21:24 +00:00
Glenn Maynard 6c7ac56451 optimize lseek(0,SEEK_END) in ZIPs 2004-01-11 22:01:49 +00:00
Glenn Maynard 20792a51bb Write files in such a way that a program crash, system crash, powerdown,
etc. won't cause data loss if we're running on a journalling filesystem.
2003-12-21 07:23:29 +00:00
Glenn Maynard c34c2c5aec dur 2003-12-10 11:01:44 +00:00
Glenn Maynard aac40fec42 disable RageFileObjZipDeflated::Copy 2003-12-10 10:06:32 +00:00
Glenn Maynard b62824a60c fix warnings, compile 2003-12-10 07:32:40 +00:00