Commit Graph

95 Commits

Author SHA1 Message Date
Ondrej Pokorny
ee9c54d51a implement TProxyAggregateStream (Delphi compatibility) 2024-05-23 15:03:12 +00:00
Michaël Van Canneyt
055740e2b3 * Overloads for TResourcestream.Create 2024-02-16 14:31:01 +01:00
Michaël Van Canneyt
113add75cc * Fix issue #40454 2023-10-02 10:15:24 +02:00
Michael VAN CANNEYT
68db04d89e * Adapt classes to Unicode RTL : Give string/char correct type depending on case 2023-07-24 15:37:51 +02:00
Michaël Van Canneyt
1f74ca0d1d * Fixes in PChar -> PansiChar 2023-07-15 18:22:41 +02:00
Michaël Van Canneyt
ec65ed9e64 * Better Ansi/WideString support for TStream. Fix StringStream with unicode to be delphi compatible 2023-07-15 18:22:41 +02:00
Michael VAN CANNEYT
d23fa5a87f * Char -> AnsiChar 2023-07-14 17:26:10 +02:00
mattias
c1f3960388 rtl: added overload GetClass(UnitName,ClassName), implemented UnregisterClass, overload TStream.WriteComponent(Instance,WriteUnitName) 2023-01-08 15:46:49 +01:00
Michaël Van Canneyt
5ca52bcab1 * Add Flush method to TFileStream. Fix issue #39619 2022-03-10 09:35:28 +01:00
Michaël Van Canneyt
7097a1030f * Added Read64/Write64 2022-01-23 12:18:43 +01:00
Michaël Van Canneyt
042eb7e8c1 * Small safety precaution 2022-01-23 12:03:24 +01:00
Sergey Larin
e27ea76b88 The TStream.ReadBuffer and TStream.WriteBuffer methods have changed the Count parameter type to NativeInt.
Changed the implementation of ReadBuffer, WriteBuffer so that the size of the blocks when calling Read and Write does not exceed High(Longint).
Notes:
- Thanks to this change, for example, a file larger than 2GB can be loaded into TMemoryStream.
- The fact that the Count parameter has the NativeInt type is compatible with the latest versions of Delphi.
2022-01-23 10:25:55 +00:00
marco
c8be89c7fa * fix from Sebastian Hellwig for writeunicodestring bytes number, mantis 0038963
git-svn-id: trunk@49478 -
2021-06-05 15:42:34 +00:00
svenbarth
38cde38177 * make TProxyStream.Check an abstract method; as it is right now one had to override it anyway because it always raised an exception
git-svn-id: trunk@48097 -
2021-01-06 20:25:12 +00:00
michael
0baf7db5e4 * Fix bug where position is not advanced when calling ReadAnsiString/ReadString
git-svn-id: trunk@47061 -
2020-10-07 10:15:13 +00:00
michael
74e65f77bc * Fix bug ID #37118
git-svn-id: trunk@45444 -
2020-05-20 07:32:09 +00:00
ondrej
a5ed5bd942 TFileStream: use SysErrorMessage in exception message if available
git-svn-id: trunk@44200 -
2020-02-17 08:35:15 +00:00
ondrej
e1e4f4c122 classes: introduce TRawByteStringStream
git-svn-id: trunk@43845 -
2020-01-02 20:02:27 +00:00
michael
20ca7d857c * Fix bug ID #36234: unicodedatastering must be of type unicodestring
git-svn-id: trunk@43357 -
2019-11-02 11:51:28 +00:00
michael
e4385d1b19 * Fix bug ID #35576
git-svn-id: trunk@42057 -
2019-05-13 20:15:00 +00:00
michael
dc592a888f * Make explicit that Integer is 32-bit
git-svn-id: trunk@42056 -
2019-05-13 11:47:46 +00:00
michael
fdccb0d62f * FIx compilation with 3.0.4
git-svn-id: trunk@42049 -
2019-05-12 15:36:04 +00:00
michael
58f1a8513b * FIx compilation for platforms that do not have extended
git-svn-id: trunk@42048 -
2019-05-12 15:33:26 +00:00
michael
60efc9e81c * Add Read/Write(Buffer) TBytes, ReadData/WriteData, ReadBufferData/WriteBufferData to be Delphi compatible
git-svn-id: trunk@42042 -
2019-05-12 10:09:16 +00:00
pierre
819752c334 Avoid warnings when -v0 is used by using $push/$pop
git-svn-id: trunk@41960 -
2019-04-29 14:19:16 +00:00
michael
844a9b0ca6 * Actually observe TStringStream.OwnsEncoding in destructor
git-svn-id: trunk@39379 -
2018-07-04 11:03:21 +00:00
michael
ab0c29e54f * Rename RawByteString version of TstringStream constructor, compiler cannot decide for empty string
git-svn-id: trunk@36759 -
2017-07-21 18:02:26 +00:00
michael
2b1bb6a5f5 * TStringStream now observes encoding, bug ID #30508
git-svn-id: trunk@36758 -
2017-07-21 17:02:37 +00:00
marco
6166215174 * make istream signedness equal to MSDN and modern delphi. Denis Kozlov,
mantis #31473

git-svn-id: trunk@35542 -
2017-03-08 15:05:11 +00:00
michael
bc6819aa91 * Attempt to avoid overflow when reallocating stream
git-svn-id: trunk@34518 -
2016-09-12 08:41:42 +00:00
michael
6b3b3d5c0c * Fix bug ID #29155, wrong declaration of ISTream.
git-svn-id: trunk@32820 -
2016-01-01 16:35:38 +00:00
michael
e6b86d9b5b * Made string in stringstream constructor optional
git-svn-id: trunk@32326 -
2015-11-15 11:05:19 +00:00
michael
61969710c3 * Writebuffer too (Fix bug 28796streams.inc
git-svn-id: trunk@31986 -
2015-10-09 06:57:05 +00:00
michael
2c24153736 * Fix bug #28796
git-svn-id: trunk@31982 -
2015-10-08 19:06:04 +00:00
yury
e1a0b1204a * Removed unused vars in RTL.
git-svn-id: trunk@31750 -
2015-09-17 16:48:53 +00:00
michael
5f5883695d * Fix bug #26954
git-svn-id: trunk@30292 -
2015-03-23 16:50:31 +00:00
michael
71a1628303 * Fix bug #24645
git-svn-id: trunk@28661 -
2014-09-14 16:17:25 +00:00
nickysn
9418fa9b8b * fixed compilation of unit classes with integer=smallint
git-svn-id: trunk@27045 -
2014-03-09 14:21:32 +00:00
michael
f163a35238 * UniqueString called on initial string for stringstream (bug ID 24130)
git-svn-id: trunk@26715 -
2014-02-08 09:55:31 +00:00
michael
b023e30164 * Only resize TStringStream.Datastring in case the string will grow because of the write operation
git-svn-id: trunk@26599 -
2014-01-28 08:37:49 +00:00
nickysn
730f7c82b7 * some fixes, intended to get units fgl and classes to compile on 16-bit cpus
git-svn-id: trunk@24649 -
2013-05-30 18:58:25 +00:00
svenbarth
930b76e8fb Fix compilation of WinCE. Change the fixed UNICODE define of WinCE to FPC_OS_UNICODE, so that it won't be undefined when changing the mode/string type and that the usage of a UNICODE API is independant of the mode.
Also adjusted all Windows (Win32/64/CE) units to define a "UNICODE" if "FPC_OS_UNICODE" is defined (except the Jedi units).
Also the common RTL units that checked for UNICODE now check for FPC_OS_UNICODE.

git-svn-id: trunk@24420 -
2013-05-04 11:06:32 +00:00
michael
a3f7a7fdb4 * Avoid overflow when reading from streams > 2gb
git-svn-id: trunk@22945 -
2012-11-06 23:41:49 +00:00
florian
39aef35bdc * pass not only exception address but also frame to raise:
if an address is passed the compiler cannot know a good 
  value for the frame so it passed nil and no stack trace is printed, resolves #12528

git-svn-id: trunk@22932 -
2012-11-04 20:40:21 +00:00
Jonas Maebe
404e1a34a4 * changed resource handle parameters from THandle to TFPResourceHMODULE so
they don't truncate the handle data on 64 bit platforms (patch by
    Anton Kavalenka, mantis #21721)

git-svn-id: trunk@22392 -
2012-09-14 15:05:08 +00:00
michael
9fc66414b5 * Avoid code duplication in TFileStream.Create
git-svn-id: trunk@19628 -
2011-11-11 17:32:17 +00:00
florian
cd2488d177 * fix compilation on 64 Bit targets
git-svn-id: trunk@19393 -
2011-10-06 17:54:44 +00:00
paul
7817f5017d rtl: add TBytesStream class for compatibility with delphi (TStringStream is a descendant of TBytesStream) + test
git-svn-id: trunk@19389 -
2011-10-06 04:41:10 +00:00
michael
96e5333dc2 * Added fakeSeekForward for benefit of descendant streams.
* Override GetSize/Position for memory/stringstream for efficiency
* Added InvalidSeek exception throwing. Should be overridden to throw custom exceptions.

git-svn-id: trunk@18190 -
2011-08-13 18:45:48 +00:00
michael
fd491e8647 * Fixed permissions on file create
git-svn-id: trunk@17560 -
2011-05-26 07:02:42 +00:00