Commit Graph

769 Commits

Author SHA1 Message Date
nickysn
9e74f05343 + added cp856, iso-8859-10, iso-8859-11, iso-8859-14 and iso-8859-16 to the
CodePageNames and CodePageHashes translation tables in the SysUtils unit

git-svn-id: trunk@36443 -
2017-06-07 11:55:54 +00:00
marco
f0a02cdaf9 * reengineered utf8-less fix for #0031257
git-svn-id: trunk@36293 -
2017-05-22 13:58:43 +00:00
michael
06227c9557 * Fix bug ID #31814, StrToDateTimeDef with FormatSettings parameter
git-svn-id: trunk@36214 -
2017-05-15 13:10:56 +00:00
pierre
78343902bf Allow objpas classes and sysutils units to compile with threading support disabled
git-svn-id: trunk@36107 -
2017-05-04 22:13:11 +00:00
michael
5cd12a2521 * Better m/mm format specifier docs (bug ID 31449)
git-svn-id: trunk@35892 -
2017-04-22 10:02:29 +00:00
marcus
824cabd203 Fixed textractquote regression after r35598
git-svn-id: trunk@35604 -
2017-03-16 08:04:38 +00:00
michael
e2d704cc8d * Small optimization in CompareStr as suggested in bug ID #30777
git-svn-id: trunk@35601 -
2017-03-15 21:30:19 +00:00
michael
0ee31963ed * explicit check for Nil in AnsiExtractQuotedString (bug 31212)
git-svn-id: trunk@35598 -
2017-03-15 18:05:39 +00:00
michael
8d7fd39282 * Fix isNan, isInfinity, IsPositiveInfinity
git-svn-id: trunk@35356 -
2017-01-29 11:58:22 +00:00
michael
b5fb706a65 * Fix bug #31176: (Try)StrToBool should accept localized floats
git-svn-id: trunk@35331 -
2017-01-25 21:23:07 +00:00
marco
e6029140eb * fix for #31073
git-svn-id: trunk@35203 -
2016-12-27 16:31:14 +00:00
marco
b33da605f3 * move tendian to objpas, alias in sysutils, types. mantis #31150
git-svn-id: trunk@35202 -
2016-12-27 14:30:13 +00:00
Károly Balogh
c7576e4a3f sysutils: enable FINDHANDLE_IS_POINTER for Amiga-like systems and Atari. this allows to remove some Pointer<->THandle casts from the amicommon code
git-svn-id: trunk@35198 -
2016-12-27 03:23:54 +00:00
michael
c0f183258f * Added EProgrammerNotFound and EInvalidOpException, by Silvio Clecio (bug ID 30627)
git-svn-id: trunk@34986 -
2016-11-27 15:54:06 +00:00
michael
10360a823e * Fix bug ID #30960
git-svn-id: trunk@34970 -
2016-11-26 17:28:55 +00:00
michael
3e21810dbd * Change comments for AdjustLineBreaks (bug ID 30959)
git-svn-id: trunk@34969 -
2016-11-26 17:05:54 +00:00
michael
47a59f269a * Added some explanatory comments about the use of this include file
git-svn-id: trunk@34925 -
2016-11-20 10:07:15 +00:00
michael
8e3381b4bc Fix bug #30930
git-svn-id: trunk@34903 -
2016-11-15 20:15:33 +00:00
michael
f648bdecba * Made some additional functions inlined (Bug ID 30909)
git-svn-id: trunk@34874 -
2016-11-11 10:28:19 +00:00
michael
9b21d9a87e * Inline some functions, bug ID #30905
git-svn-id: trunk@34868 -
2016-11-11 09:33:28 +00:00
pierre
a81d2b58f8 Rectify last accessed char in TBigEndianUnicideEncoding.GetChars, fixes test/units/sysutils/tencodingtest.pp failure with -gc option
git-svn-id: trunk@34740 -
2016-10-17 10:48:28 +00:00
michael
9f88f52ddf * Getters/Setters should be private
git-svn-id: trunk@34725 -
2016-10-15 20:59:01 +00:00
svenbarth
63f0c7a2c3 Fix for Mantis #30734: Implement Delphi-compatible functions StrToUInt64(), StrToUInt64Def and TryStrToUInt64 as inline forwarders to the existing respective QWord functions
git-svn-id: trunk@34710 -
2016-10-13 17:49:50 +00:00
michael
5810ff8154 * Patch from Maciej Izak for delphi compatible TLocaleOptions (bug ID 30660)
git-svn-id: trunk@34683 -
2016-10-08 22:23:34 +00:00
Jonas Maebe
265923a2ee * several fixes for TMultiReadExclusiveWriteSynchronizer, based on patch by
Derek (mantis #28830)
   o ability for a thread to acquire a readlock when it already holds a
     write lock, or vice versa
   o detect when thread1 releases a lock while it hadn't acquired one
   o correct result of beginwrite (return true only when another thread
     held/acquired a write lock before the current thread got it)
   o extra compared to Derek's patch: replaced some additional
     (mostly pre-existing) interlocked*() hacks with proper memory
     barriers, made formatting consistent, fixed compilation on platforms
     where tthreadid is not an integer type, improved tthreadid hashing
     function for 64 bit platforms, fixed some comments

git-svn-id: trunk@34678 -
2016-10-08 20:45:45 +00:00
michael
f4e3068c8b * AnsiExtractquotedStr returns original string if unquoted
git-svn-id: trunk@34495 -
2016-09-10 18:51:02 +00:00
michael
5917b38706 * AnsiDequotedString needs to return empty if it equals "" (bug ID 30220)
git-svn-id: trunk@34494 -
2016-09-10 18:43:59 +00:00
michael
b504cc4131 * Make singletons thread-safe
git-svn-id: trunk@34483 -
2016-09-10 16:51:50 +00:00
michael
de7e5d73c0 * Patch from Ondrej Pokorny to add GetAnsiBytes/GetAnsiString
git-svn-id: trunk@34474 -
2016-09-10 10:44:30 +00:00
nickysn
c205cb03c8 * in SysUtils.DecodeDate(), cast the result of trunc() to longint (trunc
normally returns int64 in FPC), before performing any further calculations -
  the result always fits in a longint (the date is range checked against
  MaxDateTime and that is well within longint limits). This generates faster
  code on non 64-bit targets and also fixes i8086 compilation, which previously
  failed on register allocation on this function.

git-svn-id: trunk@33946 -
2016-06-10 19:39:44 +00:00
michael
253589b0b6 * Fix compilation for msdos
git-svn-id: trunk@33704 -
2016-05-17 18:41:33 +00:00
michael
a5d38c7ba6 * Added TStringBuilder
git-svn-id: trunk@33695 -
2016-05-16 15:23:40 +00:00
michael
3e96806f7e Renamed DisposeAndNil to FreeMemAndNil
git-svn-id: trunk@33378 -
2016-03-29 07:55:58 +00:00
michael
92b8bf97c0 * Added DisposeAndNil (bug ID 28895)
git-svn-id: trunk@33377 -
2016-03-29 07:33:28 +00:00
michael
231ec77175 * Delphi compatibility classes (Patch by Silvio Clecio, bug ID #29917)
git-svn-id: trunk@33362 -
2016-03-28 12:57:42 +00:00
michael
f380aeb63d * Fix from Andrea Mauri to make formatfloat delphi-compatible in case of negative zero (bug ID 26465)
git-svn-id: trunk@33344 -
2016-03-27 10:40:09 +00:00
michael
bcdfe055a8 * Fix bug ID #26944 (thousandseparator, patch from wp)
git-svn-id: trunk@33343 -
2016-03-27 10:13:16 +00:00
michael
2ec2f1fc16 * Fix bug in WrapText (bug ID 26677)
git-svn-id: trunk@33342 -
2016-03-27 09:41:23 +00:00
michael
2b077f6af3 * Revert Integer -> SizeInt change where appropriate, capping result when needed
git-svn-id: trunk@33327 -
2016-03-26 07:41:34 +00:00
michael
5085009410 * Added GetDriveIDFromLetter, bug ID #28318
git-svn-id: trunk@33300 -
2016-03-20 19:04:49 +00:00
marco
66608fec02 * unicode executeprocess from work during Lazarus convention in IJsselstein
git-svn-id: trunk@33290 -
2016-03-19 17:59:42 +00:00
Jonas Maebe
2b210335a1 * fixed pointer arithmetic errors in WideStrAlloc/StrBufSize/StrDispose
(patch by Iks, mantis #29710)

git-svn-id: trunk@33271 -
2016-03-18 13:12:11 +00:00
michael
668f8eec91 * Patch from Silvio Clecio to declare EArgumentNilException (Bug ID 29850)
git-svn-id: trunk@33258 -
2016-03-16 19:10:10 +00:00
michael
416151a335 * Adapted string routines so they use sizeint instead of integer (bug ID 29814)
git-svn-id: trunk@33246 -
2016-03-13 18:59:21 +00:00
michael
671416959d * Added SameStr, for symmetry and consistency with SameText (bug ID 29821)
git-svn-id: trunk@33238 -
2016-03-13 16:31:41 +00:00
florian
8b81ce7e25 * use PtrUInt instead of Cardinal in GenericAnsiStrLComp and GenericAnsiStrLIComp, resolves #29815
git-svn-id: trunk@33218 -
2016-03-11 20:38:48 +00:00
michael
839a0445a4 Fixed bug in split when final word has length 1 (bug ID 29798)
git-svn-id: trunk@33209 -
2016-03-09 19:56:57 +00:00
michael
5568ee5513 * Bug ID #29779, add DWord versions of StrToInt
git-svn-id: trunk@33153 -
2016-03-05 13:50:59 +00:00
michael
dd00b26c09 * Implement missing functions (Fraction/Exponent/Mantissa/Sign)
git-svn-id: trunk@33060 -
2016-02-06 12:44:23 +00:00
michael
a999f055ef * Implement missing functions (Fraction/Exponent/Mantissa/Sign)
git-svn-id: trunk@33059 -
2016-02-06 12:44:05 +00:00
michael
21920b9cea * Correct string type
git-svn-id: trunk@33058 -
2016-02-06 12:17:41 +00:00
michael
cf530f117e * Faster stringreplace (bug ID 26864)
git-svn-id: trunk@33055 -
2016-02-06 10:19:56 +00:00
michael
6df35742ae * Fix bug #0029461, faSymlink is incompatible with Delphi and plain wrong
git-svn-id: trunk@32985 -
2016-01-22 21:07:27 +00:00
michael
8544b8a500 * Patch from Anthony Walter to make IsValidIdent more strict in case of dotted identifiers (bug ID 29364)
git-svn-id: trunk@32920 -
2016-01-10 22:57:19 +00:00
michael
244be4f4c2 * Added UnicodeStringReplace WideStringReplace (bug ID 28396)
git-svn-id: trunk@32815 -
2015-12-31 16:09:05 +00:00
michael
67d0cd1770 * Fix bug #29273 (extra argument for IsValidIdent)
git-svn-id: trunk@32791 -
2015-12-29 16:55:00 +00:00
michael
a5eb3777de * Fix MaxDateTime constant (bug ID 28282)
git-svn-id: trunk@32775 -
2015-12-28 14:23:23 +00:00
michael
42804c935f * Declare TStringSplitOptions with scopedenum (bug ID 29032)
git-svn-id: trunk@32730 -
2015-12-26 16:16:02 +00:00
michael
891aaa9732 * Fix bug ID #28737
git-svn-id: trunk@32727 -
2015-12-26 15:15:34 +00:00
michael
745c1499df * Mark forgotten implementations with runerror 219
git-svn-id: trunk@32266 -
2015-11-07 12:36:32 +00:00
michael
6955106a13 * Fix TStringSplitOptions
git-svn-id: trunk@32265 -
2015-11-07 12:36:10 +00:00
michael
4a32135563 * no type helpers in version 2.6.*
git-svn-id: trunk@32263 -
2015-11-07 09:54:43 +00:00
michael
fde42ca8ef * Type helpers, compatible to Delphi XE 8
git-svn-id: trunk@32262 -
2015-11-07 09:40:54 +00:00
yury
7c62aadf65 * Fixed string conversion warnings in RTL.
git-svn-id: trunk@31752 -
2015-09-17 17:25:57 +00:00
yury
e1a0b1204a * Removed unused vars in RTL.
git-svn-id: trunk@31750 -
2015-09-17 16:48:53 +00:00
Jonas Maebe
2afd8eb802 - removed FPC_HAS_STR_CURRENCY-related code, FPC 2.6.4 has it
git-svn-id: trunk@31692 -
2015-09-15 11:51:48 +00:00
svenbarth
2cf8cdd885 Fix for Mantis #28650.
rtl/objpas/sysutils/sysstrh.inc:
  * forward PString to ObjPas.PString to avoid potential type conflicts

+ added test

git-svn-id: trunk@31603 -
2015-09-11 15:38:59 +00:00
michael
0958ff80de * Fix bug #28364
git-svn-id: trunk@31185 -
2015-07-01 19:57:10 +00:00
Jonas Maebe
d57a85a2de * fixed compilation on non-Windows systems after r31035
git-svn-id: trunk@31043 -
2015-06-13 22:05:50 +00:00
michael
633c8c7118 * Make sure TSystemTime is seen by fpdoc
git-svn-id: trunk@31035 -
2015-06-13 16:36:37 +00:00
Jonas Maebe
afd5ed4afe * fixed StrPLCopy() with maxlen=0 (mantis #28089, patch by LacaK)
git-svn-id: trunk@30858 -
2015-05-15 09:00:56 +00:00
florian
c2c87828e9 + slightly modified patch by lelekx to implement plugable file routines for the embedded target, resolves issue #22918
git-svn-id: trunk@30759 -
2015-05-02 08:03:18 +00:00
michael
a11fa384b8 * Fix bug #27006
git-svn-id: trunk@30704 -
2015-04-22 17:01:14 +00:00
michael
3b33b2a7bc * Fix bug ID #26512
git-svn-id: trunk@30620 -
2015-04-17 16:44:11 +00:00
michael
1e365f341e * Reverted revision 30557
git-svn-id: trunk@30577 -
2015-04-13 19:45:25 +00:00
michael
10633da13b * Reverted revision 30575 (forgor -depth=immediate
git-svn-id: trunk@30576 -
2015-04-13 19:44:51 +00:00
michael
2cab4a9a73 * Reverted revision 30557
git-svn-id: trunk@30575 -
2015-04-13 19:43:43 +00:00
michael
56715d5d00 * Fix bug #27832
git-svn-id: trunk@30557 -
2015-04-12 17:34:13 +00:00
michael
81fa382c42 * Rename WriteExceptionToStdErr -> WriteErrorsToStdErr
git-svn-id: trunk@30555 -
2015-04-12 15:37:46 +00:00
michael
94e57aa463 * Moved WriteExceptionToStdErr to system unit, so it is observed even in absence of sysutils (bug ID 27708)
git-svn-id: trunk@30551 -
2015-04-12 13:58:49 +00:00
michael
9ae76c3246 * Fix bug ID #27751 (Fill SystemTime.DayOfWeek)
git-svn-id: trunk@30384 -
2015-03-29 21:02:26 +00:00
michael
bda3626025 * Write unhandled exceptions to StdErr. Option to revert back to old behaviour (Bug ID 17346)
git-svn-id: trunk@30140 -
2015-03-08 09:37:35 +00:00
Tomas Hajny
329f788f58 * added conditional possibility of displaying the last OS error in information displayed for unhandled exceptions
git-svn-id: trunk@29622 -
2015-02-04 01:33:14 +00:00
svenbarth
2d454dc8fa Move DynLibs support to System unit using a manager approach like for Threads, WideStrings, etc.. This is needed so that we can support features like "delayed" and loading of dynamic packages.
Each port that allows the usage of dynamic libraries should call InitSystemDynLibs during initialization of the System unit.
The DynLibs unit has been adjusted to be a forwarder for the functions that now reside in the System unit (for backwards compatiblity just in case). Additionally the unit will register the DynLibsManager if it doesn't reside in the System unit anyway.
Currently only the Windows targets (Win32, Win64 and WinCE) implement the DynLibsManager inside the System unit. For other systems using the LoadLibrary, etc. functions will lead to a run error/exception.
If a port wants to implement its own DynLibsManager then it needs to define DISABLE_NO_DYNLIBS_MANAGER. TLibHandle, NilHandle and optionally TOrdinalEntry (it's set to SizeUInt otherwise) should be defined in sysdlh.inc which needs to be enabled using the define FPC_SYSTEM_HAS_SYSDLH (because there are targets which have FEATURE_DYNLIBS enabled, but don't support them... e.g. powerpc-wii -.-).
The DynLibsManager contains methods for loading a library based on a RawByteString and based on a UnicodeString. BOTH should be implemented, but internally one can forward to the other.
The loading by ordinal *can* be be implemented. If it is set to Nil then the implementation of GetProcAddress(lib,ordinal) will return Nil.

+ new functions SetDynLibsManager and GetDynLibsManager to set and retrieve the current DynLibsManager
* provide interface of DynLibs unit in unit System

git-svn-id: trunk@29613 -
2015-02-03 20:00:00 +00:00
marcus
6767ed7103 Amiga, AROS, MorphOS: Sysutils, GetDirs must also cut at DriveSeparator
git-svn-id: trunk@29294 -
2014-12-14 20:16:23 +00:00
florian
4d5f1f04fe * solution in r29126 was brute force, fixed
git-svn-id: trunk@29128 -
2014-11-23 20:37:20 +00:00
florian
9a31cba3d3 * do not blindly insert decimal seperators in StrToFloat, resolves #27029
git-svn-id: trunk@29126 -
2014-11-23 20:18:19 +00:00
pierre
bde3bb4f5b Give a different output if Obj is not a vlaid class
git-svn-id: trunk@29045 -
2014-11-09 22:14:13 +00:00
michael
a45890443b * Fix for regression in 12385
git-svn-id: trunk@28741 -
2014-10-04 15:59:37 +00:00
marco
29e5418a4f * remove construct with exception, mantis #26738, patch by Alexander.
git-svn-id: trunk@28687 -
2014-09-18 11:34:29 +00:00
michael
2a4019b012 * Fix tw13076, broken by previous commit 28660
git-svn-id: trunk@28680 -
2014-09-16 14:00:41 +00:00
michael
4c86a68345 * Fix bug #23954
git-svn-id: trunk@28660 -
2014-09-14 15:58:07 +00:00
marcus
ee31b188f6 AMIGA/MorphOS/AROS: corrected pathes in FP-IDE
git-svn-id: trunk@28620 -
2014-09-08 16:47:38 +00:00
marcus
97831bed8a Amiga, AROS, MorphOS: Define in IncludeTrailingPathDelimiter changed to HASAMIGA
git-svn-id: trunk@28548 -
2014-08-31 06:46:17 +00:00
marcus
5305a4d827 Amiga,AROS,MorphOS: IncludeTrailingPathDelimiter not adding DirectorySeparator after Driveseparator
git-svn-id: trunk@28541 -
2014-08-30 18:22:08 +00:00
nickysn
45ed066fed * fixed SysUtils.FindFirst/FindNext/FindClose on i8086-msdos in the compact and
large memory models by changing TSearchRec.FindHandle to a pointer (because
  THandle is 16-bit on this platform and is thus not able to hold a far pointer
  without truncating it)

git-svn-id: trunk@28451 -
2014-08-18 21:39:20 +00:00
nickysn
2565126d36 * also update TUnicodeSearchRec after r28449
git-svn-id: trunk@28450 -
2014-08-18 21:30:26 +00:00
nickysn
f5c1751be5 + added a define FINDHANDLE_IS_POINTER that indicates that on the current
platform SysUtils.TSearchRec.FileHandle is a Pointer, instead of THandle.
  I didn't introduce a TFindHandle type, because I didn't want to add yet
  another publicly visible type in the SysUtils interface.

git-svn-id: trunk@28449 -
2014-08-18 21:20:07 +00:00
michael
a0f4ff655e * Small optimisation in strnew from Luiz Americo (bug ID 26365)
git-svn-id: trunk@28005 -
2014-06-19 17:40:21 +00:00
michael
6fcff07e50 * SizeInt -> SizeUInt for strPLCopy (Bug ID 26156)
git-svn-id: trunk@27802 -
2014-05-18 07:35:33 +00:00
michael
046b7626dd * Reworked patch from Werner Pamler (bug ID 26168) to add support for periods
git-svn-id: trunk@27801 -
2014-05-18 07:24:59 +00:00
michael
81a95f6f1b * Fix problem with IE for inlined taking address (@S[1]) of empty const
git-svn-id: trunk@27781 -
2014-05-13 17:58:31 +00:00
michael
042e6243a3 * Fixed bug #20522, adapted patch from Bart Broersma
git-svn-id: trunk@27775 -
2014-05-11 18:04:52 +00:00
michael
d9d1a7fa5d * Fix bug ID #18550
git-svn-id: trunk@27774 -
2014-05-11 17:14:20 +00:00
michael
17e34abc62 * Fix for bug ID #18551
git-svn-id: trunk@27773 -
2014-05-11 17:02:56 +00:00
michael
a397b1b480 * Added (modified) patch for appending 0:0:0 in case of full date (Denis Golovan, bug ID #25109)
git-svn-id: trunk@27772 -
2014-05-11 14:11:44 +00:00
michael
276a273e6c * Const string in StrP(L)Copy (bug report 26100)
git-svn-id: trunk@27763 -
2014-05-11 10:11:41 +00:00
michael
47fd732236 * Fix StrToDate incompatibility with delphi in case of trailing whitespace
git-svn-id: trunk@27745 -
2014-05-10 13:41:06 +00:00
Jonas Maebe
35c64a7a69 * properly order all operations in TMultiReadExclusiveWriteSynchronizer
using memory barriers, rather than half-heartedly using atomic
    operations. Fixes random failures in trwsync on POWER7 processors
    (and probably other weakly ordered architectures)

git-svn-id: trunk@27723 -
2014-05-03 14:19:54 +00:00
sergei
b16c6f8ced * i386 and x86_64 changes for Delphi compatibility:
* 'mxcsr' variable made public and renamed to DefaultMXCSR.
  * GetSSECSR and SetSSECSR renamed to GetMXCSR and SetMXCSR, respectively. Previous names continue to exist as deprecated aliases.

git-svn-id: trunk@27656 -
2014-04-25 15:10:12 +00:00
nickysn
a176c2d4f5 + add overloaded versions of HexStr(pointer) for i8086 near and far pointers
- rm ifdefs for i8086 far code memory model when doing stack traces. The
  compiler will now choose the correct overload of HexStr according to the
  CodePointer type.

git-svn-id: trunk@27163 -
2014-03-16 17:40:31 +00:00
michael
f9bb91d722 * Fix case for negative dates (bug ID 23464)
git-svn-id: trunk@27124 -
2014-03-13 09:42:01 +00:00
nickysn
8926a3268c * fixed TTimeStamp for integer=smallint
git-svn-id: trunk@27087 -
2014-03-10 22:31:48 +00:00
nickysn
afea0739c6 * fixed StrToInt, IntToStr and friends for objpas.integer=smallint
git-svn-id: trunk@27067 -
2014-03-10 00:33:53 +00:00
nickysn
ca451988a8 * EInOutError.ErrorCode changed from Longint to Integer (16-bit Delphi 1
compatibility)

git-svn-id: trunk@27044 -
2014-03-09 13:21:27 +00:00
nickysn
73494f004d * the Exception constructors' AHelpContext parameter changed from Integer to
Longint

git-svn-id: trunk@27043 -
2014-03-09 13:09:25 +00:00
michael
77b771e91b * Let ToString return something meaningful for Exception
git-svn-id: trunk@26969 -
2014-03-06 13:34:40 +00:00
michael
0f7e1af3bb * Fixed bug #23464
git-svn-id: trunk@26753 -
2014-02-11 16:36:07 +00:00
Jonas Maebe
5d389e99fd * always use the *W version of the Windows API in ExtractShortPathName() so
it works correctly regardless of white kind of string is passed in
  (and return a string encoded in DefaultRTLFileSystemCodePage)

git-svn-id: trunk@26450 -
2014-01-13 22:21:09 +00:00
marco
ebe262762a * Clean out of $i textrec and filerec includes that are redundant now that cpstrrtl exposes
those records via system. 

git-svn-id: trunk@26356 -
2014-01-02 13:26:09 +00:00
Jonas Maebe
8fe7d82db7 * changed type of TAbstractSearchRec.name_do_not_touch from untyped pointer
into rawbytestring because otherwise -gt can overwrite it
  - removed hack from r25944 in morphos/sysutils.pp that worked around this
    problem

git-svn-id: trunk@25952 -
2013-11-06 13:17:06 +00:00
nickysn
5e09b7a56f * SysUtils functions related to exceptions and stacktraces updated to use CodePointer
git-svn-id: trunk@25515 -
2013-09-17 21:58:53 +00:00
Jonas Maebe
de56f909d5 * synchronized with trunk up to and including r25430
git-svn-id: branches/cpstrrtl@25431 -
2013-09-06 10:09:26 +00:00
svenbarth
b288179d56 Fix for Mantis #24929.
rtl/sysutils/datih.inc:
  + add StrToDate overload which allows passing of specific TFormatSettings parameter
rtl/sysutils/dati.inc:
  * implement new StrToDate overload by calling IntStrToDate similar to StrToTime

git-svn-id: trunk@25392 -
2013-09-01 12:46:54 +00:00
Jonas Maebe
5b09435055 * explicitly call several windows *A() versions of APIs so the intended
routine is called even when we compile with -dFPC_UNICODE_RTL

git-svn-id: branches/cpstrrtl@25308 -
2013-08-19 22:47:12 +00:00
Jonas Maebe
2da7c3f05c * changed declarations in finah.inc and diskh.inc from ansistring to
rawbytestring
  * DoDirSeparators() and GetDirs() marked as "rtlproc" so they can accept
    non-rawbytestring arguments as their var-parameters

git-svn-id: branches/cpstrrtl@25306 -
2013-08-19 22:04:40 +00:00
Jonas Maebe
65ecd1273d * removed warning when GetEnvironmentVariable() does not return a
a unicodestring

git-svn-id: branches/cpstrrtl@25305 -
2013-08-19 22:04:36 +00:00
Jonas Maebe
91079d1327 * ensure that constant string concatenations don't result in converting
input strings to DefaultSystemCodePage

git-svn-id: branches/cpstrrtl@25303 -
2013-08-19 22:04:29 +00:00
Jonas Maebe
af3f12f60c * rawbytestring/unicodestring versions of findfirst/findnext/findclose
o these routines are now generic wrappers in filutil.inc, and call
     the platform-dependent internalfindfirst/next/close routines
   o on unix, the fnmatch routine got proper support for UTF-8 matching
     (e.g., it won't match a partial UTF-8 code point to a "?" wildcard)
   o for NativeNT, a similar (untested) UTF-16 version has been added
  + test for the above
  * rawbytestring/unicodestring versions of fileage

git-svn-id: branches/cpstrrtl@25302 -
2013-08-19 22:04:25 +00:00
Jonas Maebe
29132f45b7 * synchronised with trunk up to r25167 (fixes glib compilation via r25164,
and occasional crashes in executeprocess on libc platforms via r25167)

git-svn-id: branches/cpstrrtl@25169 -
2013-07-24 14:24:49 +00:00
Jonas Maebe
155aafc255 * moved SYSUTILS_HAS_ANSISTR/UNICODESTR_FILEUTIL_IMPL define to interface
so declarations can also depend on it and similar defines (not yet the
    case)
  + added SYSUTILS_HAS_ANSISTR_ENVVAR_IMPL/SYSUTILS_HAS_UNICODESTR_ENVVAR_IMPL
    to indicate whether the platform-dependent part of the unit provides
    an ansistring/unicodestring interface to get environment variables
  + Windows version of getenvironmentvariable(unicodestring)
  + generic ansistring/unicodestring versions of GetEnvironmentVariable()
    in case the platform doesn't provide them
  * result of GetEnvironmentString() is ansistring/unicodestring depending
    on the state of the FPC_RTL_UNICODE define

git-svn-id: branches/cpstrrtl@25116 -
2013-07-16 14:16:34 +00:00
Jonas Maebe
eeb98a0c0f - removed platform-specific implementations of GetCurrentDir, SetCurrentDir,
CreateDir and RemoveDir, and implemented a generic one (based on the OS/2
    version) in the shared sysutils code (so that the filesystem code page
    support for the system unit routines can be reused)
  * include both ansistring and unicodestring versions of the above routines,
    and of ForceDirectories. Exception: GetCurrentDir, which cannot be
    overloaded based on function result and whose return type currently
    dependends on the FPC_UNICODE_RTL define

git-svn-id: branches/cpstrrtl@25113 -
2013-07-16 14:15:55 +00:00
Jonas Maebe
8b77f62873 * don't truncate environment variable strings in GetEnvironmentString()
* set the correct code page for the result of GetEnvironmentString() on
    Windows and NativeNT

git-svn-id: branches/cpstrrtl@25103 -
2013-07-15 09:21:20 +00:00
Jonas Maebe
26b2149ced * converted the following sysutils routines to unicodestring and
rawbytestring: FileExists, DirectoryExists, FileSetDate, FileGetAttr,
    FileSetAttr, DeleteFile, RenameFile, FileSearch, ExeSearch,
    FileIsReadOnly

git-svn-id: branches/cpstrrtl@25078 -
2013-07-09 19:01:45 +00:00
Jonas Maebe
c604e5af17 * small reorganisation of ansistring/unicodestring routine declarations, so
they are the same as in the unicode branch (to more easily apply patches)

git-svn-id: branches/cpstrrtl@25073 -
2013-07-09 19:01:24 +00:00
Jonas Maebe
5ed4e99dc1 + uppercase/lowercase(unicodestring) (fixes a warning in fina.inc when
compiled with unicodestring)
  * changed uppercase/lowercase(ansistring) to use the same logic as the
    new unicode versions (unify code for lower/upper, only make result
    unique if necessary)
  + test for all four routines

git-svn-id: branches/cpstrrtl@25006 -
2013-06-28 12:46:25 +00:00
Jonas Maebe
bae3c0296e * fixed result type of StrBufSize(PWideChar) for 64 bit targets
git-svn-id: branches/cpstrrtl@25002 -
2013-06-28 08:41:46 +00:00
Jonas Maebe
1da05d1553 * declared CharInSet(ansichar,tsyscharset) as inline
* moved the inclusion of sysansi.inc to before the inclusion of all other
    sysutils include files so the inline body of CharInSet is available

git-svn-id: branches/cpstrrtl@25000 -
2013-06-27 21:38:13 +00:00
Jonas Maebe
b08d8091b2 * made fexpand unicodestring-safe (use charinset instead of "in" --
"widechar in set" compiles, but results in a runtime conversion of
    the widechar into an ansistring and then getting the first character
    of that ansistring, which is horribly slow -- and Delphi-incompatible,
    but introduced a long time ago because of bug #7758)
  * replaced all "in" operations in sysutils fina.inc with CharInSet for
    the same reason
  * replaced all "string" declarations in finah.inc/fina.inc with "PathStr"
    and "pchar" with "PathPChar", and include them twice in sysutilh.inc/
    sysutils.inc, once with PathStr=UnicodeString/PathPChar=PWideChar and
    once with PathStr=AnsiString/PathPChar=PAnsiChar (not rawbytestring
    because there are several routines with var-parameters and then the
    string type has to match exactly; the "rtlproc" modifier could circumvent
    this, but should be used sparingly, and additionally the routine's
    internals would then first also have to be reviewed to ensure that at
    no point they start mixing in strings with the defaultsystemcodepage
    (e.g. directory separators) without first adjusting their codepage)
  * call GetShortPathNameA or GetShortPathNameW in ExtractShortPathName on
    Windows depending on whether we are parsing the RawByteString/UnicodeString
    version of fina.inc
  + ExpandUNCFileName(unicode) version for Windows, let its
    ExpandUNCFileName(ansistring) call the unicode version (avoid data loss
    due to ansi conversion) and convert the result to
    DefaultRTLFileSystemCodePage (to have no more data loss than what's
    specified by the user)

git-svn-id: branches/cpstrrtl@24999 -
2013-06-27 21:38:10 +00:00
Jonas Maebe
746546ed09 + remaining missing pwidechar overloads/equivalents of pchar functions
(strecopy, strend, strcat, strcomp, strlcomp, stricomp, strlcat, strrscan,
     strlower, strupper, strlicomp, strpos, WideStrAlloc, StrBufSize,
     StrDispose)
  * adjusted pwidechar version of strnew to call WideStrAlloc instead of
    StrAlloc
  + tests for several newly added sysutils pwidechar routines based on
    existing tests for equivalent pchar routines
  * converted several sysutils ansistr*() function tests to tests for str*
    functions

git-svn-id: branches/cpstrrtl@24998 -
2013-06-27 21:38:06 +00:00
Jonas Maebe
c49ae76837 * let StrBufSize return a cardinal rather than a sizeuint, and also change
its internal pointer arithmetic to use cardinal, because that's also what
    stralloc uses to initialize that value

git-svn-id: branches/cpstrrtl@24996 -
2013-06-27 21:37:58 +00:00
Jonas Maebe
8f1e85d9ae * moved SameFileName from finah.inc to sysansih.inc, since the implementation
is in sysansi.inc

git-svn-id: branches/cpstrrtl@24995 -
2013-06-27 21:37:55 +00:00
Jonas Maebe
95a877c7e5 * moved GetFileHandle() from fina.inc to filutil.inc because fina.inc
will be included twice using different string types (and those two
    routines don't have a string argument, so this would result in duplicate
    definitions), and their declaration is in filutilh.inc rather than
    finah.inc anyway
  * ensure that the fina.inc "MaxDirs" constant gets declared only once
  * ensure that the finah.inc "TFilenameCaseMatch" type gets declared only
    once

git-svn-id: branches/cpstrrtl@24994 -
2013-06-27 21:37:51 +00:00
Jonas Maebe
ba7fc58bed * declare tsyscharset as a set of ansichar instead of as a set of char
(widechar sets are not (yet?) supported)

git-svn-id: branches/cpstrrtl@24989 -
2013-06-27 21:37:29 +00:00
marco
eebfeca41d * removed all ver2_* defines older than 2_4. 2_4 can probably also get removed from trunk, but better in a separate commit.
git-svn-id: trunk@24971 -
2013-06-25 12:46:30 +00:00
Jonas Maebe
ff87431565 - removed "PathOnly" field from Unix TSearchRec (deprecated since 2.4.0, not
initialised or used on any target))

git-svn-id: branches/cpstrrtl@24968 -
2013-06-24 21:24:09 +00:00
Jonas Maebe
3694b4f003 * moved ToSingleByteFileSystemEncodedFileName() to the system unit and
export it so it can be used in all rtl units

git-svn-id: branches/cpstrrtl@24960 -
2013-06-24 09:40:00 +00:00
Jonas Maebe
ecd3cba02b * synchronised with trunk up to r24912
o resolved conflict in updated morphos sysutils unit
   o moved code that had been added to the now deleted  sysunix.inc to the
     unix-specific block of the fpwidestring unit's init code

git-svn-id: branches/cpstrrtl@24913 -
2013-06-17 20:50:02 +00:00
Károly Balogh
60879c9c4f also return the colon for ExtractFileDrive on Amiga/MorphOS
git-svn-id: trunk@24765 -
2013-06-02 11:37:29 +00:00
Károly Balogh
7ce3b803b3 basic Amiga/MorphOS support into ExtractFileDrive
git-svn-id: trunk@24683 -
2013-05-31 23:53:47 +00:00
nickysn
1d8d0d42a5 * size of TByteArray and TWordArray reduced by 1 on 16-bit CPUs to avoid 'structure too large' errors when compiling the sysutils unit
git-svn-id: trunk@24591 -
2013-05-25 13:28:13 +00:00
florian
c25f56fa64 + several pwidechar/unicode string functions added
git-svn-id: trunk@24212 -
2013-04-09 11:09:10 +00:00
Jonas Maebe
25ebb36103 * catch invalid floating point operations in TextToFloat (mantis #24197)
git-svn-id: trunk@24105 -
2013-04-01 11:50:49 +00:00
Jonas Maebe
7dfe1301c3 * fixed type in FloatToStrFIntl introduced in r23311 (mantis #24131)
git-svn-id: trunk@24013 -
2013-03-26 18:53:37 +00:00
svenbarth
db6385ef33 Added exception EObjectCheck for object reference check (runtime error 210).
rtl/objpas/sysconst.pp:
  + add resourcestring SObjectCheckError
rtl/objpas/sysutilh.inc:
  + add new Exception descendant EObjectCheck
rtl/objpas/sysutils.inc:
  + use EObjectCheck with message SObjectCheckError for runtime error 210

git-svn-id: trunk@23656 -
2013-02-24 22:22:38 +00:00
michael
7c8fcb63b7 * Changed DateTimeToTimestamp not to use Round()
git-svn-id: trunk@23337 -
2013-01-07 13:00:27 +00:00
michael
2a9e12c709 * Fixed rounding errors in DateTimeToTimeStamp, causing errors in conversions
git-svn-id: trunk@23334 -
2013-01-07 10:28:47 +00:00
michael
b55eb113a6 * Fixed bug ID #23464
git-svn-id: trunk@23328 -
2013-01-06 16:49:35 +00:00
florian
6363567fba * FloatToStrFIntl is used only internally so we can assume that Value is aligned
git-svn-id: trunk@23311 -
2013-01-04 19:13:28 +00:00
florian
8ee1445b81 * stripped trailing spaces
git-svn-id: trunk@23294 -
2013-01-02 10:50:32 +00:00
florian
82f20cedbd * make threading code dependend on feature switch
git-svn-id: trunk@23293 -
2013-01-02 10:48:29 +00:00
svenbarth
e914ec7f00 Add platform independant support for "GetTickCount" and "GetTickCount64" to unit "SysUtils". "GetTickCount" is declared as deprecated from the beginning and thus "GetTickCount64" should be used instead.
The default implementation of "GetTickCount" just uses the lower 32-Bit from the result of "GetTickCount64". 
The default implementation of "GetTickCount64" is based upon "Now" for systems that support a floating point unit (and thus "Now"). 
Other systems can define a "SysTimerTick" function which is used instead if "HAS_SYSTIMERTICK" is defined.

The Windows implementation of "GetTickCount" uses Windows' "GetTickCount" function. 
The implemenation of "GetTickCount64" checks whether the system is a Windows Vista or newer and then uses Windows' "GetTickCount64" function. Otherwise Windows' "GetTickCount" is used also.

The Unix implementation of "GetTickCount" is the default one. 
The "GetTickCount64" implementation uses "fpgettimeofday".

git-svn-id: trunk@23215 -
2012-12-23 16:12:57 +00:00
Jonas Maebe
9804fd527b * don't add a thousands separator in FormatFloat if there are no digits
before it because the value is too small, regardless of what the format
   pattern sepcifies (patch by Bart Broersma, mantis #13076)

git-svn-id: trunk@23095 -
2012-12-02 16:57:41 +00:00
michael
9d6b4aa946 * Fix dayOfWeek for dates < 0 (bug ID #23144)
git-svn-id: trunk@22679 -
2012-10-17 07:15:01 +00:00
Jonas Maebe
b4971c72d3 * partial fix for mantis #22912 (waiting on clarification from Unicode
consortium for the character.pas unit)

git-svn-id: trunk@22494 -
2012-09-28 07:57:45 +00:00
Jonas Maebe
a3c936fe5f + rawbytestring/unicodestring overloads for FileCreate and FileOpen.
The WinCE implementation converts the rawbytestring arguments to
    unicodestring and calls unicode OS APIs, while the others convert
    unicodestring arguments to DefaultFileSystemCodePage and call
    single byte OS APIs
  + test for the above

git-svn-id: branches/cpstrrtl@22467 -
2012-09-27 07:54:25 +00:00
Jonas Maebe
92064356f0 * prevent code page conversion in CharInSet(widechar,tsyscharset)
git-svn-id: trunk@22464 -
2012-09-26 20:46:19 +00:00
Jonas Maebe
349a682596 * corrected license header from GPL to LGPL + static linking exception like
the rest of the FPC RTL, after confirming with the original author that
    this is ok (mantis #22879)

git-svn-id: trunk@22413 -
2012-09-17 12:12:42 +00:00
Jonas Maebe
193c7af57f * print literal e/E in formatfloat if not followed by +/- (remaining part of
mantis #22290)

git-svn-id: trunk@22248 -
2012-08-26 14:51:32 +00:00
michael
789a6452c9 * Implemented overloaded variant of fileage function
git-svn-id: trunk@21867 -
2012-07-11 10:42:23 +00:00
michael
64ab9c06d3 * Added GetLocalTimeOffset function
git-svn-id: trunk@21865 -
2012-07-11 09:56:34 +00:00
Jonas Maebe
df9c8652be * add default parameter values defined in implementation also to interface
(they don't have effect when they only appear in the implementation, and
     therefore this situation will cause an error in the future)

git-svn-id: trunk@21523 -
2012-06-07 22:36:15 +00:00
Tomas Hajny
99a9955195 + ExpandFileNameCase implementation added
git-svn-id: trunk@21466 -
2012-06-02 22:30:08 +00:00
svenbarth
2f92336b94 Forgot to commit the extension of the TSearchRec with the FindData for NativeNT.
git-svn-id: trunk@21439 -
2012-05-31 07:26:57 +00:00
marco
77197cdc39 * Added CharInSet, Fixes #14599, since issurrogate* already is in unit Character.
git-svn-id: trunk@20131 -
2012-01-20 22:10:32 +00:00
marco
1f40ff2362 * overloaded version of raiselastoserror that allows custom errorcodes
to be raised, patch by Cytax, Mantis #21092

git-svn-id: trunk@20084 -
2012-01-15 11:54:12 +00:00
sergei
abdbe49861 + SysUtils part of SEH (enabled only for win64)
* EExternal.ExceptionRecord changed from field to property and made available on all Windows, not just win32.
* CatchUnhandledException: removed AnsiString variable, ideally there should be no memory allocations in this code path.

git-svn-id: trunk@19849 -
2011-12-14 10:47:26 +00:00
Jonas Maebe
a4804a3c25 * let FloatToStr output the correct number of decimals in case the
first significant digit is preceded by several zeroes (patch by
    C. Western, mantis #16907)

git-svn-id: trunk@19738 -
2011-12-03 22:34:00 +00:00
sergei
e62cd71a2f * Fixed cycling with 2.4.4 after r19707 (2.4.4 does not define FPC_HAS_FEATURE_RESOURCES, so related stuff is not compiled)
git-svn-id: trunk@19711 -
2011-11-30 10:49:47 +00:00
sergei
0093517227 * sysutils: changed RunErrorToExcept to use table instead of case statement for OS exceptions. This is to be able to extract exception class alone for the upcoming SEH support.
* Some Delphi-compatible changes:
  * For floating point underflow condition, raise EUnderflow, not EOverflow.
  * For unknown codes, raise EInOutError, not Exception.
  * Added entries for EZeroDivide and EStackOverflow (actually raising EZeroDivide on floating-point division by zero requires further changes to System because currently both integer and float division by zero is mapped to the same code 200).

  

git-svn-id: trunk@19707 -
2011-11-29 18:41:13 +00:00
paul
80a615c542 rtl: correct error check for encoding methods arguments
git-svn-id: trunk@19399 -
2011-10-07 05:56:02 +00:00
paul
fe782eac07 rtl: add StringOf(TBytes), WideStringOf(TBytes), ByteLength(UnicodeString) for delphi compatibility
git-svn-id: trunk@19392 -
2011-10-06 07:27:27 +00:00
paul
14c2f248df rtl: add WideBytesOf(UnicodeString): TBytes for delphi compatibility
git-svn-id: trunk@19391 -
2011-10-06 06:58:07 +00:00
paul
fa43a448b9 rtl: add BytesOf(String): TBytes for delphi compatibility
git-svn-id: trunk@19390 -
2011-10-06 06:28:05 +00:00
paul
aa666d38ed rtl: check arguments in some TEncoding functions which uses array/string access and raise EEncodingError in case of wrong indexes or string/arrays
git-svn-id: trunk@19387 -
2011-10-06 01:14:51 +00:00
michael
c1ff89a7c2 * Fixed bug in ExeSearch, noted by Tomas
git-svn-id: trunk@19380 -
2011-10-05 07:06:57 +00:00
paul
38a706dd28 rtl: improve CodePageToCodePageName - return official name instead of one of the labels, use binary search
git-svn-id: trunk@19379 -
2011-10-05 05:57:03 +00:00
paul
09fa98a564 rtl: forgotten files
git-svn-id: trunk@19356 -
2011-10-04 05:07:22 +00:00
paul
abf9816a09 rtl: add basic implementation of TEncoding class
git-svn-id: trunk@19355 -
2011-10-04 05:06:32 +00:00
paul
0bfb83b06c rtl: add HashName function based on implementation of Hash() from objpas. It uses case case-insensitive hash generation. This function is added for compatibility with delphi (although it generates different hash in delphi and fpc for same strings). It is also needed for codepage search in hash array.
git-svn-id: trunk@19353 -
2011-10-04 04:54:42 +00:00
florian
77c3477b91 * modified patch by LacaK2 to add overloaded versions of string handling routines, which works with WideChar null terminated strings, resolves #19989
git-svn-id: trunk@19337 -
2011-10-03 16:11:46 +00:00
michael
908f9865d4 * Fixed ExcludeLeadingPathDelimiter
git-svn-id: trunk@19316 -
2011-10-01 21:47:58 +00:00
florian
d7f7a9bb76 * patch by Alexander Shishkin to clean up $ifopt usage by $push/$pop, resolves #20346
git-svn-id: trunk@19256 -
2011-09-27 20:22:40 +00:00
paul
8f4d02ccfa rtl: add TBytes and TUnicodeCharArray types
git-svn-id: trunk@19191 -
2011-09-23 06:19:46 +00:00
paul
98f6ec4a05 rtl: raise EContructException in TCharacter constructor (compatible to delphi behavior)
git-svn-id: trunk@19189 -
2011-09-23 02:50:40 +00:00
paul
1553c8da7d rtl: add EArgumentException, EArgumentOutOfRangeException classes
git-svn-id: trunk@19182 -
2011-09-23 00:07:26 +00:00
marco
b59c42f2c7 * removed exporting a non standard strtotime, which was a workaround for missing
formatsettings/locale versions. Patch by Lacak2, Mantis #19870 (3rd)

git-svn-id: trunk@18110 -
2011-08-06 12:19:44 +00:00
marco
bf65638891 * strtodatetime adapted to new strtotime regime. Take separator from formatsettings.
Second patch fo Mantis #19870

git-svn-id: trunk@18100 -
2011-08-05 13:37:16 +00:00
marco
52afb619aa * add overloaded strtotime, patch by Lacak2, Mantis #19870
git-svn-id: trunk@18093 -
2011-08-04 17:01:34 +00:00
michael
a07b14853a * Changed ImplicitDir default from False to True
git-svn-id: trunk@17735 -
2011-06-13 09:07:17 +00:00
marco
92a7e1c781 * fix typos in windows implementation r17717
git-svn-id: trunk@17723 -
2011-06-11 22:26:42 +00:00
michael
6b42ee69a9 * Changed FileSearch to handle a set of options instead of boolean.
Options now include stripquotes
* Changed ExeSearch so dirlist is optional and PATH is used if omitted. 
  It uses stripQuotes on windows. (bug 19282)

git-svn-id: trunk@17717 -
2011-06-11 11:36:51 +00:00
michael
a201f07420 * Added share mode argument to FileCreate call
git-svn-id: trunk@17548 -
2011-05-23 21:11:07 +00:00
michael
4d572aa08d * Added TEventTypes set
git-svn-id: trunk@17531 -
2011-05-23 12:33:28 +00:00
florian
7de8972e5c * fix Sysutils.AssertErrorHandler as proposed by Martin Friebe in #19130, resolves #19310
git-svn-id: trunk@17470 -
2011-05-15 15:13:22 +00:00
michael
f235e4c116 * Fixed 18183
git-svn-id: trunk@17225 -
2011-04-02 15:41:39 +00:00
marco
10b9f4976f * ENotImplemnted exception, Mantis 18871
git-svn-id: trunk@17083 -
2011-03-06 01:09:01 +00:00
marco
7c1f4b8f20 * pass format string to doformaterror procedure. Mantis 16253
git-svn-id: trunk@17080 -
2011-03-05 17:02:43 +00:00
paul
e4a6221bf3 compiler, rtl: add vtUnicodeString (issue #0018560)
git-svn-id: trunk@16833 -
2011-01-29 09:18:53 +00:00
sergei
131b7fcdb2 * RTL: Replaced deprecated formatting symbols with their up-to-date counterparts, reduces compiler noise.
* Also removed some unused variables.

git-svn-id: trunk@16744 -
2011-01-09 15:27:05 +00:00
sergei
c0f6084c2e * SysUtils.Format: Fixed behavior in case when format specifier contains both index and '*' for width/precision.
+ test

git-svn-id: trunk@16740 -
2011-01-08 20:08:16 +00:00
marco
9534c5bd8b * Delphi XE (2010?) compatible alias for defaultformatsettings.
* deprecated separate globals (Delphi XE). Causes some deprecated
      warnings in dati.inc that still have to be fixed.

git-svn-id: trunk@16482 -
2010-11-30 09:49:19 +00:00
sergei
907e7a32d5 * GetFileHandle(), THandleStream: changed type that is used to store file handle from Integer to THandle, so it can be redefined to 64 bits on certain platforms, see http://lists.freepascal.org/lists/fpc-devel/2010-November/023019.html
git-svn-id: trunk@16383 -
2010-11-20 12:58:53 +00:00
sergei
6d89ec4ee4 * SysUtils unit, fixed return value of FileSetDate:
* return value of GetLastOSError if one is available, to be consistent with handle-based implementations and Delphi behavior.
  * otherwise, return -1

git-svn-id: trunk@16318 -
2010-11-09 09:52:42 +00:00
florian
b4c912bf92 * made Byte/Word/Long/Int64Rec endian safe
+ Int128/OWordRec

git-svn-id: trunk@16279 -
2010-10-31 17:57:54 +00:00
sergei
6a9a991dca * Fixed TryStrToDateTime so it returns True only if both date and time are parsed successfully, resolves #17541.
git-svn-id: trunk@16099 -
2010-10-07 09:48:18 +00:00
michael
b93ab63038 * Fixed IntToHex in case of (0,0)
git-svn-id: trunk@16026 -
2010-09-20 07:46:04 +00:00
michael
154c6ec4d2 * Implementation of values 11..15 of negcurrentformat from Zeljan Rikalo
git-svn-id: trunk@15982 -
2010-09-14 11:23:41 +00:00
michael
f7b268713d * Patch from Zeljan Rikalo to fix issue #13722 (FloatToStrF negative 0)
git-svn-id: trunk@15945 -
2010-09-06 11:09:39 +00:00
florian
4671615dc7 * disable east asia/era stuff on WinCE, the functions does not seem to be available there, fixed compilation of trunk for WinCE
git-svn-id: trunk@15782 -
2010-08-11 20:30:14 +00:00
marco
8caa62618f * support for east asia locale in formatdatetime. Patch from Taka_JP, mantis 14955 modified for recent sysutils rework, and to init eastasia support only once.
git-svn-id: trunk@15776 -
2010-08-11 09:03:13 +00:00
Jonas Maebe
89be8d45e3 * use TrueBoolStrs/FalseBoolStrs for *StrToBool* (mantis #16848)
git-svn-id: trunk@15764 -
2010-08-10 13:06:22 +00:00
Jonas Maebe
7d27f4c21d * also support variants for %s in sysutils.format (mantis #16787)
git-svn-id: trunk@15509 -
2010-07-02 19:59:58 +00:00
ivost
980c353421 * added function IncludeLeadingPathDelimiter: it adds a path delimiter in front of a path
* added function ExcludeLeadingPathDelimiter: it removes a path delimiter in front of a path
* added function ConcatPaths: it concats multiple path fragments, path delimiters are added if necessary

git-svn-id: trunk@15167 -
2010-04-24 21:05:05 +00:00
Jonas Maebe
a18f2594e2 * fixed FloatToStr for ffGeneral when dealing with numbers whose number of
significant digits before the decimal points matches the precision
    parameter exactly (mantis #16188)
  * round instead of cut off digits in FloatToStr with ffGeneral
  * take into account the minus sign when determining whether a number needs
    to be represented using ffExponent instead of ffGeneral because it has
    too many digits

git-svn-id: trunk@15114 -
2010-04-05 14:54:24 +00:00
ivost
a6022f5df2 * removed IImplementorGetter interface and replaced it by the guid IObjectReference.
* GetInterface and GetInterfaceWeak is modified so that when querying for IObjectReference not an interface is returned but the object pointer

git-svn-id: trunk@15087 -
2010-03-28 12:35:50 +00:00
ivost
7025b1ac01 * added supports helper functions for IInterface supports TClass -> TObject,Boolean
git-svn-id: trunk@15086 -
2010-03-28 11:51:38 +00:00
ivost
5a588e5f06 * fixed Supports function so that it's using new function GetInterfaceWeak. Supports may have accidentially freed a objects.
git-svn-id: trunk@15078 -
2010-03-27 17:02:09 +00:00
Jonas Maebe
d5f415b047 * initialise fwritelocked and freadercount in the TMREWS constructor using
atomic operations so that in case it's created while multiple threads are
    already running, all threads are guaranteed to see this initialisation
  * some minor changes to the comments of TMREWS

git-svn-id: trunk@15074 -
2010-03-27 12:44:51 +00:00
ivost
8391b717ea * Some (delphi) applications expect that the QueryInterface method is invoked as first priority to query for an interface and GetInterface as 2nd priority
* The changes to the support functions are going to conform that.

git-svn-id: trunk@15066 -
2010-03-26 00:01:52 +00:00
marco
49fc4795e3 * fix for mantis 16052 RFC4122 compliance of own random GUID creation. Part II
git-svn-id: trunk@15024 -
2010-03-20 14:08:10 +00:00
marco
b6048862b8 * fix for mantis 16052 RFC4122 compliance of own random GUID creation.
git-svn-id: trunk@15023 -
2010-03-20 13:03:45 +00:00
marco
be98b13554 * fix for 11263, changed fileread and fd_zero to out using $modeswitch.
git-svn-id: trunk@14965 -
2010-03-01 22:35:14 +00:00
joost
151fab0548 * Moved TEventType from eventlog.pp tot sysutils
* Added empty TCustomApplication.Log method

git-svn-id: trunk@14960 -
2010-03-01 13:15:36 +00:00
marco
706f0b7975 * New more delphi compat intstrtotime by Bart Broersma #15505 + test
git-svn-id: trunk@14854 -
2010-02-03 15:10:14 +00:00
Jonas Maebe
89e4e0fd25 * only wake up readers if all recursive write locks have been freed
git-svn-id: trunk@14831 -
2010-01-29 21:56:46 +00:00
Jonas Maebe
13e8b3f23e * don't give a "NoThreadError" for any default rtl/basicevent* routines,
so the TMultiReadExclusiveWriteSynchronizer routines can be safely
    executed even with the default thread manager -> removed ismultithread
    checks, so that it keeps working even if ismultithread is set to true
    between acquiring and freeing a lock (mantis #15619)

git-svn-id: trunk@14830 -
2010-01-29 21:01:11 +00:00
Jonas Maebe
e4858445c7 * make sure fwritelocked remains set correctly when using recursive write locks
git-svn-id: trunk@14828 -
2010-01-29 18:10:10 +00:00
Jonas Maebe
2c477269d0 * added a readbarrier after acquiring a read or write lock on
TMultiReadExclusiveWriteSynchronizer, to ensure that out-of-order
    execution cannot already perform some reads inside the critical section
    before the lock has been acquired
  - removed now unnecessary read barrier before releasing a read lock

git-svn-id: trunk@14820 -
2010-01-27 22:23:41 +00:00
florian
50d1008577 * superfluos empty lines removed
git-svn-id: trunk@14596 -
2010-01-10 13:24:41 +00:00
Jonas Maebe
49f01e7b64 * replaced writelock of TMultiReadExclusiveWriteSynchronizer with a
critical section, so that it can be entered recursively just like
    the one from TSimpleRWSync + test
  - reverted r14593, since the reason for using TRWSync instead of
    TMultiReadExclusiveWriteSynchronizer was because the former
    supported recursive write locks

git-svn-id: trunk@14594 -
2010-01-10 12:14:21 +00:00
Jonas Maebe
356845ba1e * set function results for unimplemented generic thread manager routines
(to remove warnings)
  * don't give a thread error for basicevent and threadevent routines if
    isMultiThreaded is false, except for the waiting routines (the new
    TMultiReadExclusiveWriteSynchronizer creates/sets such events in the
    constructor, which caused thread manager errors in case cthreads was
    not used under unix)
  * don't perform any actual locking in TMultiReadExclusiveWriteSynchronizer
    routines if isMultiThreaded is false (in order to avoid the errors
    described above)
  + added generic RTLeventResetEvent stub

git-svn-id: trunk@14592 -
2010-01-10 11:04:05 +00:00
paul
9bad162368 rtl: fix crash in TMultiReadExclusiveWriteSynchronizer.Beginwrite
git-svn-id: trunk@14591 -
2010-01-10 09:35:37 +00:00
paul
538cf8667b rtl: fix compilation under windows
git-svn-id: trunk@14590 -
2010-01-10 06:28:50 +00:00
Jonas Maebe
8da0a031bf * fixed memory leak in new TMultiReadExclusiveWriteSynchronizer
(fwaitingwriterlock was not freed)
  * fixed typo in comment
  * free all memory in trwsync.pp test

git-svn-id: trunk@14588 -
2010-01-09 23:14:53 +00:00
Jonas Maebe
106baa8b2f * optimized version of TMultiReadExclusiveWriteSynchronizer that allows
concurrent readers (mantis #14451)

git-svn-id: trunk@14587 -
2010-01-09 23:00:45 +00:00
marco
8e9a7e14ad * Revised yesterday solution to a more general one. Executeprocess gets
another parameter, a set type with flags, default = []

git-svn-id: trunk@14572 -
2010-01-07 20:49:28 +00:00
paul
5cc182ac07 rtl: fix FormatFloat to skip first spaces
git-svn-id: trunk@14490 -
2009-12-28 15:53:35 +00:00
florian
230142f08b * change length parameter of CompareMem/CompareMemRange into PtrUInt, resolves #15190
* use CompareByte inside these routines instead of simple handmade code

git-svn-id: trunk@14435 -
2009-12-13 11:42:05 +00:00
michael
01ed4a6745 * Implemented OnBeep to install custom beep handler
git-svn-id: trunk@14254 -
2009-11-22 17:33:56 +00:00