<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to patches</title><link>https://sourceforge.net/p/lkjson/patches/</link><description>Recent changes to patches</description><atom:link href="https://sourceforge.net/p/lkjson/patches/feed.rss" rel="self"/><language>en</language><lastBuildDate>Wed, 02 Dec 2020 09:02:13 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/lkjson/patches/feed.rss" rel="self" type="application/rss+xml"/><item><title>#10 Fixes for Delphi Rio support for osx64</title><link>https://sourceforge.net/p/lkjson/patches/10/?limit=25#1424</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Tried this. Solves a similar issue on win64-target configuration.&lt;br/&gt;
Original Error was in mem_ch method.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Danie van Eeden</dc:creator><pubDate>Wed, 02 Dec 2020 09:02:13 -0000</pubDate><guid>https://sourceforge.net12a958cb5fdf99f56ade16b856142a8e103a1ecb</guid></item><item><title>Fixes for Delphi Rio support for osx64</title><link>https://sourceforge.net/p/lkjson/patches/10/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I had to convert using PChar to using array of char in order to have the GenerateText function in osx64 compiler.&lt;br/&gt;
Also, I had to use FormatSettings.DecimalSeparator to initialize the DecimalSeparator variable in order to get a correct result in MacOS Catalina&lt;br/&gt;
Hope this helps anyone&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Albert</dc:creator><pubDate>Thu, 17 Oct 2019 09:36:02 -0000</pubDate><guid>https://sourceforge.neta4c9a71b9caf14984f551d2533e4db7ef50e1e85</guid></item><item><title>fix for valid json parsing</title><link>https://sourceforge.net/p/lkjson/patches/9/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;need to add (idx &amp;gt; 1) condition to js_base function:&lt;br /&gt;
function js_base(idx: Integer; var ridx: Integer; var o:&lt;br /&gt;
TlkJSONbase): Boolean;&lt;br /&gt;
begin&lt;br /&gt;
skip_spc(idx);&lt;br /&gt;
result := (idx &amp;gt; 1) and js_boolean(idx, idx, o);&lt;br /&gt;
if not result then result := (idx &amp;gt; 1) and js_null(idx, idx, o);&lt;br /&gt;
if not result then result := (idx &amp;gt; 1) and js_number(idx, idx, o);&lt;br /&gt;
if not result then result := (idx &amp;gt; 1) and js_string(idx, idx, o);&lt;br /&gt;
if not result then result := (idx &amp;gt; 1) and js_list(idx, idx, o);&lt;br /&gt;
if not result then result := js_object(idx, idx, o);&lt;br /&gt;
if result then ridx := idx;&lt;br /&gt;
end;&lt;/p&gt;
&lt;p&gt;this will fix the wrong paring of json like this:&lt;br /&gt;
841{test:true}&lt;/p&gt;
&lt;p&gt;instead of returning nil, it returns TlkJsonNumber&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sergey Galezdinov</dc:creator><pubDate>Mon, 03 Sep 2012 10:47:06 -0000</pubDate><guid>https://sourceforge.net0c5ebb22ea40f6f74c657520e0bbdc8fd32ab8f9</guid></item><item><title>add overload for widestring</title><link>https://sourceforge.net/p/lkjson/patches/8/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;please add this method to code&lt;/p&gt;
&lt;p&gt;function TlkJSONobject.Add(const aname: WideString; aobj: TlkJSONbase): Integer;&lt;br /&gt;
var&lt;br /&gt;
mth: TlkJSONobjectmethod;&lt;br /&gt;
begin&lt;br /&gt;
if not assigned(aobj) then&lt;br /&gt;
begin&lt;br /&gt;
result := -1;&lt;br /&gt;
exit;&lt;br /&gt;
end;&lt;br /&gt;
mth := TlkJSONobjectmethod.Create;&lt;br /&gt;
mth.FName := aname;&lt;br /&gt;
mth.FValue := aobj;&lt;br /&gt;
result := self._Add(mth);&lt;br /&gt;
if FUseHash then&lt;br /&gt;
{$IFDEF USE_HASH}&lt;br /&gt;
ht.AddPair(aname, result);&lt;br /&gt;
{$ELSE}&lt;br /&gt;
ht.Insert(aname, result);&lt;br /&gt;
{$ENDIF USE_HASH}&lt;br /&gt;
end;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sergey Galezdinov</dc:creator><pubDate>Wed, 18 Jan 2012 10:10:26 -0000</pubDate><guid>https://sourceforge.netc36cd1e4ef7029f4bfd813207d260e397db5c155</guid></item><item><title>Speed improvement in parsing</title><link>https://sourceforge.net/p/lkjson/patches/7/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;This code loads huge json at least 10 times faster due to less string memory reallocation.&lt;br /&gt;
To compare the speed, use json with a lot of "/", "\" symbols and a lot of unicode characters like "\u0442"&lt;br /&gt;
Sample file: &lt;a href="http://pastebin.com/m2ECz9Gp" rel="nofollow"&gt;http://pastebin.com/m2ECz9Gp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;On my machine parsing with old function lasts about 2 minutes. New version parses file in 3-5 seconds. Feel the difference.&lt;br /&gt;
Hope this will help your projects&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sergey Galezdinov</dc:creator><pubDate>Wed, 18 Jan 2012 10:04:02 -0000</pubDate><guid>https://sourceforge.netab00f34a7359a0b9db48d6e9a9f7d09af06f5719</guid></item><item><title>int64 support</title><link>https://sourceforge.net/p/lkjson/patches/6/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;1. add to &lt;/p&gt;
&lt;p&gt;TlkJSONcustomlist = class(TlkJSONbase)&lt;br /&gt;
protected&lt;/p&gt;
&lt;p&gt;function getInt64(idx: Integer): Int64; virtual; //added by Lucefer&lt;/p&gt;
&lt;p&gt;2. add to&lt;/p&gt;
&lt;p&gt;TlkJSONobject = class(TlkJSONcustomlist)&lt;br /&gt;
protected&lt;/p&gt;
&lt;p&gt;//[START] Added by Lucefer 20090602&lt;br /&gt;
function getInt64(idx: Integer): Int64; overload; override;&lt;br /&gt;
function {$ifdef TCB_EXT}getInt64FromName{$else}getInt64{$endif}&lt;br /&gt;
(nm: string): Int64; overload;&lt;br /&gt;
//[END] Added by Lucefer 20090602&lt;/p&gt;
&lt;p&gt;3. add somewhere below&lt;/p&gt;
&lt;p&gt;//[START] Added by Lucefer 20090602&lt;br /&gt;
function TlkJSONcustomlist.getInt64(idx: Integer): Int64;&lt;br /&gt;
var&lt;br /&gt;
jn: TlkJSONnumber;&lt;br /&gt;
begin&lt;br /&gt;
jn := Child[idx] as TlkJSONnumber;&lt;br /&gt;
if not assigned(jn) then result := 0&lt;br /&gt;
else result := round(int(jn.Value));&lt;br /&gt;
end;&lt;br /&gt;
//[END] Added by Lucefer 20090602&lt;/p&gt;
&lt;p&gt;4. and one more:&lt;/p&gt;
&lt;p&gt;//[START] Added by Lucefer 20090602&lt;br /&gt;
function TlkJSONobject.getInt64(idx: Integer): Int64;&lt;br /&gt;
var&lt;br /&gt;
jn: TlkJSONnumber;&lt;br /&gt;
begin&lt;br /&gt;
jn := FieldByIndex[idx] as TlkJSONnumber;&lt;br /&gt;
if not assigned(jn) then result := 0&lt;br /&gt;
else result := round(int(jn.Value));&lt;br /&gt;
end;&lt;/p&gt;
&lt;p&gt;{$ifdef TCB_EXT}&lt;br /&gt;
function TlkJSONobject.getInt64FromName(nm: string): Int64;&lt;br /&gt;
{$else}&lt;br /&gt;
function TlkJSONobject.getInt64(nm: string): Int64;&lt;br /&gt;
{$endif}&lt;br /&gt;
begin&lt;br /&gt;
result := getInt64(IndexOfName(nm));&lt;br /&gt;
end;&lt;br /&gt;
//[END] Added by Lucefer 20090602&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">SergeyNikitin</dc:creator><pubDate>Tue, 17 Nov 2009 22:37:13 -0000</pubDate><guid>https://sourceforge.net889b1fb194996082c7f3ee5fb6fb7533c1a6f282</guid></item><item><title>Remove exclusive file open</title><link>https://sourceforge.net/p/lkjson/patches/5/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;into class function TlkJSONstreamed.LoadFromFile(srcname: string):&lt;br /&gt;
fs := TFileStream.Create(srcname, fmOpenRead);&lt;br /&gt;
changed to&lt;br /&gt;
fs := TFileStream.Create(srcname, fmOpenRead or fmShareDenyNone);&lt;/p&gt;
&lt;p&gt;class function TlkJSONstreamed.LoadFromFile(srcname: string):&lt;br /&gt;
TlkJSONbase;&lt;br /&gt;
var&lt;br /&gt;
fs: TFileStream;&lt;br /&gt;
begin&lt;br /&gt;
result := nil;&lt;br /&gt;
if not FileExists(srcname) then exit;&lt;br /&gt;
try&lt;br /&gt;
fs := TFileStream.Create(srcname, fmOpenRead or fmShareDenyNone);&lt;br /&gt;
result := LoadFromStream(fs);&lt;br /&gt;
finally&lt;br /&gt;
if Assigned(fs) then FreeAndNil(fs);&lt;br /&gt;
end;&lt;br /&gt;
end;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">SergeyNikitin</dc:creator><pubDate>Tue, 17 Nov 2009 19:55:54 -0000</pubDate><guid>https://sourceforge.net8854a4cf645ee778d18f6aa8740aa04503058de4</guid></item><item><title>changed js_string</title><link>https://sourceforge.net/p/lkjson/patches/4/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;solved problem with escaped characters (\\ \" etc) and solved prooblem with {"a", "b:\\"} &lt;/p&gt;
&lt;p&gt;function js_string(idx: Integer; var ridx: Integer; var o:TlkJSONbase): Boolean;&lt;/p&gt;
&lt;p&gt;function strSpecialChars(const s: string): string;&lt;br /&gt;
var&lt;br /&gt;
i, j : integer;&lt;br /&gt;
begin&lt;br /&gt;
i := Pos('\', s);&lt;br /&gt;
if (i = 0) then&lt;br /&gt;
Result := s&lt;br /&gt;
else&lt;br /&gt;
begin&lt;br /&gt;
Result := Copy(s, 1, i-1);&lt;br /&gt;
j := i;&lt;br /&gt;
repeat&lt;br /&gt;
if (s[j] = '\') then&lt;br /&gt;
begin&lt;br /&gt;
inc(j);&lt;br /&gt;
case s[j] of&lt;br /&gt;
'\': Result := Result + '\';&lt;br /&gt;
'"': Result := Result + '"';&lt;br /&gt;
'''': Result := Result + '''';&lt;br /&gt;
'/': Result := Result + '/';&lt;br /&gt;
'b': Result := Result + #8;&lt;br /&gt;
'f': Result := Result + #12;&lt;br /&gt;
'n': Result := Result + #10;&lt;br /&gt;
'r': Result := Result + #13;&lt;br /&gt;
't': Result := Result + #9;&lt;br /&gt;
'u':&lt;br /&gt;
begin&lt;br /&gt;
Result := Result + code2utf(strtoint('$' + copy(s, j + 1, 4)));&lt;br /&gt;
inc(j, 4);&lt;br /&gt;
end;&lt;br /&gt;
end;&lt;br /&gt;
end&lt;br /&gt;
else&lt;br /&gt;
Result := Result + s[j];&lt;br /&gt;
inc(j);&lt;br /&gt;
//[Start] Changed by Lucefer 20090602 from: until j &amp;gt;= length(s);&lt;br /&gt;
until j &amp;gt; length(s);&lt;br /&gt;
//[End] Changed by Lucefer 20090602&lt;br /&gt;
end;&lt;br /&gt;
end;&lt;/p&gt;
&lt;p&gt;//[START] changed by Lucefer 20090610&lt;br /&gt;
var&lt;br /&gt;
js: TlkJSONstring;&lt;br /&gt;
ws: String;&lt;br /&gt;
posc, posq :Integer;&lt;br /&gt;
begin&lt;br /&gt;
skip_spc(idx);&lt;/p&gt;
&lt;p&gt;result := xe(idx) and (txt[idx] = '"');&lt;br /&gt;
if not result then exit;&lt;/p&gt;
&lt;p&gt;//Находим завершающий строку (но не escейпленный) символ '"',&lt;br /&gt;
inc(idx);      //Пропускаем первую (стартовую) кавычку&lt;br /&gt;
posq := -1;    //Позиция финальной кавычки&lt;br /&gt;
posc := idx;   //Начало поиска&lt;br /&gt;
while (posc&amp;lt;length(txt)) do begin&lt;br /&gt;
//Ищем до конца строки (худший случай)&lt;br /&gt;
if txt[posc]='\' then begin&lt;br /&gt;
inc(posc, 2); //Пропускаем esc символ.&lt;br /&gt;
continue;&lt;br /&gt;
end;&lt;br /&gt;
if txt[posc]='"' then begin&lt;br /&gt;
posq:=posc;&lt;br /&gt;
break;&lt;br /&gt;
end;&lt;br /&gt;
inc(posc);&lt;br /&gt;
end;&lt;/p&gt;
&lt;p&gt;if posq&amp;lt;0 then begin&lt;br /&gt;
//Не нали :(&lt;br /&gt;
result := false;&lt;br /&gt;
//idx := length(txt); нужно или нет???&lt;br /&gt;
exit;&lt;br /&gt;
end else begin&lt;br /&gt;
//Нашли&lt;br /&gt;
Result := true;&lt;br /&gt;
ws := copy(txt, idx, posq-idx);&lt;br /&gt;
inc(idx, length(ws)+1);&lt;br /&gt;
end;&lt;/p&gt;
&lt;p&gt;//Старый код ошибался на квотированныйх строках или строках с эскэйп последовательностью, типа {"b":"m:\\"}&lt;br /&gt;
ws := strSpecialChars(ws);&lt;/p&gt;
&lt;p&gt;js := TlkJSONstring.Create;&lt;br /&gt;
{$ifdef USE_D2009}&lt;br /&gt;
js.FValue := UTF8ToString(ws);&lt;br /&gt;
{$else}&lt;br /&gt;
js.FValue := UTF8Decode(ws);&lt;br /&gt;
{$endif}&lt;br /&gt;
add_child(o, TlkJSONbase(js));&lt;br /&gt;
ridx := idx;&lt;br /&gt;
//[END] changed by Lucefer 20090610&lt;br /&gt;
end;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Wed, 10 Jun 2009 12:36:39 -0000</pubDate><guid>https://sourceforge.net30f076e01cf07549d82b34b7bc553e0e1e364fd3</guid></item><item><title>lost last char in the string</title><link>https://sourceforge.net/p/lkjson/patches/3/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;function strSpecialChars(const s: string): string;&lt;br /&gt;
must have&lt;br /&gt;
until j &amp;gt; length(s);&lt;br /&gt;
but not a &lt;br /&gt;
until j &amp;gt;= length(s)&lt;/p&gt;
&lt;p&gt;Lucefer&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Thu, 04 Jun 2009 22:02:06 -0000</pubDate><guid>https://sourceforge.net4d9306120adebc5700356f2b20e929faddaeed47</guid></item><item><title>(much) faster js_string Parse</title><link>https://sourceforge.net/p/lkjson/patches/2/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I have replaced the js_string function in TlkJSON.ParseText with a modified version, speed increase in the 1.02 'test' app is about 100%.&lt;/p&gt;
&lt;p&gt;sorry for the non-patch format.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Joao Inacio</dc:creator><pubDate>Mon, 17 Mar 2008 17:38:12 -0000</pubDate><guid>https://sourceforge.net6db18dd08e3133c4e5a5c0f367814e684d32087f</guid></item></channel></rss>