Commit Graph

115 Commits

Author SHA1 Message Date
SupSuper
48b9f54bfc COMMON: Add support for fixed-size strings in ReadStream::readString 2021-05-31 06:40:05 +01:00
SupSuper
5daeab2e76 COMMON: Add floating-point functions to ReadStreamEndian 2021-05-31 06:40:03 +01:00
Orgad Shaneh
a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
Cameron Cawley
b5d6716d1d COMMON: Add ReadStream::readString() and use it in the Ultima engine 2020-12-15 17:39:25 -08:00
Bartosz Gentkowski
487b6af090 DOXYGEN: Changes to stream.h and system.h
Review and improve doxygen comments in stream.h and system.h.
2020-11-12 21:23:29 +00:00
Thierry Crozat
0575130b35 COMMON: Improve ReadStreamEndian implementation
The commit does not change the behaviour of the class but makes
its implementation more logical, and in line with how it was
originaly implemented (before being refactored in commit 1011508).
Both FROM_BE_* and TO_BE_* do the same thingi for example, but you
use this stream class to read from a BE or LE stream and convert
the values to native endianness, and thus it makes more sense to
use FROM_BE_* and FROM_LE_* instead of TO_BE_* and TO_LE_* (which
suggested that we read values in native endianness and then
convert to the specified endianness).
2020-11-12 21:18:44 +00:00
Bartosz Gentkowski
ec24687ce4 DOXYGEN: Add doxygen groups to header files in the common folder
Adding @defgroup and @ingroup doxygen tags into all headers
in the common folder that contain doxygen blocks.

This improves the structure, readability, and findability
of information in the resulting output.

This commit targets purely structure and does not deal with
the content of the currently existing doxygen documentation.
2020-10-04 18:25:50 +02:00
SupSuper
55db9e92e9 Revert "COMMON: Fix abstract SeekableReadStreamEndian calling virtual constructor"
This reverts commit bed3550cbd.
2020-07-28 00:27:03 +01:00
SupSuper
bed3550cbd COMMON: Fix abstract SeekableReadStreamEndian calling virtual constructor 2020-07-27 23:07:06 +01:00
Eugene Sandulenko
1aea38cc63 COMMON: Makw SeekableSubReadStreamEndian subclass of SeekableReadStreamEndian 2020-07-21 18:20:00 +02:00
Cameron Cawley
e207fda7f7 COMMON: Allow ignoring CR line breaks in SeekableReadStream::readLine() 2020-05-12 14:41:53 +02:00
Cameron Cawley
13e5042dee COMMON: Add WriteStream::writeStream() 2020-02-09 23:26:45 +02:00
Le Philousophe
97397bdaff STREAM: add read/write functions for double LE/BE 2019-06-01 22:43:48 +02:00
Paul Gilbert
f4dacdf34d COMMON: Created SeekableWriteStream class 2019-05-12 11:44:15 +03:00
Bastien Bouclet
86573a8eaf COMMON: Unconditionally enable 64 bit integer features 2017-09-30 21:35:16 +02:00
yinsimei
8f2a177cef STREAM: add read/write functions for float LE/BE 2017-07-13 18:27:45 +02:00
Eugene Sandulenko
0b95b734b8 COMMON: Add ReadStream::readPascalString() 2017-01-14 12:45:58 +01:00
Eugene Sandulenko
3071bb40d8 COMMON: Added debug method for printing out stream contents 2016-10-26 19:00:13 +02:00
Eugene Sandulenko
7ab0985ca8 COMMON: Add ReadFloatLE to Common::ReadStream 2016-09-29 22:33:36 +02:00
Alexander Tkachev
7a89caac84 COMMON: Add WriteStream::pos()
It returns int32, because some complex streams are derived from both
WriteStream and ReadStream, and in ReadStream pos() returns int32,
because -1 means an error.

I had to change MemoryStream's uint32 to int32, which is probably not so
good.
2016-08-04 14:36:21 +06:00
Johannes Schickel
eb4d1a6925 COMMON: Add missing readUint64/readSint64 to ReadStreamEndian. 2015-01-04 21:09:32 +01:00
Eugene Sandulenko
7865c78211 COMMON: Put more 64-bit stuff under HAVE_INT64 2015-01-04 20:47:12 +01:00
Adrian Astley
d497b45b1c COMMON: Fix typo that caused uint64 reads to return a uint32 2014-12-21 03:58:58 -06:00
Adrian Astley
c58f714610 COMMON: Add support for endian-safe reading/writing of int64 2014-09-16 13:49:27 -05:00
Einar Johan Trøan Sømåen
b7c5ce879f COMMON: Fix some Doxygen comments that seem wrong. 2014-08-29 03:28:00 +02:00
Johannes Schickel
854e22b38b COMMON: Make GPL headers consistent in themselves. 2014-02-18 02:39:33 +01:00
Johannes Schickel
b4d0a8ba66 JANITORIAL: Enforce "} // End of namespace" with a single space after }. 2013-01-26 19:38:02 +01:00
Max Horn
904739cc00 COMMON: Document that Stream API is meant to imitate ISO C FILE semantics 2011-05-18 13:06:41 +02:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Matthew Hoops
34db1820eb COMMON: Add an isBE() function to get the endianness of a ReadStreamEndian
svn-id: r54500
2010-11-26 15:06:25 +00:00
Max Horn
1cc80de1d9 COMMON: Add SeekableReadStreamEndian class
svn-id: r54445
2010-11-23 22:33:10 +00:00
Max Horn
12d5151ff4 COMMON: Remove default value for endianess in ReadStreamEndian subclasses
svn-id: r54441
2010-11-23 22:27:20 +00:00
Max Horn
382982d6e3 COMMON: Add ReadStreamEndian mixin class
svn-id: r54438
2010-11-23 22:26:27 +00:00
Max Horn
2180b2d6b5 COMMON: Split common/stream.h into several headers
svn-id: r54385
2010-11-19 17:03:07 +00:00
Max Horn
9fb1e2b17e COMMON: Change wrapBufferedWriteStream() to always disposes wrapped stream
This is the only we need right now, and it saves a few bytes per
instance. The template approach I used before has the drawback that it
increases the binary size, which negates the benefit. Thanks to LordHoto
for pointing this out.

svn-id: r54344
2010-11-18 20:27:15 +00:00
Max Horn
152e52d015 COMMON: Make implementation of Buffered*Stream classes internal
svn-id: r54326
2010-11-18 17:02:51 +00:00
Max Horn
4707b610fc COMMON: Fix incorrect use of assert() macro
The assert() macro may be compiled to be empty. In that case, its
arguments are *NOT* evaluated. Hence, things like
  assert(doSomething())
must not be used whenever doSomething() has important side effects.

Also document BufferedWriteStream::flushBuffer() and explain why it
exists parallel to BufferedWriteStream::flush().

svn-id: r54322
2010-11-18 16:08:56 +00:00
Jordi Vilalta Prat
8388e0dfea JANITORAL: Clean trailing whitespaces.
svn-id: r53160
2010-10-12 02:18:11 +00:00
Yotam Barnoy
94b41f5d2e COMMON: remove virtual functions from BufferedStreams
As Max pointed out to me, they don't work as expected when called from constructors/destructors.

svn-id: r52724
2010-09-14 14:57:30 +00:00
Willem Jan Palenstijn
9dfb24851c COMMON: Remove dangerous virtual keywords.
See r52722.

svn-id: r52723
2010-09-14 14:18:25 +00:00
Willem Jan Palenstijn
05c2cc4d1d COMMON: Fix eos handling in BufferedReadStream
This makes it pass the test added in r52382.

svn-id: r52389
2010-08-25 14:43:42 +00:00
Yotam Barnoy
4368d3c574 COMMON: fixed EOS handling in BufferedReadStream and BufferedSeekableReadStream
EOS problem was causing Discworld to crash and zip files not to load on the PSP.

svn-id: r52377
2010-08-25 09:14:41 +00:00
Yotam Barnoy
efdbb076a2 COMMON: implemented BufferedWriteStream and fixed bug in BufferedReadStream
I need the write buffering for the new version of the PSP streams and thought the simplest way to implement it would be along the lines of BufferedReadStream. Sadly, I found a nasty little bug in BRS but that's taken care of.
Also, I adapted these streams for target-specific memory allocation by using virtual functions for allocation/deallocation.

svn-id: r52325
2010-08-24 11:18:48 +00:00
Eugene Sandulenko
024f492137 Added seek() method to MemoryWriteStreamDynamic.
If it deserves a separate class, shout.

svn-id: r49750
2010-06-15 10:34:14 +00:00
Max Horn
bbaf98127d correct typo
svn-id: r49270
2010-05-27 20:59:15 +00:00
Max Horn
0cf53b025d Move DisposeAfterUse::Flag from Common to global namespace, and into a new header common/types.h
svn-id: r47180
2010-01-08 22:07:35 +00:00
Matthew Hoops
85787988a0 Remove the getBeginOffset() hack from Common::SeekableReadStream and introduce QTPlayer::setChunkBeginOffset() to allow specifying what offset to use.
svn-id: r46786
2009-12-31 00:37:40 +00:00
Max Horn
d083e02215 Rename Common::Stream::readLine_NEW to readLine
svn-id: r46779
2009-12-30 23:00:55 +00:00
Max Horn
47f48dd912 spelling
svn-id: r46778
2009-12-30 23:00:22 +00:00